/* =========================================================
   SPAVERSE FRONTEND HEADER
   Desktop + Tablet + Mobile
========================================================= */


/* =========================================================
   HEADER BASE
========================================================= */

.site-header {
    position: sticky;
    top: 0;

    z-index: 5000;

    width: 100%;
    max-width: 100%;

    background:
        rgba(253, 251, 247, 0.96);

    border-bottom:
        1px solid rgba(46, 94, 78, 0.08);

    transition:
        background-color 220ms ease,
        box-shadow 220ms ease,
        border-color 220ms ease;
}

.site-header.is-scrolled {
    background:
        rgba(255, 255, 255, 0.98);

    border-color:
        rgba(46, 94, 78, 0.12);

    box-shadow:
        0 10px 32px rgba(30, 67, 56, 0.09);
}


/* =========================================================
   HEADER CONTAINER
========================================================= */

.header-container {
    width:
        min(calc(100% - 40px), 1200px);

    min-height:
        var(--header-height);

    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 28px;
}


/* =========================================================
   LOGO
========================================================= */

.header-logo {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;

    gap: 11px;
}

.logo-icon {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(201, 166, 107, 0.58);

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 30% 25%,
            #f6e9c8,
            transparent 45%
        ),
        linear-gradient(
            145deg,
            #d9bd82,
            #b88d48
        );

    color: var(--dark-green);

    font-family:
        "Cormorant Garamond",
        serif;

    font-size: 17px;
    font-weight: 800;

    letter-spacing: 0.05em;

    box-shadow:
        0 8px 22px
        rgba(201, 166, 107, 0.28);
}

.logo-text {
    display: grid;

    line-height: 1.08;
}

.logo-text strong {
    color: var(--dark-green);

    font-family:
        "Cormorant Garamond",
        serif;

    font-size: 25px;
    font-weight: 700;

    letter-spacing: -0.02em;
}

.logo-text small {
    margin-top: 3px;

    color: var(--soft-brown);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.18em;

    text-transform: uppercase;
}


/* =========================================================
   DESKTOP NAVIGATION
========================================================= */

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;
}

.header-nav > a {
    position: relative;

    padding: 10px 13px;

    border-radius: 999px;

    color: #566861;

    font-size: 13px;
    font-weight: 750;

    transition:
        color 200ms ease,
        background-color 200ms ease;
}

.header-nav > a:hover,
.header-nav > a.active {
    color: var(--dark-green);

    background:
        rgba(234, 215, 177, 0.28);
}

.header-nav > a.active::after {
    content: "";

    position: absolute;

    right: 14px;
    bottom: 5px;
    left: 14px;

    height: 2px;

    border-radius: 999px;

    background: var(--gold);
}

.mobile-login-link {
    display: none;
}


/* =========================================================
   HEADER ACTIONS
========================================================= */

.header-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 10px;
}


/* =========================================================
   WALLET
========================================================= */

.wallet-box {
    min-height: 46px;

    display: inline-flex;
    align-items: center;

    gap: 9px;

    padding:
        7px 12px 7px 8px;

    border:
        1px solid rgba(46, 94, 78, 0.1);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.8);

    box-shadow:
        0 8px 20px
        rgba(30, 67, 56, 0.06);

    transition:
        transform 200ms ease,
        border-color 200ms ease,
        box-shadow 200ms ease;
}

.wallet-box:hover {
    transform:
        translateY(-1px);

    border-color:
        var(--gold-border);

    box-shadow:
        0 11px 26px
        rgba(30, 67, 56, 0.1);
}

.wallet-icon {
    width: 31px;
    height: 31px;

    flex: 0 0 31px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        rgba(234, 215, 177, 0.52);

    color: var(--dark-green);

    font-size: 15px;
    font-weight: 900;
}

.wallet-content {
    display: grid;

    line-height: 1.08;
}

