/* МОБИЛЬНАЯ НАВИГАЦИЯ — только для мобильных устройств*/

/* ---------- Переменные ---------- */
:root {
    --mob-nav-bg:       #59484A;
    --mob-nav-height:   88px;
    --mob-nav-height-:   0px;
    --mob-nav-color:    #E2DDD7;
    --mob-nav-active:   #FFFFFF;
    --mob-theme-bg:     #EAE5DE;
    --mob-theme-size:   52px;
    --mob-cat-bg:       #EAE7E1;
    --mob-cat-card-bg:  #F4F1ED;
    --mob-cat-radius:   14px;
    --mob-sub-header-bg: #59484A;
}

/*НИЖНЯЯ НАВИГАЦИОННАЯ ПАНЕЛЬ*/

.bj-mobile-nav {
    display: none; /* скрыта на десктопе */
}

.bj-mobile-nav__icon svg {
    fill: none;
}

.bj-mobile-nav__icon path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
}

@media (max-width: 900px) {
    /* Отступ контента, чтобы не скрывался за навигацией */
    .bojeni-main {
        padding-bottom: calc(var(--mob-nav-height) + env(safe-area-inset-bottom));
    }

    .bj-mobile-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
        background: #20000AB2;
        backdrop-filter: blur(10px);
        padding-top: 11px;
        padding-bottom: 6px;
    }

    /* --- Обычный пункт меню --- */
    .bj-mobile-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px 6px 10px;
        color: var(--mob-nav-color);
        text-decoration: none;
        min-width: 56px;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        opacity: .7;
    }
    .bj-mobile-nav__item .is-active {
        opacity: 1;
    }

    .bj-mobile-nav__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
    }

    .bj-mobile-nav__label {
        font-size: 12px;
        white-space: nowrap;
        font-weight: 500;
        line-height: 21.8px;
        letter-spacing: -0.16px;
        text-align: center;
        vertical-align: middle;
    }

    /* Активный пункт */
    .bj-mobile-nav__item.is-active .bj-mobile-nav__label {
        font-weight: 500;
    }

    .bj-mobile-nav__item.is-active::after {
        content: '';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 88%;
        height: 1.5px;
        background: var(--mob-nav-active);
        border-radius: 1px;
    }

    /* --- Центральная кнопка темы --- */
    .bj-mobile-nav__theme-btn {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--mob-theme-size);
        height: var(--mob-theme-size);
        border-radius: 50%;
        background-color: #F9F8F3;
        border: none;
        cursor: pointer;
        color: #59484A;
        flex-shrink: 0;
        margin-top: -14px; /* поднимаем над панелью */
        box-shadow: 0 2px 12px rgba(0,0,0,0.15);
        -webkit-tap-highlight-color: transparent;
        transition: background-color 0.25s ease, color 0.25s ease;
    }
}

/* ПОПАП МОБИЛЬНОГО КАТАЛОГА */

.bj-mobile-catalog {
    display: none;
}

@media (max-width: 900px) {
    .bj-mobile-catalog.is-open {
        bottom: calc(var(--mob-nav-height) + env(safe-area-inset-bottom));
    }
    .bj-mobile-catalog {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: calc(var(--mob-nav-height-) + env(safe-area-inset-bottom));
        z-index: 250;
        overflow: hidden;
        /* Скрытое состояние */
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        border-radius: 18px 18px 0 0;
    }

    .bj-mobile-catalog.is-open {
        transform: translateY(0);
        pointer-events: auto;
        border-radius: 0;
    }

    /* ---------- Уровень (общие стили) ---------- */
    .bj-mobile-catalog__level {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        background: var(--mob-cat-bg);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        padding-top: 94px;
    }

    /* Уровень 2 — скрыт по умолчанию (сдвинут вправо) */
    .bj-mobile-catalog__level--sub {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
    }

    .bj-mobile-catalog__level--sub.is-visible {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* ---------- Шапка уровня 1 ---------- */
    .bj-mobile-catalog__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 52px 20px 16px;
        flex-shrink: 0;
    }

    .is-open .bj-mobile-catalog__header {
        padding: 16px 10px;
    }

    .bj-mobile-catalog__title {
        color: #20000A;
        font-weight: 400;
        font-size: 32px;
        line-height: 21.28px;
        letter-spacing: -0.16px;
        vertical-align: middle;
        width: 100%;
        text-align: center;
    }

    .bj-mobile-catalog__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: none;
        border: none;
        cursor: pointer;
        color: #20000A;
        border-radius: 50%;
        -webkit-tap-highlight-color: transparent;
    }

    /* ---------- Шапка уровня 2 ---------- */
    .bj-mobile-catalog__sub-header {
        flex-shrink: 0;
        background-color: var(--mob-sub-header-bg);
        padding: 42px 20px 20px;
        color: #E2DDD7;
    }

    .bj-mobile-catalog__back {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        cursor: pointer;
        color: #E2DDD7;
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        font-weight: 400;
        opacity: 0.8;
        padding: 0;
        margin-bottom: 10px;
        -webkit-tap-highlight-color: transparent;
    }

    .bj-mobile-catalog__sub-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 28px;
        font-weight: 600;
        color: #E2DDD7;
        margin: 0;
        line-height: 1.15;
    }

    /* ---------- Прокручиваемая область ---------- */
    .bj-mobile-catalog__scroll {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 10px 20px;
    }

    /* ---------- Сетка категорий ---------- */
    .bj-mobile-catalog__grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* ---------- Карточка категории ---------- */
    .bj-mobile-catalog__card {
        display: flex;
        flex-direction: column;
        align-items: center;
        background: #908F8E;
        border-radius: 14px;
        border: none;
        cursor: pointer;
        padding: 0 0 14px;
        overflow: hidden;
        text-decoration: none;
        color: #20000A;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.15s ease;
        min-width: 186px;
        min-height: 186px;
    }

    .bj-mobile-catalog__card:active {
        transform: scale(0.97);
    }

    .bj-mobile-catalog__card-img {
        width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: var(--mob-cat-radius) var(--mob-cat-radius) 0 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
    }

    .bj-mobile-catalog__card-img img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 12px;
    }

    .bj-mobile-catalog__card-name {
        color: #20000A;
        text-align: center;
        padding: 0 10px;
        font-weight: 400;
        font-size: 16px;
        line-height: 21.28px;
        letter-spacing: -0.16px;
    }

    /* ---------- Состояние загрузки ---------- */
    .bj-mobile-catalog__grid--loading {
        opacity: 0.5;
        pointer-events: none;
    }
}
@media (max-width: 402px) {
    .bj-mobile-catalog__card {
        width: 186px;
        height: 186px;
    }
    .bj-mobile-nav__label {

        font-size: 10px;
    }
}
@media (max-width: 400px) {
    .bj-mobile-catalog__grid {
        grid-template-columns: 1fr;
    }
    .bj-mobile-catalog__card {
        width: 100%;
        height: 100%;
    }
}
