/* Vesa Mega Menu — pairs with inc/templates/mega-menu.php
 * Pure CSS hover dropdown. No JS required for desktop.
 */

.vesa-mega-menu {
    position: relative;
    z-index: 50;
    width: 100%;
    display: flex;
    justify-content: center;
}

.vesa-mega-menu .vesa-mm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.vesa-mega-menu .vesa-mm-item {
    position: static; /* mega panel anchored to .vesa-mega-menu, not the item */
}

.vesa-mega-menu .vesa-mm-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 22px 4px;
    color: #111;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    transition: color .15s ease;
}

.vesa-mega-menu .vesa-mm-link:hover,
.vesa-mega-menu .vesa-mm-item.is-open > .vesa-mm-link {
    color: #2563eb;
}

.vesa-mega-menu .vesa-mm-caret {
    display: inline-flex;
    align-items: center;
    transition: transform .2s ease;
    margin-top: 1px;
}

.vesa-mega-menu .vesa-mm-item:hover > .vesa-mm-link .vesa-mm-caret,
.vesa-mega-menu .vesa-mm-item.is-open > .vesa-mm-link .vesa-mm-caret {
    transform: rotate(180deg);
}

/* Mega panel — full width drawer below the bar */
.vesa-mega-menu .vesa-mm-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    z-index: 40;
}

.vesa-mega-menu .vesa-mm-item.has-mega:hover > .vesa-mm-panel,
.vesa-mega-menu .vesa-mm-item.has-mega:focus-within > .vesa-mm-panel,
.vesa-mega-menu .vesa-mm-item.is-open > .vesa-mm-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.vesa-mega-menu .vesa-mm-panel-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 36px 32px 44px;
}

.vesa-mega-menu .vesa-mm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.vesa-mega-menu .vesa-mm-column {
    min-width: 0;
}

.vesa-mega-menu .vesa-mm-heading {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    color: #111;
    line-height: 1.2;
}

.vesa-mega-menu .vesa-mm-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vesa-mega-menu .vesa-mm-links li {
    margin: 0;
}

.vesa-mega-menu .vesa-mm-links a {
    display: inline-block;
    padding: 6px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: color .15s ease;
}

.vesa-mega-menu .vesa-mm-links a:hover {
    color: #2563eb;
}

/* ═════════════════════════════════════════════════════════
   MOBILE (≤990px) — flat accordion overlay
   Pairs with inc/templates/mobile-menu.php
   ═════════════════════════════════════════════════════════ */
@media (max-width: 990px) {

    /* Hide desktop mega menu — only the mobile overlay shows */
    .site-header__main .vesa-mega-menu {
        display: none;
    }

    /* ── Overlay drawer (slides in from left) ── */
    .site-header__mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(420px, 100vw);
        background: #fff;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform .35s cubic-bezier(.16, 1, .3, 1);
        display: flex;
        flex-direction: column;
        box-shadow: 24px 0 60px rgba(0, 0, 0, .14);
        overflow: hidden;
    }

    .site-header__mobile-menu.is-open {
        transform: translateX(0);
    }

    /* Real DOM backdrop */
    .site-header__mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 15, 15, .5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s ease, visibility 0s linear .3s;
        z-index: 9998;
        cursor: pointer;
    }

    .site-header__mobile-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        transition: opacity .3s ease;
    }

    /* ── Header (title + close) ─────────────────────── */
    .mobile-menu__header {
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        height: 60px;
        border-bottom: 1px solid #ececec;
        background: #fff;
    }

    .mobile-menu__title {
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: #1a1a1a;
    }

    .mobile-menu__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 50%;
        color: #1a1a1a;
        cursor: pointer;
        transition: background .18s ease, transform .25s ease;
    }

    .mobile-menu__close:hover {
        background: #f5f5f5;
        transform: rotate(90deg);
    }

    /* ── Scroll body ─────────────────────────────────── */
    .mobile-menu__body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Accordion nav (single source, flat list) ────── */
    .mobile-mm {
        display: block;
        padding: 0;
    }

    /* Top-level standalone link (New Collection / Decorations) */
    .mobile-mm__link {
        display: block;
        padding: 18px 20px;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #1a1a1a;
        text-decoration: none;
        border-bottom: 1px solid #ececec;
        transition: background .15s ease, color .15s ease;
    }

    .mobile-mm__link:hover,
    .mobile-mm__link:focus-visible {
        background: #fafafa;
        color: #214af1;
    }

    /* Group wrapper (Women / Men) */
    .mobile-mm__group {
        border-bottom: 1px solid #ececec;
    }

    /* Group header (the bold "WOMEN" / "MEN" link) */
    .mobile-mm__title {
        display: block;
        padding: 18px 20px 12px;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #1a1a1a;
        text-decoration: none;
        transition: color .15s ease;
    }

    .mobile-mm__title:hover {
        color: #214af1;
    }

    /* Toggle row (CLOTHING / GLOVES AND HATS / ACCESSORY) */
    .mobile-mm__section {
        border-top: 1px solid #f3f3f3;
    }

    .mobile-mm__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 24px;
        background: transparent;
        border: 0;
        font-family: inherit;
        font-size: 13px;
        font-weight: 500;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: #1a1a1a;
        cursor: pointer;
        text-align: left;
        transition: background .15s ease, color .15s ease;
    }

    .mobile-mm__toggle:hover {
        background: #fafafa;
    }

    .mobile-mm__chevron {
        flex-shrink: 0;
        margin-left: 12px;
        color: #999;
        transition: transform .25s ease, color .15s ease;
    }

    .mobile-mm__toggle[aria-expanded="true"] {
        background: #fafafa;
        color: #1a1a1a;
    }

    .mobile-mm__toggle[aria-expanded="true"] .mobile-mm__chevron {
        transform: rotate(90deg);
        color: #214af1;
    }

    /* Sub-list (revealed on toggle) */
    .mobile-mm__sublist {
        list-style: none;
        margin: 0;
        padding: 4px 0 16px 36px;
        background: #fafafa;
        border-top: 1px solid #f0f0f0;
    }

    .mobile-mm__sublist[hidden] {
        display: none;
    }

    .mobile-mm__sublist li {
        margin: 0;
    }

    .mobile-mm__sublist a {
        display: block;
        padding: 9px 20px 9px 0;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.4;
        color: #444;
        text-decoration: none;
        transition: color .15s ease, padding-left .15s ease;
    }

    .mobile-mm__sublist a:hover {
        color: #214af1;
        padding-left: 4px;
    }

    /* ── Contact strip at bottom of drawer ────────────── */
    .mobile-menu__contact {
        list-style: none;
        margin: 0;
        padding: 18px 20px 24px;
        border-top: 1px solid #ececec;
        background: #fafafa;
        display: flex;
        flex-wrap: wrap;
        gap: 12px 20px;
        justify-content: space-around;
    }

    .mobile-menu__contact li {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        font-size: 12px;
    }

    .mobile-menu__contact svg {
        flex-shrink: 0;
        color: #888;
    }

    .mobile-menu__contact a {
        color: #1a1a1a;
        font-weight: 500;
        text-decoration: none;
        letter-spacing: .02em;
        transition: color .15s ease;
    }

    .mobile-menu__contact a:hover {
        color: #214af1;
    }
}