.wallet-content small {
    color: var(--soft-brown);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

.wallet-content strong {
    margin-top: 3px;

    color: var(--dark-green);

    font-size: 13px;
    font-weight: 850;
}


/* =========================================================
   LOGIN
========================================================= */

.login-btn {
    min-height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;

    border:
        1px solid transparent;

    border-radius: 999px;

    background:
        var(--deep-green);

    color: var(--white);

    font-size: 13px;
    font-weight: 800;

    box-shadow:
        0 10px 24px
        rgba(46, 94, 78, 0.2);

    transition:
        transform 200ms ease,
        background-color 200ms ease,
        box-shadow 200ms ease;
}

.login-btn:hover {
    transform:
        translateY(-2px);

    background:
        var(--dark-green);

    box-shadow:
        0 14px 30px
        rgba(30, 67, 56, 0.26);
}


/* =========================================================
   USER MENU
========================================================= */

.user-box {
    position: relative;
}

.user-avatar {
    width: 44px;
    height: 44px;

    border:
        1px solid
        rgba(201, 166, 107, 0.46);

    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            var(--deep-green),
            var(--dark-green)
        );

    color: var(--white);

    font-size: 13px;
    font-weight: 850;

    box-shadow:
        0 8px 22px
        rgba(30, 67, 56, 0.2);
}

.user-dropdown {
    position: absolute;

    top:
        calc(100% + 14px);

    right: 0;

    z-index: 40;

    width: 230px;

    padding: 9px;

    border:
        1px solid
        rgba(46, 94, 78, 0.12);

    border-radius: 17px;

    background:
        rgba(255, 255, 255, 0.98);

    box-shadow:
        0 22px 55px
        rgba(30, 67, 56, 0.18);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(-8px)
        scale(0.98);

    transform-origin:
        top right;

    pointer-events: none;

    transition:
        opacity 180ms ease,
        visibility 180ms ease,
        transform 180ms ease;
}

.user-box.is-open
.user-dropdown {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}

.user-dropdown-head {
    display: grid;

    padding:
        11px 12px 13px;

    margin-bottom: 6px;

    border-bottom:
        1px solid
        rgba(46, 94, 78, 0.09);
}

.user-dropdown-head strong {
    color: var(--dark-green);

    font-size: 14px;
}

.user-dropdown-head small {
    margin-top: 3px;

    color: var(--soft-brown);

    font-size: 11px;
}

.user-dropdown a,
.dropdown-logout-btn {
    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;

    padding:
        9px 12px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    color: #41584f;

    font-size: 13px;
    font-weight: 700;

    text-align: left;

    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.user-dropdown a:hover {
    background:
        rgba(234, 215, 177, 0.28);

    color: var(--dark-green);
}

.dropdown-logout-btn {
    color: #b42318;
}

.dropdown-logout-btn:hover {
    background: #fff1f0;
}


/* =========================================================
   TOGGLE
========================================================= */

.menu-toggle {
    position: relative;

    z-index: 5200;

    width: 44px;
    height: 44px;

    display: none;
    place-items: center;

    gap: 5px;

    padding: 10px;

    border:
        1px solid
        rgba(46, 94, 78, 0.1);

    border-radius: 13px;

    background: var(--white);

    box-shadow:
        0 8px 20px
        rgba(30, 67, 56, 0.07);
}

.menu-toggle span {
    width: 20px;
    height: 2px;

    display: block;

    border-radius: 99px;

    background:
        var(--dark-green);

    transition:
        transform 220ms ease,
        opacity 220ms ease;
}

.site-header.menu-open
.menu-toggle span:nth-child(1) {
    transform:
        translateY(7px)
        rotate(45deg);
}

.site-header.menu-open
.menu-toggle span:nth-child(2) {
    opacity: 0;
}

.site-header.menu-open
.menu-toggle span:nth-child(3) {
    transform:
        translateY(-7px)
        rotate(-45deg);
}


/* =========================================================
   OVERLAY BASE
========================================================= */

.header-overlay {
    position: fixed;

    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;

    z-index: -1;

    width: 100%;

    height:
        calc(
            100dvh - var(--header-height)
        );

    margin: 0;
    padding: 0;

    border: 0;

    background:
        rgba(12, 31, 25, 0.42);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 220ms ease,
        visibility 220ms ease;
}


/* =========================================================
   TABLET / MOBILE
========================================================= */

@media (max-width: 991px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
    }

    .site-header {
        position: sticky;
        top: 0;

        overflow: visible;
    }

    .header-container {
        width:
            min(
                calc(100% - 28px),
                1200px
            );

        max-width: 100%;

        margin-inline: auto;
    }


    /* =====================================================
       MOBILE DRAWER
    ===================================================== */

    .header-nav {
        position: fixed;

        top: var(--header-height);
        right: 0;
        bottom: 0;
        left: auto;

        z-index: 5100;

        width:
            min(360px, 88vw);

        max-width: 88vw;

        height:
            calc(
                100dvh -
                var(--header-height)
            );

        max-height:
            calc(
                100dvh -
                var(--header-height)
            );

        margin: 0;

        display: flex;
        flex-direction: column;

        align-items: stretch;
        justify-content: flex-start;

        gap: 5px;

        padding: 20px;

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior: contain;

        -webkit-overflow-scrolling: touch;

        border-left:
            1px solid
            rgba(46, 94, 78, 0.1);

        background: var(--white);

        box-shadow: none;

        transform:
            translate3d(100%, 0, 0);

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        will-change: transform;

        transition:
            transform 280ms
            cubic-bezier(
                0.22,
                1,
                0.36,
                1
            ),
            opacity 180ms ease,
            visibility 280ms ease;
    }

    .site-header.menu-open
    .header-nav {
        transform:
            translate3d(0, 0, 0);

        opacity: 1;
        visibility: visible;

        pointer-events: auto;

        box-shadow:
            -20px 0 50px
            rgba(30, 67, 56, 0.15);
    }


    /* =====================================================
       MOBILE NAV LINKS
    ===================================================== */

    .header-nav > a {
        width: 100%;

        min-height: 48px;

        flex: 0 0 auto;

        display: flex;
        align-items: center;

        padding:
            12px 15px;

        border-radius: 12px;

        font-size: 14px;
    }

    .header-nav > a.active::after {
        top: 12px;
        right: auto;
        bottom: 12px;
        left: 0;

        width: 3px;
        height: auto;
    }


    /* =====================================================
       MOBILE LOGIN
    ===================================================== */

    .mobile-login-link {
        display: flex;

        justify-content: center;

        margin-top: 8px;

        background:
            var(--deep-green) !important;

        color:
            var(--white) !important;
    }


    /* =====================================================
       TOGGLE
    ===================================================== */

    .menu-toggle {
        display: grid;
    }


    /* =====================================================
       OVERLAY
    ===================================================== */

    .header-overlay {
        position: fixed;

        top: var(--header-height);
        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;

        height:
            calc(
                100dvh -
                var(--header-height)
            );

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        z-index: -1;
    }

    .site-header.menu-open
    .header-overlay {
        z-index: 5050;

        opacity: 1;
        visibility: visible;

        pointer-events: auto;
    }
}


