/* ===== MOBILE MENU ===== */

.mobile-menu-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    z-index: 999999;
    display: none;
    pointer-events: none;
}

.mobile-menu-root.is-open {
    display: block;
    pointer-events: auto;
}

.mobile-menu-root__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.17);
    backdrop-filter: blur(31.55px);
    -webkit-backdrop-filter: blur(31.55px);
    z-index: 1;
}

/* Фон на весь экран — увеличен, без краёв */
.mobile-menu-root__overlay::before {
    content: '';
    position: fixed;
    top: -50px;
    bottom: -50px;
    left: -50px;
    right: -50px;
    background: url('/local/templates/my/images/background/Mask_menu_top.png') no-repeat center center;
    background-size: 120% 120%;
    pointer-events: none;
}

/* Панель на весь экран */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: 100%;
    z-index: 2;
    overflow: hidden;
    color: #222322;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(20px);
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    box-sizing: border-box;
    padding: 20px;
    padding-right: 30px;
    overflow: hidden;
}

.mobile-menu-panel.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.mobile-menu-panel.is-prev {
    transform: translateX(-20px);
}

/* Закрыть — слева, отступ 20px */
.mobile-menu__close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #222322;
    cursor: pointer;
    opacity: 0.75;
    transition: transform 0.15s ease;
    z-index: 4;
}

.mobile-menu__close:hover {
    transform: scale(1.2);
}

/* Назад */
.mobile-menu__back {
    position: absolute;
    top: 90px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #525252;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mobile-menu__back:hover {
    color: #F6881B;
}

.mobile-menu__back svg {
    width: 40px;
    height: 40px;
}

.mobile-menu__back span {
    font-family: "tt-commons-pro", sans-serif;
    font-size: 24px;
    font-style: italic;
    font-weight: 500;
    line-height: 100%;
    color: inherit;
}

/* Заголовок — на уровне первого пункта (170px) */
.mobile-menu__title {
    position: absolute;
    top: 170px;
    left: 20px;
    right: 30px;
    margin: 0;
    color: #4F4F4F;
    font-family: "PT Astra Serif", serif;
    font-size: 40px;
    font-style: italic;
    font-weight: 700;
    line-height: 100%;
}

/* Ссылка на раздел — 50px от заголовка */
.mobile-menu__section-link {
    position: absolute;
    top: 230px;
    left: 20px;
    right: 30px;
    margin: 0;
    color: #CE2028;
    font-family: "tt-commons-pro", sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-transform: uppercase;
}

.mobile-menu__section-link:hover {
    color: #F6881B;
}

/* Контент */
.mobile-menu__content {
    position: absolute;
    left: 20px;
    right: 30px;
    bottom: 40px;
    bottom: calc(40px + env(safe-area-inset-bottom));
    overflow: hidden;
}

/* Root панель — top-меню */
.mobile-menu-panel.is-root .mobile-menu__content {
    top: 170px;
}

/* Каталог и вложенные */
.mobile-menu-panel:not(.is-root) .mobile-menu__content {
    top: 300px;
}

