/*
 * Мини-слайдер баннеров новой мобильной главной (до 767 px).
 * Высота задаётся переменной --main-mobile-height блока .main-mobile (страница).
 */

@media (max-width: 767px) {
    .main-mobile__slider {
        margin-top: 16px;
    }
    /* min-height, а не height: если текст баннера длиннее, слайд вырастет, а не обрежет кнопки */
    .main-mobile .main-mobile-banner {
        position: relative;
        display: flex;
        flex-direction: column;
        height: auto; /* вместо height: 100% из Swiper — слайды выравниваются по самому высокому */
        min-height: var(--main-mobile-height);
        overflow: hidden;
        border-radius: 0 0 48px 0;
        color: var(--color-white);
        box-sizing: border-box;
    }
    .main-mobile-banner__img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* Градиент на фото: чёрный снизу → прозрачный сверху, непрозрачность 50% */
    .main-mobile-banner:before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 100%);
        opacity: .5;
        z-index: 1;
    }
    /* Нажатие на кнопку: дополнительное затемнение фото 20% только при удержании */
    .main-mobile-banner:after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #000;
        opacity: 0;
        z-index: 1;
        pointer-events: none;
    }
    .main-mobile-banner:has(.main-mobile-banner__btn:active):after {
        opacity: .2;
    }
    .main-mobile-banner__content {
        position: relative;
        z-index: 2;
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        box-sizing: border-box;
    }
    .main-mobile-banner__label {
        display: inline-flex;
        align-items: center;
        height: 30px;
        padding: 0 12px;
        border: 1px solid var(--color-white);
        border-radius: 0 0 32px 0;
        box-sizing: border-box;
        font-family: "Montserrat", sans-serif;
        font-weight: 500;
        font-size: 10px;
        line-height: 100%;
        text-transform: uppercase;
        color: var(--color-white);
    }
    .main-mobile-banner__title {
        margin-top: 15px;
        font-family: "Novoposelensky", sans-serif;
        font-weight: 400;
        font-size: 20px;
        line-height: 22px;
        color: var(--color-white);
    }
    /* Рубрика необязательная: без неё заголовок начинается сверху */
    .main-mobile-banner__title:first-child {
        margin-top: 0;
    }
    .main-mobile-banner__desc {
        margin-top: 18px;
        font-family: "Montserrat", sans-serif;
        font-weight: 500;
        font-size: 14px;
        line-height: 125%;
        color: var(--color-white);
    }
    .main-mobile-banner__btns {
        display: flex;
        align-self: stretch;
        gap: 16px;
        margin-top: auto;
    }
    .main-mobile-banner__btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 146px;
        height: 40px;
        padding: 0 16px 0 20px;
        border-radius: 32px 0;
        box-sizing: border-box;
        font-family: "Montserrat", sans-serif;
        font-weight: 500;
        font-size: 12px;
        line-height: 16px;
        color: var(--color-white);
        -webkit-tap-highlight-color: transparent;
    }
    .main-mobile-banner__btn:hover,
    .main-mobile-banner__btn:focus {
        color: var(--color-white);
    }
    .main-mobile-banner__btn:after {
        content: "";
        flex-shrink: 0;
        width: 18px;
        height: 12px;
        background: url("/local/templates/main/assets/img/arrow-min.svg") center center no-repeat;
        background-size: contain;
    }
    .main-mobile-banner__btn--primary {
        background: var(--color-text-darkbrown);
    }
    .main-mobile-banner__btn--secondary {
        border: 2px solid var(--color-white);
    }
    .main-mobile-slider__pagination {
        display: flex;
        gap: 4px;
        margin-top: 16px;
    }
    .main-mobile-slider__bullet {
        flex: 1 1 0;
        height: 2px;
        background: rgba(255, 255, 255, .5);
    }
    .main-mobile-slider__bullet--active {
        background: var(--color-text-darkbrown);
    }
}

/* Узкие экраны (в макете не отрисованы): две кнопки должны помещаться без обрезки */
@media (max-width: 374px) {
    .main-mobile-banner__btns {
        padding-top: 8px;
    }
}
@media (max-width: 371px) {
    .main-mobile-banner__btn {
        flex: 0 1 146px;
        min-width: 0;
        padding: 0 12px 0 14px;
    }
}

/* Планшет 600–767 px: скругления, плашка и кнопки ×1,5; описание и шаг строк заголовка — по макету */
@media (min-width: 600px) and (max-width: 767px) {
    .main-mobile__slider {
        margin-top: 24px;
    }
    .main-mobile .main-mobile-banner {
        border-radius: 0 0 72px 0;
    }
    .main-mobile-banner__content {
        padding: 24px;
    }
    .main-mobile-banner__label {
        height: 38px;
        padding: 0 18px;
        border-radius: 0 0 48px 0;
        font-size: 15px;
    }
    .main-mobile-banner__title {
        margin-top: 20px;
        font-size: 30px;
        line-height: 36px;
    }
    .main-mobile-banner__desc {
        margin-top: 28px;
        font-size: 22px;
    }
    .main-mobile-banner__btns {
        gap: 24px;
    }
    .main-mobile-banner__btn {
        width: 240px;
        height: 60px;
        padding: 0 24px 0 30px;
        border-radius: 48px 0;
        font-size: 18px;
        line-height: 24px;
    }
    .main-mobile-banner__btn:after {
        width: 27px;
        height: 18px;
    }
}