/* =========================================================
   MOBILE <= 767px
========================================================= */

@media (max-width: 767px) {

    .logo-text small {
        display: none;
    }

    .wallet-content small {
        display: none;
    }

    .wallet-box {
        padding-right: 10px;
    }

    .login-btn {
        display: none;
    }
}


/* =========================================================
   SMALL MOBILE <= 575px
========================================================= */

@media (max-width: 575px) {

    .header-container {
        width:
            calc(100% - 20px);

        max-width:
            calc(100% - 20px);

        gap: 8px;
    }

    .header-logo {
        min-width: 0;
    }

    .logo-icon {
        width: 39px;
        height: 39px;

        flex: 0 0 39px;

        font-size: 15px;
    }

    .logo-text {
        min-width: 0;
    }

    .logo-text strong {
        font-size: 21px;
    }

    .header-actions {
        min-width: 0;

        gap: 7px;
    }

    .wallet-box {
        min-height: 42px;

        padding:
            5px 8px
            5px 6px;
    }

    .wallet-icon {
        width: 29px;
        height: 29px;

        flex-basis: 29px;
    }

    .wallet-content strong {
        font-size: 12px;
    }

    .user-avatar,
    .menu-toggle {
        width: 42px;
        height: 42px;

        flex:
            0 0 42px;
    }

    .header-nav {
        width:
            min(330px, 88vw);

        max-width: 88vw;

        padding:
            18px
            max(
                16px,
                env(safe-area-inset-right)
            )
            24px
            18px;
    }
}


/* =========================================================
   VERY SMALL MOBILE <= 380px
========================================================= */

@media (max-width: 380px) {

    .header-container {
        width:
            calc(100% - 16px);

        max-width:
            calc(100% - 16px);

        gap: 6px;
    }

    .logo-text strong {
        font-size: 19px;
    }

    .wallet-box {
        padding-right: 7px;
    }

    .wallet-content strong {
        font-size: 11px;
    }

    .header-nav {
        width: 88vw;
        max-width: 88vw;

        padding: 16px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .header-nav,
    .header-overlay,
    .menu-toggle span,
    .user-dropdown {
        transition-duration:
            0.01ms !important;
    }
}