/* Modern Header Styles - Simplified for Mobile */

:root {
    --brand-primary: #9E7FA4;
    --brand-secondary: #B9A8BF;
    --brand-light: #F5F3F6;
    --text-dark: #2d3748;
    --text-muted: #718096;
}

/* Ensure normal scrolling */
html, body {
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    height: auto;
    width: 100%;
}

/* Simple sticky navbar - always visible */
.ftco_navbar,
.ftco-navbar-light,
.ftco-navbar-light.scrolled,
.ftco-navbar-light.awake,
.ftco-navbar-light.sleep {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 20px rgba(158, 127, 164, 0.1) !important;
    padding: 0.5rem 0 !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    margin-top: 0 !important;
    transform: none !important;
    transition: none !important;
}

.ftco_navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Bootstrap zeroes .navbar-expand-lg > .container padding below the lg
       breakpoint (it expects the navbar itself to supply it), but
       .ftco_navbar's own padding is top/bottom only - restore horizontal
       padding here so the logo/toggler aren't flush against the edge. */
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Logo and Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.navbar-brand img {
    height: 50px;
    width: auto;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Navigation links (desktop default - row layout)
   ========================================================================== */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.navbar-nav.main-nav-links {
    gap: 0.25rem;
}

.navbar-nav .nav-item {
    margin: 0;
}

.navbar-nav .nav-link {
    color: var(--text-dark) !important;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    padding: 0.6rem 1rem !important;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--brand-primary) !important;
}

/* Hover background only for real pointer devices — on touch, :hover has no
   "mouse out" to clear it, so a tapped link stays highlighted (e.g. while
   scrolling after tapping it). */
@media (hover: hover) and (pointer: fine) {
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background: var(--brand-light);
    }
}

.navbar-nav .nav-link.active {
    color: var(--brand-primary) !important;
    font-weight: 700;
}

/* Mobile Menu Toggle */
.navbar-toggler {
    border: 2px solid var(--brand-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: white;
    color: var(--brand-primary);
    font-weight: 600;
}

/* Groups the language selector + login/account actions together so the
   mobile layout can treat them as one section with one divider, instead of
   each partial improvising its own card/shadow. */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.nav-utility-row {
    display: flex;
    align-items: center;
}

/* Account card - groups everything user-related in one place (name,
   language, email, customer code, My Orders/Settings/Admin links). Shared
   by two contexts with the exact same look: first in the mobile menu
   (.mobile-user-panel.d-lg-none, Logout as a separate item below it), and
   as the whole content of the desktop account dropdown
   (.mobile-user-panel.account-dropdown-menu, Logout appended via
   .panel-logout since the dropdown has to be self-contained). */
.mobile-user-panel {
    padding: 1.5rem 1.4rem 1.4rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin-bottom: 0.75rem;
}

.mobile-user-panel .lang-swatch {
    background: white;
}

.account-dropdown-menu {
    min-width: 400px;
    margin-bottom: 0;
    border: none;
    padding: 1.5rem 1.4rem 1.4rem !important;
}

.panel-logout {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(45, 55, 72, 0.1);
}

.panel-logout .btn {
    padding: 0;
    font-size: 1rem;
}

.panel-account-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(45, 55, 72, 0.1);
    gap: 0.75rem;
}