.mobile-menu__scroll-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.mobile-menu__scroll {
    position: absolute;
    top: 0;
    left: 0;
    right: 50px;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.mobile-menu__scroll::-webkit-scrollbar {
    display: none;
}

/* Фейковый скроллбар */
.mobile-menu__fake-scrollbar {
    position: absolute;
    top: 0;
    right: 15px;
    width: 9px;
    bottom: 0;
    border-radius: 14px;
    background: #FFF;
    overflow: hidden;
}

.mobile-menu__fake-scrollbar-thumb {
    width: 9px;
    min-height: 80px;
    max-height: 317px;
    height: 80px;
    border-radius: 14px;
    background: #005C67;
    transform: translateY(0);
    will-change: transform, height;
    cursor: grab;
}

.mobile-menu__fake-scrollbar-thumb:active {
    cursor: grabbing;
}

/* Список */
.mobile-menu__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu__item {
    margin: 0;
    padding: 0;
}

/* Отступ между пунктами 1 уровня — 30px */
.mobile-menu-panel.is-root .mobile-menu__item+.mobile-menu__item {
    margin-top: 30px;
}

/* Отступ между подпунктами — стандартный */
.mobile-menu-panel:not(.is-root) .mobile-menu__item+.mobile-menu__item {
    margin-top: 24px;
}

.mobile-menu__row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Ссылка */
.mobile-menu__link {
    display: inline-block;
    color: #222322;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-menu__link:hover {
    color: #F6881B;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.mobile-menu__link:active {
    color: #F6881B;
    text-decoration: none
}

/* Текст пунктов 1 уровня — курсив как в макете */
.mobile-menu-panel.is-root .mobile-menu__text {
    font-family: "PT Astra Serif", serif;
    font-size: 32px;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 100%;
    color: #4F4F4F;
    text-transform: none;
}

.mobile-menu-panel.is-root .mobile-menu__text:hover {
    color: #F6881B;
}


.mobile-menu-panel.is-root .mobile-menu__link {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.mobile-menu-panel.is-root:active .mobile-menu__link,
.mobile-menu-panel.is-root.is-active .mobile-menu__link {
    text-decoration: none;
}

.mobile-menu-panel.is-root:hover,
.mobile-menu-panel.is-root:active,
.mobile-menu-panel.is-root.is-active {
    color: #F6881B;
}

/* Текст подпунктов — стандартный */
.mobile-menu-panel:not(.is-root) .mobile-menu__text {
    font-family: "tt-commons-pro", sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Стрелка */
.mobile-menu__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #525252;
    cursor: pointer;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu__toggle:hover {
    color: #F6881B;
}

.mobile-menu__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu__arrow svg {
    width: 24px;
    height: 14px;
}

/* Body lock — блокировка скролла */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

html.mobile-menu-open {
    overflow: hidden;
}

/* Блокировка во время драга */
.mobile-menu-scrollbar-dragging {
    user-select: none;
    -webkit-user-select: none;
}

/* ===== 360px — компактный режим ===== */
@media (max-width: 360px) {
    .mobile-menu-panel {
        padding: 16px;
        padding-right: 20px;
    }

    /* Закрыть */
    .mobile-menu__close {
        top: 16px;
        left: 16px;
    }

    /* Назад */
    .mobile-menu__back {
        top: 75px;
        left: 16px;
        gap: 10px;
    }

    .mobile-menu__back svg {
        width: 32px;
        height: 32px;
    }

    .mobile-menu__back span {
        font-size: 22px;
    }

    /* Заголовок */
    .mobile-menu__title {
        top: 140px;
        left: 16px;
        right: 20px;
        font-size: 38px;
    }

    /* Ссылка на раздел */
    .mobile-menu__section-link {
        top: 200px;
        left: 16px;
        right: 20px;
        font-size: 18px;
    }

    /* Контент */
    .mobile-menu__content {
        left: 16px;
        right: 20px;
        bottom: 30px;
    }

    .mobile-menu-panel.is-root .mobile-menu__content {
        top: 140px;
    }

    .mobile-menu-panel:not(.is-root) .mobile-menu__content {
        top: 260px;
    }

    /* Скролл — ближе к краю */
    .mobile-menu__scroll {
        right: 35px;
    }

    /* Скроллбар — ближе к краю */
    .mobile-menu__fake-scrollbar {
        right: 8px;
        width: 7px;
    }

    .mobile-menu__fake-scrollbar-thumb {
        width: 7px;
        min-height: 60px;
    }

    /* Текст 1 уровня */
    .mobile-menu-panel.is-root .mobile-menu__text {
        font-size: 30px;
    }

    /* Текст подпунктов */
    .mobile-menu-panel:not(.is-root) .mobile-menu__text {
        font-size: 12px;
    }

    /* Отступы между пунктами */
    .mobile-menu-panel.is-root .mobile-menu__item+.mobile-menu__item {
        margin-top: 24px;
    }

    .mobile-menu-panel:not(.is-root) .mobile-menu__item+.mobile-menu__item {
        margin-top: 20px;
    }

    /* Стрелка */
    .mobile-menu__toggle {
        width: 28px;
        height: 28px;
    }

    .mobile-menu__arrow svg {
        width: 20px;
        height: 12px;
    }
}