/* =============================================
   TRISWAR FASHION — HEADER STYLES
   ============================================= */

/* ---- Site Header ---- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.site-header.transparent {
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.96) 0%, rgba(10, 10, 10, 0.88) 75%, rgba(10, 10, 10, 0.75) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.site-header.scrolled,
.site-header.solid {
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom-color: var(--gold-border);
    box-shadow: 0 6px 36px rgba(0, 0, 0, 0.8);
}

.header-inner {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

/* ---- Logo ---- */
.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.header-logo .site-logo {
    height: 64px;
    max-height: 64px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 16px rgba(201, 168, 76, 0.35));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.header-logo .site-logo:hover {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 24px rgba(201, 168, 76, 0.6));
    transform: scale(1.02);
}

.site-logo-link {
    display: flex;
    align-items: center;
}


/* ---- Primary Navigation ---- */
.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.primary-menu>li {
    position: relative;
}

.primary-menu>li>a {
    display: block;
    padding: 0.55rem 1rem;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-transform: uppercase;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.primary-menu>li>a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 1rem;
    right: 1rem;
    height: 1.5px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.primary-menu>li>a:hover,
.primary-menu>li.current-menu-item>a,
.primary-menu>li.current-menu-ancestor>a {
    color: var(--gold-light);
}

.primary-menu>li>a:hover::after,
.primary-menu>li.current-menu-item>a::after,
.primary-menu>li.current-menu-ancestor>a::after {
    transform: scaleX(1);
}

/* ---- Multi-Level Dropdowns ---- */
.primary-menu li {
    position: relative;
}

.primary-menu .sub-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 240px;
    background: rgba(12, 12, 12, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), var(--gold-glow);
    z-index: 100;
    list-style: none;
}

/* Hover bridge to prevent losing hover when cursor moves from parent link to dropdown */
.primary-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
}

.primary-menu>li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Second-level / Nested Submenu (e.g. Category -> Subcategories) */
.primary-menu .sub-menu .sub-menu {
    top: -4px;
    left: calc(100% + 4px);
    transform: translateX(-8px);
}

.primary-menu .sub-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: -12px;
    bottom: 0;
    width: 12px;
    height: 100%;
}

.primary-menu .sub-menu li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.sub-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.4rem;
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-left: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.sub-menu li a:hover,
.sub-menu li.current-menu-item>a {
    color: var(--gold-primary);
    background: var(--gold-subtle);
    border-left-color: var(--gold-primary);
    padding-left: 1.65rem;
}

/* Chevron indicator for nested submenu items */
.primary-menu .sub-menu li.menu-item-has-children>a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-top: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: auto;
    margin-right: 2px;
    flex-shrink: 0;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.primary-menu .sub-menu li.menu-item-has-children:hover>a::after {
    transform: rotate(45deg) translateX(2px);
    border-color: var(--gold-primary);
}

/* Mobile Drawer Nested Menus */
.drawer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-nav li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem var(--space-6);
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--black-border);
}

.drawer-nav .sub-menu {
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--gold-border);
    margin-left: var(--space-6);
}

.drawer-nav .sub-menu li a {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    padding: 0.65rem var(--space-4);
    color: var(--text-secondary);
}

.drawer-nav .sub-menu .sub-menu {
    margin-left: var(--space-4);
    border-left-color: var(--gold-dark);
}

.drawer-nav .sub-menu .sub-menu li a {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ---- Header Actions ---- */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.header-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.header-action-btn svg {
    width: 20px;
    height: 20px;
}

.header-action-btn:hover {
    color: var(--gold-primary);
    border-color: var(--gold-border);
    background: var(--gold-subtle);
}

/* Cart badge */
.cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--gradient-gold);
    color: var(--black-deep);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transform: scale(1);
    transition: transform 0.2s ease;
}

.cart-count.empty {
    display: none;
}

.cart-count.bump {
    animation: cart-bump 0.3s ease;
}

@keyframes cart-bump {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.4)
    }
}

/* ---- Search Modal ---- */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.open {
    opacity: 1;
    visibility: visible;
}

.search-form-wrap {
    width: 100%;
    max-width: 640px;
}

.search-form-wrap input[type="search"] {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-2xl);
    font-family: var(--font-serif);
    transition: var(--transition);
}

.search-form-wrap input[type="search"]:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(201, 168, 76, 0.05);
}

.search-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    color: var(--text-muted);
    cursor: pointer;
}