.panel-action-label {
    flex: 1 1 auto;
    min-width: 6.5rem;
    text-align: center;
    padding: 0.95rem 0.75rem;
    border-radius: 10px;
    border: 2px solid var(--brand-primary);
    background: white;
    color: var(--brand-primary) !important;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
    white-space: normal;
    word-break: keep-all;
    text-decoration: none !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.panel-action-label:hover {
    background: var(--brand-primary);
    color: white !important;
}

/* ==========================================================================
   Language selector - a row of flag swatches (same selection language as
   the t-shirt color swatches in the designer: circular, transparent
   border, selected one gets a brand-colored ring).
   ========================================================================== */
.lang-select {
    position: relative;
}

.lang-swatches {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.lang-swatch {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lang-swatch:hover {
    transform: scale(1.08);
}

.lang-swatch.selected {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(158, 127, 164, 0.25);
    transform: scale(1.1);
}

.lang-swatch .fi {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    flex-shrink: 0;
    background-size: cover;
}

/* ==========================================================================
   Auth CTAs - one clear hierarchy: primary (Login), secondary (Register),
   tertiary text link (Resend confirmation). Cart/credits use the separate
   .icon-actions / .icon-btn styles below - they're icon-only, not text pills.
   ========================================================================== */
.nav-item.cta .nav-link {
    border-radius: 25px;
    font-weight: 700;
    padding: 0.5rem 1.25rem !important;
}

.nav-item.cta-primary .nav-link {
    background: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    color: white !important;
}

.nav-item.cta-primary .nav-link:hover {
    background: #8a6d91;
    border-color: #8a6d91;
    color: white !important;
}

.nav-item.cta-colored .nav-link {
    background: white;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary) !important;
}

.nav-item.cta-colored .nav-link:hover {
    background: var(--brand-primary);
    color: white !important;
}

.nav-item.cta-text .nav-link {
    border: none;
    background: none;
    color: var(--text-muted) !important;
    font-weight: 600;
    padding: 0.5rem 0.75rem !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nav-item.cta-text .nav-link:hover {
    color: var(--brand-primary) !important;
}

/* Icon-only buttons (cart, credits). Both live inside one .icon-actions
   <li> so they form a single flex item wherever the surrounding list is
   column-stacked (mobile) - a plain "display" change on the <li> itself
   can't make two separate flex children of a column-direction parent sit
   side by side; the parent's flex-direction governs all its direct
   children uniformly, so they must share one wrapper instead. */
.icon-actions {
    display: flex !important;
    align-items: center;
    gap: 0.875rem;
    width: auto !important;
    align-self: flex-start;
}

.icon-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    padding: 0 !important;
    border: 2px solid var(--brand-primary);
    border-radius: 50%;
    background: white;
    color: var(--brand-primary) !important;
    line-height: 1;
    flex: 0 0 auto;
}

@media (hover: hover) and (pointer: fine) {
    .icon-btn:hover {
        background: var(--brand-primary);
        color: white !important;
    }
}

.icon-btn i {
    font-size: 1.15rem;
    line-height: 1;
}

/* The count badge sits just outside the top-right of the circle, small
   and out of the icon's way - not deep inside the button's own box. */
.icon-badge {
    position: absolute !important;
    top: -0.25rem;
    right: -0.25rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    color: white;
    border: 2px solid white;
}

/* ==========================================================================
   Mobile / tablet (< 992px) - single panel, no nested cards
   ========================================================================== */
@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        padding: 0.5rem 1.25rem 1.25rem;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(158, 127, 164, 0.18);
        margin-top: 0.75rem;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .navbar-nav.main-nav-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
    }

    .navbar-nav.main-nav-links .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(45, 55, 72, 0.08);
    }

    .navbar-nav.main-nav-links .nav-item:last-of-type {
        border-bottom: none;
    }

    .navbar-nav.main-nav-links .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 48px;
        padding: 0.85rem 0.5rem !important;
        border-radius: 0;
    }

    /* No :hover/:focus change at all here — this breakpoint is the collapsed
       mobile menu, and on touch a tapped link's :hover/:focus state has no
       "mouse out" to clear it, so it would otherwise stay changed (e.g. while
       scrolling right after tapping it). Doesn't touch .active (current page). */
    .navbar-nav.main-nav-links .nav-link:not(.active):hover,
    .navbar-nav.main-nav-links .nav-link:not(.active):focus {
        color: var(--text-dark) !important;
    }

    /* Cart / credits icon buttons sit as their own row, side by side -
       excluded from the full-width nav-link treatment above. Needs
       !important here because .navbar-nav.main-nav-links .nav-link (3
       classes) otherwise outranks .icon-btn (1 class) on width/padding. */
    .navbar-nav.main-nav-links .icon-actions {
        border-bottom: none;
        padding: 0.5rem 0;
    }

    .navbar-nav.main-nav-links .icon-btn {
        width: 2.75rem !important;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }

    /* Single section for language + account actions, separated from the
       main links by one divider - not a second card. */
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(45, 55, 72, 0.08);
        gap: 0.75rem;
    }

    .nav-utility-row {
        width: 100%;
    }

    /* Auth actions: full-width, comfortable tap targets, clear hierarchy */
    .nav-actions > ul.navbar-nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.625rem;
    }

    .nav-actions .nav-item.cta {
        width: 100%;
    }

    .nav-actions .nav-item.cta .nav-link {
        display: block;
        width: 100%;
        text-align: center;
        min-height: 46px;
        line-height: 1.6;
    }

    .nav-actions .nav-item.cta-text .nav-link {
        text-align: center;
    }

    .nav-actions .nav-item.cta-colored .nav-link:has(.register-credits-badge) {
        display: flex;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .navbar-brand img {
        height: 40px;
    }
}

