/* VOIDCRAFT mobile navigation — overlay refinement (v2).
   This stylesheet intentionally replaces the prior mobile-navigation file. */

body > header .icon-links .mobile-account-icon { display: none !important; }

@media (max-width: 767px) {
    body.vc-mobile-nav-open {
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body > header .nav-center {
        box-sizing: border-box;
        width: min(300px, 85vw) !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        padding: calc(5rem + env(safe-area-inset-top)) 1.5rem calc(1rem + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Keep the mobile drawer and every nested menu truly black. */
    body > header .nav-center,
    body > header .nav-center .nav-links,
    body > header .nav-center .nav-links.active,
    body > header .nav-center .dropdown-menu {
        background: #000 !important;
    }

    /* Nested menus must be allowed to layer over following categories. */
    body > header .nav-center .nav-links {
        overflow: visible !important;
    }

    /* A little smaller than the original drawer text, while staying readable. */
    body > header .nav-center .nav-links > li > a,
    body > header .nav-center .nav-links > li > .dropdown-toggle {
        box-sizing: border-box;
        min-height: 50px !important;
        padding: 13px 0 !important;
        color: #f2eeee !important;
        font-size: .98rem !important;
        font-weight: 700 !important;
        line-height: 1.18 !important;
        letter-spacing: .005em !important;
    }

    body > header .nav-center .nav-links > li > .dropdown-toggle {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        border: 0 !important;
        background: transparent !important;
        font-family: inherit !important;
        text-align: left !important;
        cursor: pointer;
    }

    /* Gift Cards, Find a Store, Help and Membership are text-only in the drawer. */
    body > header .nav-center .nav-links > li.vc-mobile-utility > a > i,
    body > header .nav-center .nav-links > li.vc-mobile-help > .dropdown-toggle > i:first-child {
        display: none !important;
        width: 0 !important;
        margin: 0 !important;
    }

    /* Always reset the chevron when a menu is closed. */
    body > header .nav-center .dropdown-parent > .dropdown-toggle > i:last-child {
        display: inline-block !important;
        margin-left: auto !important;
        font-size: .68em;
        transform: rotate(0deg) !important;
        transform-origin: center;
        transition: transform .24s ease;
    }

    body > header .nav-center .dropdown-parent.vc-mobile-open > .dropdown-toggle > i:last-child {
        transform: rotate(180deg) !important;
    }

    /*
       The dropdown is absolute: it floats over the menu below it instead of
       moving Collaborations or the rest of the categories down.
    */
    body > header .nav-center .dropdown-parent {
        position: relative !important;
    }

    body > header .nav-center .dropdown-parent > .dropdown-menu,
    body > header .nav-center .dropdown-parent:hover > .dropdown-menu {
        position: absolute !important;
        top: calc(100% - 1px) !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 40 !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: 0 solid rgba(214, 0, 0, .82) !important;
        background: #000 !important;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .72) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(-10px) !important;
        transition:
            max-height .28s ease,
            opacity .2s ease,
            transform .28s cubic-bezier(.2, .75, .2, 1),
            border-color .2s ease,
            visibility 0s linear .28s !important;
    }

    body > header .nav-center .dropdown-parent.vc-mobile-open {
        z-index: 41 !important;
    }

    body > header .nav-center .dropdown-parent.vc-mobile-open > .dropdown-menu,
    body > header .nav-center .dropdown-parent.vc-mobile-open:hover > .dropdown-menu {
        max-height: min(360px, 45dvh) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        border-width: 1px !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
        transition:
            max-height .30s ease,
            opacity .2s ease,
            transform .30s cubic-bezier(.2, .75, .2, 1),
            border-color .2s ease,
            visibility 0s linear 0s !important;
    }

    /* Kept visible during the transition, then hidden by JavaScript. */
    body > header .nav-center .dropdown-parent.vc-mobile-closing > .dropdown-menu,
    body > header .nav-center .dropdown-parent.vc-mobile-closing:hover > .dropdown-menu {
        max-height: 0 !important;
        border-width: 0 !important;
        opacity: 0 !important;
        visibility: visible !important;
        pointer-events: none !important;
        transform: translateY(-10px) !important;
        transition:
            max-height .26s ease,
            opacity .18s ease,
            transform .26s cubic-bezier(.4, 0, 1, 1),
            border-color .18s ease,
            visibility 0s linear 0s !important;
    }

    body > header .nav-center .dropdown-menu li {
        width: 100% !important;
        border-top: 1px solid rgba(255, 255, 255, .12) !important;
    }

    body > header .nav-center .dropdown-menu li:first-child { border-top: 0 !important; }

    body > header .nav-center .dropdown-menu a {
        display: block !important;
        min-height: 0 !important;
        padding: 11px 16px !important;
        color: #dedede !important;
        font-size: .84rem !important;
        font-weight: 600 !important;
        line-height: 1.28 !important;
    }

    body > header .nav-center .dropdown-menu a:hover,
    body > header .nav-center .dropdown-menu a:focus-visible {
        color: #fff !important;
        background: #141414 !important;
    }

    body > header .nav-center .nav-links .vc-mobile-utility > a {
        color: #ededed !important;
    }

    body > header .nav-center .nav-links .vc-mobile-utility:last-of-type > a {
        color: #ed3030 !important;
    }

    /* Search → account → bag stay against the right edge, with tighter gaps. */
    body > header .icon-links {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
    }

    body > header .icon-links > li,
    body > header .icon-links > li:not(:last-child),
    body > header .icon-links .search-container,
    body > header .icon-links .mobile-account-icon {
        margin: 0 !important;
    }

    /* Restore only this deliberately mobile account icon. */
    body > header .icon-links .mobile-account-icon {
        display: flex !important;
        align-items: center;
        order: 2;
    }

    body > header .icon-links .search-container { order: 1; }
    body > header .icon-links > li:has(.cart-icon-container) { order: 3; }
    body > header .icon-links > li:has(.wishlist-icon-container) { order: 4; }

    body > header .icon-links .mobile-account-icon a {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        min-height: 32px;
        padding: 4px;
        color: #f5f5f5 !important;
        font-size: 1.08rem;
        text-decoration: none;
    }

    body > header .icon-links .mobile-account-icon a:hover,
    body > header .icon-links .mobile-account-icon a:focus-visible {
        color: #d40000 !important;
    }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    body > header .nav-center .dropdown-parent > .dropdown-menu,
    body > header .nav-center .dropdown-parent > .dropdown-toggle > i:last-child {
        transition-duration: .01ms !important;
    }
}
