/* AFCMall v1.2.7 — Mobile navigation scroll and viewport fix */

.afc-mobile-menu-panel {
    display: contents;
}

.afc-mobile-menu-backdrop {
    display: none;
}

.mobile-toggle {
    position: relative;
    z-index: 1003;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.mobile-toggle-icon {
    display: inline-grid;
    place-items: center;
    line-height: 1;
    transition: transform .22s ease, opacity .22s ease;
}

.mobile-toggle[aria-expanded="true"] .mobile-toggle-icon {
    transform: rotate(90deg);
}

@media (max-width: 980px) {
    html.afc-mobile-menu-open,
    body.afc-mobile-menu-open {
        overscroll-behavior: none;
    }

    .site-header {
        overflow: visible !important;
    }

    .site-header .nav-wrap {
        position: relative;
        z-index: 1002;
    }

    .site-header .afc-mobile-menu-panel {
        display: none;
        position: fixed;
        z-index: 1002;
        left: 12px;
        right: 12px;
        top: var(--afc-mobile-menu-top, 76px);
        max-height: var(--afc-mobile-menu-max-height, calc(100dvh - 88px));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        flex-direction: column;
        gap: 10px;
        padding: 14px;
        border: 1px solid rgba(201, 162, 39, .28);
        border-radius: 0 0 22px 22px;
        background:
            linear-gradient(145deg, rgba(255, 255, 255, .985), rgba(248, 245, 239, .97));
        box-shadow:
            0 26px 70px rgba(8, 17, 31, .24),
            inset 0 1px 0 rgba(255, 255, 255, .88);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .site-header .afc-mobile-menu-panel.is-open {
        display: flex;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        animation: afcMobileMenuReveal .24s ease both;
    }

    .site-header .afc-mobile-menu-panel .main-nav,
    .site-header .afc-mobile-menu-panel .nav-actions {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .site-header .afc-mobile-menu-panel .main-nav {
        display: flex !important;
        flex: 0 0 auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        overflow: visible;
    }

    .site-header .afc-mobile-menu-panel .main-nav > a,
    .site-header .afc-mobile-menu-panel .main-nav > .nav-dd > a {
        display: flex;
        width: 100%;
        min-height: 44px;
        align-items: center;
        padding: 10px 12px;
        border-radius: 12px;
    }

    .site-header .afc-mobile-menu-panel .nav-dd {
        width: 100%;
    }

    .site-header .afc-mobile-menu-panel .nav-dd > div {
        display: block;
        position: static;
        width: 100%;
        min-width: 0;
        margin: 2px 0 7px;
        padding: 5px 5px 5px 14px;
        border: 0;
        border-left: 2px solid color-mix(in srgb, var(--afc-nav-g1, #c9a227) 50%, transparent);
        border-radius: 0 12px 12px 0;
        background: color-mix(in srgb, #ffffff 78%, transparent);
        box-shadow: none;
    }

    .site-header .afc-mobile-menu-panel .nav-dd > div a {
        width: 100%;
        min-height: 40px;
        padding: 8px 11px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .site-header .afc-mobile-menu-panel .nav-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 9px;
        flex: 0 0 auto;
        padding-top: 12px !important;
        margin-top: 4px !important;
        border-top: 1px solid rgba(8, 17, 31, .09) !important;
    }

    .site-header .afc-mobile-menu-panel .nav-actions .btn {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        padding: 10px 12px;
        text-align: center;
        white-space: normal;
    }

    .site-header.has-hh-background .afc-mobile-menu-panel.is-open {
        background:
            linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(248, 245, 239, .98)) !important;
    }

    .site-header.has-hh-background .afc-mobile-menu-panel .main-nav > a,
    .site-header.has-hh-background .afc-mobile-menu-panel .nav-dd > a {
        color: var(--afc-nav-normal, #1f2937) !important;
        text-shadow: none !important;
    }

    .afc-mobile-menu-backdrop {
        position: fixed;
        z-index: 1001;
        inset: var(--afc-mobile-menu-top, 76px) 0 0;
        display: block;
        background: rgba(4, 12, 24, .42);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .afc-mobile-menu-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .site-header .afc-mobile-menu-panel::-webkit-scrollbar {
        width: 7px;
    }

    .site-header .afc-mobile-menu-panel::-webkit-scrollbar-track {
        background: transparent;
    }

    .site-header .afc-mobile-menu-panel::-webkit-scrollbar-thumb {
        border: 2px solid transparent;
        border-radius: 999px;
        background: rgba(9, 32, 63, .28);
        background-clip: padding-box;
    }
}

@media (max-width: 520px) {
    .site-header .afc-mobile-menu-panel {
        left: 8px;
        right: 8px;
        padding: 12px;
        border-radius: 0 0 18px 18px;
    }

    .site-header .afc-mobile-menu-panel .nav-actions {
        grid-template-columns: 1fr;
    }
}

@keyframes afcMobileMenuReveal {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header .afc-mobile-menu-panel,
    .afc-mobile-menu-backdrop,
    .mobile-toggle-icon {
        animation: none !important;
        transition: none !important;
    }
}