.search-close:hover {
    color: var(--gold-primary);
}

.search-close svg {
    width: 28px;
    height: 28px;
}

/* ---- Mobile Menu Toggle ---- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text-secondary);
    transition: var(--transition);
}

.hamburger span:nth-child(1) {
    width: 100%;
}

.hamburger span:nth-child(2) {
    width: 75%;
}

.hamburger span:nth-child(3) {
    width: 100%;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--gold-primary);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--gold-primary);
}

/* ---- Mobile Drawer ---- */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(380px, 90vw);
    height: 100vh;
    background: var(--black-rich);
    border-left: 1px solid var(--gold-border);
    z-index: var(--z-overlay);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-drawer.open {
    transform: translateX(0);
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: calc(var(--z-overlay) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--gold-border);
}

.drawer-close {
    color: var(--text-muted);
    cursor: pointer;
}

.drawer-close:hover {
    color: var(--gold-primary);
}

.drawer-close svg {
    width: 24px;
    height: 24px;
}

.drawer-nav {
    padding: var(--space-4) 0;
    flex: 1;
}

.drawer-nav a {
    display: block;
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}

.drawer-nav a:hover {
    color: var(--gold-primary);
    padding-left: calc(var(--space-6) + 8px);
    background: var(--gold-subtle);
}

.drawer-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--gold-border);
}

/* ---- Currency Switcher ---- */
.triswar-currency-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.currency-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    outline: none;
}

.currency-switcher-btn:hover,
.currency-switcher-btn:focus-visible,
.triswar-currency-switcher.open .currency-switcher-btn {
    background: var(--gold-subtle);
    border-color: var(--gold-primary);
    color: var(--gold-light);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.25);
}

.currency-switcher-btn .currency-flag {
    font-size: 1rem;
    line-height: 1;
}

.currency-switcher-btn .currency-code {
    font-weight: 700;
    color: var(--gold-primary);
    letter-spacing: 0.05em;
}

.currency-switcher-btn .currency-symbol {
    color: var(--text-muted);
    font-weight: 400;
}

.currency-switcher-btn .switcher-arrow {
    width: 13px;
    height: 13px;
    stroke: var(--text-muted);
    transition: transform 0.25s ease, stroke 0.2s ease;
    margin-left: 2px;
}

.triswar-currency-switcher.open .switcher-arrow {
    transform: rotate(180deg);
    stroke: var(--gold-primary);
}

/* Dropdown Menu */
.currency-switcher-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 250px;
    max-height: 360px;
    overflow-y: auto;
    background: rgba(14, 14, 14, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(201, 168, 76, 0.12);
    padding: 6px;
    margin: 0;
    list-style: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.triswar-currency-switcher.open .currency-switcher-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Currency Option Item */
.currency-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.currency-option:hover,
.currency-option:focus {
    background: var(--gold-subtle);
    color: var(--gold-light);
    transform: translateX(2px);
}

.currency-option.selected {
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.35);
    color: var(--gold-primary);
    font-weight: 600;
}

.currency-option .currency-flag {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.currency-option .currency-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.currency-option .currency-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.currency-option.selected .currency-name {
    color: var(--gold-light);
}

.currency-option .currency-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.currency-option.selected .currency-meta strong {
    color: var(--gold-primary);
}

.currency-option .currency-check {
    width: 16px;
    height: 16px;
    stroke: var(--gold-primary);
    flex-shrink: 0;
}

/* Mobile Drawer Switcher Wrap */
.drawer-currency-wrap {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer-currency-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.drawer-currency-wrap .triswar-currency-switcher {
    width: 100%;
}

.drawer-currency-wrap .currency-switcher-btn {
    width: 100%;
    justify-content: space-between;
    height: 44px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.05);
}

.drawer-currency-wrap .currency-switcher-dropdown {
    width: 100%;
    left: 0;
    right: 0;
    position: static;
    margin-top: 8px;
    display: none;
    box-shadow: none;
    max-height: 280px;
}

.drawer-currency-wrap .triswar-currency-switcher.open .currency-switcher-dropdown {
    display: block;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    :root {
        --header-height: var(--header-height-mobile);
    }
}

@media (max-width: 600px) {
    .header-currency .currency-symbol {
        display: none;
    }

    .header-currency .currency-switcher-btn {
        padding: 0 8px;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .header-logo .site-logo {
        height: 40px;
    }
}