/* Mobile Menu CSS - Adaptive Design */

/* Base styles - hidden by default */
.mobile-menu-container {
    display: none;
}

/* Mobile devices - 320px to 767px */
@media (max-width: 767px) {
    /* Hide desktop menu */
    .centered-mini-menu {
        display: none !important;
    }
    
    /* Show mobile menu */
    .mobile-menu-container {
        display: block;
        position: fixed;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1001;
        padding: 16px;
    }

    /* Small mobile - 320px to 420px - минимум 343px */
    @media (min-width: 320px) and (max-width: 420px) {
        .mobile-menu-container {
            width: 343px;
            min-width: 343px;
        }
    }
    
    /* Large mobile - 421px to 767px - 398px */
    @media (min-width: 421px) and (max-width: 767px) {
        .mobile-menu-container {
            width: 398px;
            min-width: 398px;
        }
    }

    /* Close menu - 320px to 420px */
    .mobile-menu-closed {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 20px;
        position: relative;
        width: 100%;
        height: 96px;
    }

    .mobile-menu-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px;
        width: 100%;
        min-width: 320px;
        height: 64px;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(6px);
        border-radius: 32px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
        transition: box-shadow 0.3s ease, background 0.3s ease;
    }

    .mobile-menu-header.scrolled {
        box-shadow: 0px 5px 24px rgba(50, 50, 71, 0.08);
        background: rgba(255, 255, 255, 0.95);
    }

    .mobile-menu-logo {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 2px 16px;
        gap: 2px;
        width: 89.26px;
        height: 48px;
        flex: none;
        order: 0;
        flex-grow: 0;
    }

    .mobile-menu-logo img {
        width: 57.26px;
        height: 16px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 2px;
        gap: 2px;
        width: 48px;
        height: 48px;
        border-radius: 32px;
        border: none;
        background: transparent;
        cursor: pointer;
        flex: none;
        order: 1;
        flex-grow: 0;
    }

    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    /* Open menu state - hidden by default */
    .mobile-menu-open {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #FFFFFF;
        z-index: 1001;
        padding: 0;
    }

    .mobile-menu-open.active {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 20px;
        position: relative;
        width: 100%;
        height: 100vh;
    }

    .mobile-menu-header-open {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px;
        width: 100%;
        height: 64px;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(6px);
        border-radius: 32px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
    }

    .mobile-menu-logo-open {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 2px 16px 2px 0px;
        gap: 2px;
        width: 89.26px;
        height: 48px;
        flex: none;
        order: 0;
        flex-grow: 0;
    }

    .mobile-menu-logo-open img {
        width: 57.26px;
        height: 16px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    .mobile-menu-close {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 2px;
        gap: 2px;
        width: 48px;
        height: 48px;
        border-radius: 32px;
        border: none;
        background: transparent;
        cursor: pointer;
        flex: none;
        order: 1;
        flex-grow: 0;
    }

    .mobile-menu-close svg {
        width: 24px;
        height: 24px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    /* All dropdowns */
    .mobile-menu-dropdowns {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        gap: 24px;
        width: 100%;
        height: 480px;
        flex: none;
        order: 1;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Menu sections */
    .mobile-menu-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 0px 16px;
        gap: 8px;
        width: 100%;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Section labels */
    .mobile-menu-section-label {
        width: 100%;
        height: 13px;
        font-family: 'Inter';
        letter-spacing: 0.02em;
        font-style: normal;
        font-weight: 400;
        font-size: 10px;
        line-height: 132%;
        display: flex;
        align-items: center;
        color: #C4C4C4;
        color: color(display-p3 0.769 0.769 0.769);
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Section items container */
    .mobile-menu-section-items {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        gap: 12px;
        width: 100%;
        flex: none;
        order: 1;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Menu items */
    .mobile-menu-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0px;
        gap: 10px;
        width: 100%;
        height: 19px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
        cursor: pointer;
    }

    /* Menu item text */
    .mobile-menu-item-text {
        margin: 0 auto;
        width: 264px;
        height: 19px;
        font-family: 'Inria Serif';
        font-style: normal;
        font-weight: 700;
        font-size: 16px;
        line-height: 19px;
        display: flex;
        align-items: center;
        color: #1A1A1A;
        color: color(display-p3 0.102 0.102 0.102);
        flex: none;
        order: 0;
        flex-grow: 1;
    }

    /* Arrow right */
    .mobile-menu-arrow {
        margin: 0 auto;
        width: 16px;
        height: 16px;
        flex: none;
        order: 1;
        flex-grow: 0;
    }

    .mobile-menu-arrow svg {
        width: 16px;
        height: 16px;
}

/* Medium mobile - 421px to 599px */
@media (min-width: 421px) and (max-width: 599px) {
    .mobile-menu-closed {
        height: 120px;
    }

    .mobile-menu-header {
        padding: 12px;
        height: 80px;
        border-radius: 40px;
        }
        
        .mobile-menu-open.active {
            gap: 24px;
        }
    }

    .mobile-menu-header.scrolled {
        box-shadow: 0px 5px 24px rgba(50, 50, 71, 0.08);
        background: rgba(255, 255, 255, 0.95);
    }
    }

    .mobile-menu-logo {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 3px 20px;
        gap: 3px;
        width: 105px;
        height: 56px;
        flex: none;
        order: 0;
        flex-grow: 0;
    }

    .mobile-menu-logo img {
        width: 65px;
        height: 18px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 3px;
        gap: 3px;
        width: 56px;
        height: 56px;
        border-radius: 36px;
        border: none;
        background: transparent;
        cursor: pointer;
        flex: none;
        order: 1;
        flex-grow: 0;
    }

    .mobile-menu-toggle svg {
        width: 28px;
        height: 28px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    .mobile-menu-open {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #FFFFFF;
        z-index: 1001;
        padding: 0;
    }

    .mobile-menu-open.active {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 24px;
        position: relative;
        width: 100%;
        height: 100vh;
    }

    .mobile-menu-header-open {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        width: 100%;
        height: 80px;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(6px);
        border-radius: 40px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
    }

    .mobile-menu-logo-open {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 3px 20px 3px 0px;
        gap: 3px;
        width: 85px;
        height: 56px;
        flex: none;
        order: 0;
        flex-grow: 0;
    }

    .mobile-menu-logo-open img {
        width: 65px;
        height: 18px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    .mobile-menu-close {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 3px;
        gap: 3px;
        width: 56px;
        height: 56px;
        border-radius: 36px;
        border: none;
        background: transparent;
        cursor: pointer;
        flex: none;
        order: 1;
        flex-grow: 0;
    }

    .mobile-menu-close svg {
        width: 28px;
        height: 28px;
        flex: none;
        order: 0;
        flex-grow: 0;
        z-index: 0;
    }

    /* All dropdowns */
    .mobile-menu-dropdowns {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        gap: 32px;
        width: 100%;
        max-width: 400px;
        flex: 1;
        order: 1;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Menu sections */
    .mobile-menu-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 0px 20px;
        gap: 12px;
        width: 100%;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Section labels */
    .mobile-menu-section-label {
        width: 100%;
        height: 16px;
        font-family: 'Inter';
        letter-spacing: 0.02em;
        font-style: normal;
        font-weight: 400;
        font-size: 12px;
        line-height: 132%;
        display: flex;
        align-items: center;
        color: #C4C4C4;
        color: color(display-p3 0.769 0.769 0.769);
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Section items container */
    .mobile-menu-section-items {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        gap: 14px;
        width: 100%;
        flex: none;
        order: 1;
        align-self: stretch;
        flex-grow: 0;
    }

    /* Menu items */
    .mobile-menu-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0px;
        gap: 12px;
        width: 100%;
        height: 24px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
        cursor: pointer;
    }

    /* Menu item text */
    .mobile-menu-item-text {
        margin: 0 auto;
        width: calc(100% - 32px);
        height: 24px;
        font-family: 'Inria Serif';
        font-style: normal;
        font-weight: 700;
        font-size: 18px;
        line-height: 24px;
        display: flex;
        align-items: center;
        color: #1A1A1A;
        color: color(display-p3 0.102 0.102 0.102);
        flex: none;
        order: 0;
        flex-grow: 1;
    }

    /* Arrow right */
    .mobile-menu-arrow {
        margin: 0 auto;
        width: 20px;
        height: 20px;
        flex: none;
        order: 1;
        flex-grow: 0;
    }

    .mobile-menu-arrow svg {
        width: 20px;
        height: 20px;
    }
}


/* iPad - 768px to 1023px - ширина 552px */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Hide desktop menu */
    .centered-mini-menu {
        display: none !important;
    }
    
    /* Show mobile menu */
    .mobile-menu-container {
        display: block;
        position: fixed;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 552px;
        min-width: 552px;
        z-index: 1001;
        padding: 16px;
    }
    
    .mobile-menu-closed {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 24px;
        position: relative;
        width: 100%;
        height: 120px;
    }
    
    .mobile-menu-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        width: 100%;
        min-width: 320px;
        height: 64px;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(6px);
        border-radius: 32px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
        transition: box-shadow 0.3s ease, background 0.3s ease;
    }
    
    .mobile-menu-open {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #FFFFFF;
        z-index: 1001;
        padding: 0;
    }
}

/* КРИТИЧЕСКИ ВАЖНО: Полноэкранное меню поверх всего */
.mobile-menu-open.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    box-sizing: border-box !important;
    background: #FFFFFF !important;
    max-width: none !important;
    min-width: none !important;
    overflow: hidden !important;
    inset: 0 !important;
    isolation: isolate !important;
    contain: none !important;
}

/* Header в открытом меню */
.mobile-menu-open.active .mobile-menu-header-open {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 24px !important;
    width: 100% !important;
    min-height: 64px !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #E5E5E5 !important;
    border-radius: 0 !important;
    flex: none !important;
    box-sizing: border-box !important;
}

/* Крестик */
.mobile-menu-open.active .mobile-menu-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    transition: background-color 0.2s ease !important;
    flex-shrink: 0 !important;
}

.mobile-menu-open.active .mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.mobile-menu-open.active .mobile-menu-close svg {
    width: 24px !important;
    height: 24px !important;
    stroke: #1A1A1A !important;
    stroke-width: 1.5 !important;
}

/* Содержимое меню */
.mobile-menu-open.active .mobile-menu-dropdowns {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 32px !important;
    width: 100% !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 24px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

.mobile-menu-open.active .mobile-menu-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
}

.mobile-menu-open.active .mobile-menu-section-label {
    display: block !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #999999 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-menu-open.active .mobile-menu-section-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
}

.mobile-menu-open.active .mobile-menu-item {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 0 !important;
    transition: background-color 0.2s ease !important;
    margin: 0 !important;
    border-bottom: 1px solid #F0F0F0 !important;
}

.mobile-menu-open.active .mobile-menu-item:last-child {
    border-bottom: none !important;
}

.mobile-menu-open.active .mobile-menu-item:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

.mobile-menu-open.active .mobile-menu-item-text {
    display: block !important;
    font-family: 'Inria Serif', serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1A1A1A !important;
    text-decoration: none !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-menu-open.active .mobile-menu-arrow {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

.mobile-menu-open.active .mobile-menu-arrow svg {
    width: 16px !important;
    height: 16px !important;
    stroke: #C4C4C4 !important;
}

/* Убираем все ограничения от родительского контейнера */
.mobile-menu-container {
    overflow: visible !important;
}

.mobile-menu-container .mobile-menu-open.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    box-sizing: border-box !important;
    background: #FFFFFF !important;
    max-width: none !important;
    min-width: none !important;
    overflow: hidden !important;
    inset: 0 !important;
    isolation: isolate !important;
    contain: none !important;
}