@media (max-width: 576px) {
    .brand-name {
        font-size: 1rem;
    }

    .navbar-brand img {
        height: 35px;
    }

    /* Tighten the account/language/cart rows a bit further so nothing
       wraps awkwardly on narrow phones. */
    .mobile-user-panel {
        padding: 0.75rem 0.75rem 0.85rem;
    }

    .panel-action-label {
        font-size: 0.85rem;
        padding: 0.6rem 0.25rem;
    }

    .lang-swatch {
        width: 2rem;
        height: 2rem;
    }

    .icon-actions {
        gap: 0.75rem;
    }
}

/* "+3 credits" next to Register while the free-credits offer is open.
   Label and badge stay on one line so the button keeps its normal height. */
.nav-item.cta-colored .nav-link:has(.register-credits-badge) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.register-credits-badge {
    display: inline-block;
    white-space: nowrap;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--brand-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
}

.nav-item.cta-colored .nav-link:hover .register-credits-badge {
    background: white;
    color: var(--brand-primary);
}

/* ==========================================================================
   Desktop header fit. Between ~1000 and ~1300px the full bar didn't fit, so
   "About Us" wrapped, the flags stacked and the CTAs grew to several lines.
   ========================================================================== */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        white-space: nowrap;
    }

    .lang-swatches {
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    .lang-swatch {
        width: 2rem;
        height: 2rem;
    }

    /* "Resend E-Mail Confirmation" is on the login page too (and stays in the
       mobile menu); the desktop bar has no room for a third CTA. */
    .nav-actions .nav-item.cta-text {
        display: none;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .navbar-nav .nav-link {
        padding: 0.6rem 0.7rem !important;
    }

    .nav-item.cta .nav-link {
        padding: 0.5rem 1rem !important;
    }
}

/* ---------- Help menu (prompt guide, styles, gift ideas, shipping, returns) ---------- */
.nav-help .dropdown-toggle::after {
    margin-left: 0.35em;
    vertical-align: 0.15em;
}

.nav-help-menu {
    min-width: 14rem;
    margin-top: 0.4rem;
    padding: 0.4rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(45, 55, 72, 0.16);
}

/* Fills the gap above the menu, so the mouse stays "inside" the Help item
   on its way down from the toggle and the hover menu doesn't close */
.nav-help-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.75rem;
    height: 0.75rem;
}

.nav-help-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.nav-help-menu .dropdown-item i {
    width: 1.1rem;
    text-align: center;
    color: var(--brand-primary);
}

.nav-help-menu .dropdown-item:hover,
.nav-help-menu .dropdown-item:focus,
.nav-help-menu .dropdown-item:active,
.nav-help-menu .dropdown-item.active {
    background: rgba(158, 127, 164, 0.12);
    color: var(--text-dark);
}

.nav-help-menu .dropdown-divider {
    margin: 0.35rem 0.3rem;
}

/* In the phone menu the links sit inline under "Help" instead of in a floating box */
@media (max-width: 991.98px) {
    .nav-help-menu {
        margin: 0 0 0.4rem;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .nav-help-menu .dropdown-item {
        padding-left: 1.4rem;
    }
}
