@import url(/styles/reset.css);
@import url(/fonts/TildaSans-Semibold/TildaSans-Semibold.css);
@import url(/fonts/TildaSans-Medium/TildaSans-Medium.css);

body {
    background-color: #d8d8d8;
}

.head-text {
    font-size: 3em;
    font-family: 'TildaSansSemibold', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px 0;
    text-align: center;
}

.head-text h1 {
    font-size: inherit;
    max-width: 85%;
    line-height: 1.2;
}

#back-mainpage {
    height: 80px;
    width: auto;

    position: absolute;
    left: 5px;
    top: 5px;

    border-radius: 10px;
    border-color: black;
    border-style: solid;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#back-mainpage:hover {
    background-color: white;
}

.first-catalog, .second-catalog {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.catalog {
    background-color: white;
    width: 590px;
    max-width: 100%;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.2);
    box-shadow: 0px 0px 30px rgb(99, 99, 99);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    flex: 1 1 auto;
}

.catalog:hover {
    box-shadow: 0px 0px 50px rgba(0,0,0,0.3);
}

.text-catalog {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    flex: 1;
}

#heading-catalog {
    font-size: 30px;
    font-family: 'TildaSansSemibold', sans-serif;
    text-align: center;
}

#paragraph-catalog {
    font-size: 20px;
    font-family: 'TildaSansMedium', sans-serif;
    text-align: center;
    padding: 0 10px;
}

#btn-catalog {
    background-color: #f57f17;
    color: white;
    font-size: 18px;
    font-family: 'TildaSansMedium', sans-serif;
    height: 44px;
    width: 101px;
    margin: 17px 15px 25px;
    border: 1px solid black;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#btn-catalog:hover {
    background-color: #ffa659;
}

#img-catalog {
    display: block;
    width: calc(100% - 28px);
    margin: 14px 14px 0 14px;
    height: auto;
    aspect-ratio: 560 / 480;
    object-fit: cover;
    border-radius: 20px;
}

/* ===== АДАПТИВ ДЛЯ ПЛАНШЕТОВ ===== */
@media (max-width: 1024px) {
    .head-text {
        font-size: 2em;
        padding: 20px 0 20px 80px;
        text-align: center;
        position: relative;
        min-height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .head-text h1 {
        margin: 0;
        line-height: 1.2;
        font-size: inherit;
    }

    #back-mainpage {
        height: 60px;
        width: auto;
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

    .first-catalog, .second-catalog {
        flex-wrap: wrap;
        gap: 30px;
    }

    .catalog {
        width: 45%;
        min-width: 320px;
        margin: 20px;
        height: auto;
        min-height: 580px;
    }

    #img-catalog {
        width: calc(100% - 28px);
        height: auto;
        max-height: 380px;
        object-fit: cover;
        margin-left: 14px;
    }

    .text-catalog {
        gap: 15px;
        padding: 15px;
    }

    #heading-catalog {
        font-size: 26px;
    }

    #paragraph-catalog {
        font-size: 18px;
    }

    #btn-catalog {
        height: 44px;
        width: 110px;
        font-size: 18px;
        margin: 10px auto 20px;
    }
}

/* ===== АДАПТИВ ДЛЯ ТЕЛЕФОНОВ (ГОРИЗОНТАЛЬНАЯ ОРИЕНТАЦИЯ) ===== */
@media (max-width: 850px) and (orientation: landscape) {
    .head-text {
        font-size: 1.5em;
        padding: 15px 0 15px 70px;
        min-height: 60px;
    }

    #back-mainpage {
        height: 45px;
    }

    .catalog {
        width: 48%;
        min-width: 280px;
        min-height: 480px;
    }

    #img-catalog {
        max-height: 260px;
    }

    #heading-catalog {
        font-size: 22px;
    }

    .text-catalog {
        gap: 10px;
        padding: 12px;
    }
}

/* ===== АДАПТИВ ДЛЯ ТЕЛЕФОНОВ ===== */
@media (max-width: 767px) {
    .head-text {
        font-size: 1.4em;
        padding: 15px 0 15px 60px;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        box-sizing: border-box;
    }

    .head-text h1 {
        max-width: 100%;
        line-height: 1.3;
        text-align: center;
        margin: 0;
        font-size: 1em;
    }

    #back-mainpage {
        height: 40px;
        width: auto;
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
    }

    .first-catalog {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .catalog {
        width: 90%;
        max-width: 500px;
        margin: 0 auto 25px;
        height: auto;
        min-height: 0;
    }

    #img-catalog {
        width: calc(100% - 20px);
        margin-left: 10px;
        height: auto;
        max-height: 320px;
        object-fit: cover;
    }

    .text-catalog {
        gap: 12px;
        padding: 12px;
    }

    #heading-catalog {
        font-size: 22px;
    }

    #paragraph-catalog {
        font-size: 15px;
        padding: 0 5px;
    }

    #btn-catalog {
        height: 42px;
        width: 105px;
        font-size: 17px;
        margin: 10px auto 20px;
    }
}

/* ===== ДЛЯ МАЛЕНЬКИХ ТЕЛЕФОНОВ ===== */
@media (max-width: 480px) {
    .head-text {
        font-size: 1.2em;
        padding: 12px 0 12px 50px;
        min-height: 55px;
    }

    .head-text h1 {
        font-size: 0.95em;
    }

    #back-mainpage {
        height: 32px;
        left: 6px;
        border-radius: 8px;
    }

    .catalog {
        width: 95%;
        margin: 0 auto 20px;
        border-radius: 16px;
    }

    #img-catalog {
        width: calc(100% - 16px);
        margin-left: 8px;
        max-height: 240px;
    }

    .text-catalog {
        gap: 10px;
        padding: 10px;
    }

    #heading-catalog {
        font-size: 20px;
    }

    #paragraph-catalog {
        font-size: 14px;
    }

    #btn-catalog {
        height: 38px;
        width: 95px;
        font-size: 15px;
        margin: 8px auto 15px;
        border-radius: 8px;
    }
}

/* ===== ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ТЕЛЕФОНОВ ===== */
@media (max-width: 360px) {
    .head-text {
        font-size: 1em;
        padding: 10px 0 10px 45px;
        min-height: 50px;
    }

    .head-text h1 {
        font-size: 0.85em;
    }

    #back-mainpage {
        height: 28px;
        left: 5px;
    }

    #heading-catalog {
        font-size: 18px;
    }

    #paragraph-catalog {
        font-size: 13px;
    }

    #btn-catalog {
        height: 36px;
        width: 90px;
        font-size: 14px;
    }

    .text-catalog {
        gap: 8px;
        padding: 8px;
    }
}

/* ===== ДЛЯ ПЛАНШЕТОВ В ВЕРТИКАЛЬНОЙ ОРИЕНТАЦИИ ===== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .head-text {
        padding: 20px 0 20px 80px;
    }

    .catalog {
        width: 80%;
        max-width: 550px;
        margin: 20px auto;
    }

    #img-catalog {
        max-height: 420px;
    }

    .head-text {
        font-size: 2em;
    }
}

/* ===== ДЛЯ СЕНСОРНЫХ УСТРОЙСТВ ===== */
@media (hover: none) and (pointer: coarse) {
    .catalog:active {
        box-shadow: 0px 0px 40px rgba(0, 0, 0, 0.2);
        transform: scale(0.99);
        transition: transform 0.1s ease;
    }

    #btn-catalog:active {
        background-color: #ffa659;
        transform: scale(0.96);
    }

    #back-mainpage:active {
        background-color: white;
        transform: scale(0.97);
    }
}