/**
 * Secondbay Header Styles
 * Version: 3.5.0 - Mobile Optimization & Dark Mode Fix
 * 
 * FIXES in 3.5.0:
 * - Smaller logo on mobile for better balance
 * - Fixed dark mode hamburger (white bars on dark header)
 * - Cart icon-only on mobile
 * - Improved visual balance across all sizes
 * - Removed corrupted characters
 */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    /* Colors */
    --primary: #5b4cdb;
    --primary-dark: #4a3cb8;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    /* Neutrals */
    --text: #1f2937;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    --bg: #f9fafb;
    --surface: #ffffff;
    
    /* Z-indices */
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 1000;
    
    /* Dark mode colors */
    --surface-dark: #1f2937;
    --bg-dark: #374151;
    --border-dark: #4b5563;
    --text-dark: #f9fafb;
    --text-muted-dark: #9ca3af;
    --primary-light-dark: #a5b4fc;
}

/* ===== ACCESSIBILITY: SKIP TO CONTENT ===== */
.skip-to-content {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 10000;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: transform 0.2s ease, visibility 0.2s;
    contain: layout;
    visibility: hidden;
}

.skip-to-content:focus {
    transform: translate(-50%, 0);
    outline: 2px solid white;
    outline-offset: 2px;
    visibility: visible;
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== UTILITIES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 1024px) {
    .mobile-only {
        display: flex !important;
    }
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--surface);
    transition: box-shadow 0.3s ease, background 0.3s ease;
    min-height: 106px;
    contain: layout;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header.scrolled .header-main {
    height: 56px;
}

/* ===== ANNOUNCEMENT BAR ===== */
.announcement-bar {
    background: linear-gradient(135deg, var(--primary) 0%, #7c6fe3 50%, var(--primary) 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    height: 40px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    contain: layout paint;
}

.header.scrolled .announcement-bar {
    animation-play-state: paused;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.announcement-track {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-slide {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    white-space: nowrap;
    pointer-events: none;
}

.announcement-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.announcement-slide svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.announcement-dots {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 6px;
}

.announcement-dot {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.announcement-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.2s ease, transform 0.2s ease;
}

.announcement-dot:hover::before {
    background: rgba(255, 255, 255, 0.7);
}

.announcement-dot:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.announcement-dot.active::before {
    background: white;
    transform: translate(-50%, -50%) scale(1.2);
}

/* ===== HEADER MAIN ===== */
.header-main {
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 66px;
    box-sizing: border-box;
    transition: height 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 24px;
}

/* ===== LOGO ===== */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover .logo-icon {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(91, 76, 219, 0.3);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.logo-img {
    height: 50px;
    width: 74px;
    min-height: 50px;
    min-width: 74px;
    object-fit: contain;
    transition: transform 0.3s ease;
    aspect-ratio: 74 / 50;
}

@supports not (aspect-ratio: 1) {
    .logo-img {
        height: auto;
    }
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

.logo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 8px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== SEARCH ===== */
.search-form {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 100px 12px 48px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.search-input:hover {
    border-color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(91, 76, 219, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-submit {
    position: absolute;
    right: 56px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.search-submit svg {
    width: 18px;
    height: 18px;
}

.search-input:focus ~ .search-submit,
.search-wrapper:hover .search-submit {
    opacity: 1;
}

.search-submit:hover {
    background: var(--bg);
    color: var(--primary);
}

.search-submit:active {
    transform: scale(0.95);
}

.search-submit:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    opacity: 1;
}

.search-clear {
    position: absolute;
    right: 92px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease;
    pointer-events: none;
}

.search-clear svg {
    width: 14px;
    height: 14px;
}

.search-input:not(:placeholder-shown) ~ .search-clear {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.search-clear:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.search-clear:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.search-kbd {
    position: absolute;
    right: 12px;
    padding: 4px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    font-family: inherit;
    color: var(--text-muted);
    pointer-events: none;
}

.search-kbd-slash {
    display: inline;
}

.search-kbd-ctrl {
    display: none;
}

.search-wrapper:hover .search-kbd-slash,
.search-input:focus ~ .search-kbd .search-kbd-slash {
    display: none;
}

.search-wrapper:hover .search-kbd-ctrl,
.search-input:focus ~ .search-kbd .search-kbd-ctrl {
    display: inline;
}

.search-input:focus + .search-kbd {
    display: none;
}

/* ===== NAVIGATION ===== */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background: var(--bg);
    color: var(--primary);
}

.nav-link:active {
    transform: scale(0.97);
}

.nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* ===== ACTIONS ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.action-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.action-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

.action-btn:active {
    transform: scale(0.92);
}

.action-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* ===== CART BUTTON ===== */
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 76, 219, 0.3);
}

.cart-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(91, 76, 219, 0.2);
}

.cart-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary);
}

.cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.cart-icon.wiggle {
    animation: cartWiggle 0.5s ease;
}

@keyframes cartWiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(5deg); }
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-btn.has-items .cart-badge {
    transform: scale(1);
}

.cart-badge.bounce {
    animation: badgeBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgeBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

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

.cart-pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    bottom: -4px;
    left: -4px;
    border-radius: 14px;
    background: var(--primary);
    opacity: 0;
    pointer-events: none;
}

.cart-pulse.pulse {
    animation: cartPulse 0.6s ease-out;
}

@keyframes cartPulse {
    0% { opacity: 0.4; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.3); }
}

.cart-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cart-label {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 500;
}

.cart-total {
    font-weight: 600;
}

.cart-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(100px) scale(0.9);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: var(--z-toast);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, visibility 0.3s ease;
    max-width: calc(100vw - 48px);
}

.toast.active {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.toast-icon {
    width: 32px;
    height: 32px;
    background: var(--success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    color: var(--success);
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.toast-action {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease;
    margin-left: 8px;
}

.toast-action:hover {
    background: var(--primary-dark);
}

.toast-action:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.toast-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.toast-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.toast-close:focus-visible {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* ===== MENU TOGGLE ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.menu-toggle:hover {
    background: var(--bg);
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.menu-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* ===== MOBILE OVERLAY ===== */
.mobile-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    background: var(--surface);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    -webkit-tap-highlight-color: transparent;
}

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

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.mobile-menu-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.mobile-menu-logo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: none;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.mobile-menu-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
}

/* ===== MOBILE CART BANNER ===== */
.mobile-cart-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-cart-banner:hover {
    background: var(--primary);
    color: white;
}

.mobile-cart-banner:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.mobile-cart-banner:hover .mobile-cart-label,
.mobile-cart-banner:hover .mobile-cart-amount {
    color: white;
}

.mobile-cart-icon-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.mobile-cart-icon-wrap svg {
    width: 20px;
    height: 20px;
}

.mobile-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-cart-badge.bounce {
    animation: badgeBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-cart-badge:empty {
    display: none;
}

.mobile-cart-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mobile-cart-label {
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.mobile-cart-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.2s ease;
}

.mobile-cart-chevron {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.mobile-cart-banner:hover .mobile-cart-chevron {
    color: white;
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    transform: translateX(20px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu.active .mobile-nav-item {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.active .mobile-nav-item:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.active .mobile-nav-item:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-nav-item:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-nav-item:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-nav-item:nth-child(5) { transition-delay: 0.25s; }

.mobile-nav-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.mobile-nav-item:active {
    transform: scale(0.98) translateX(0);
}

.mobile-nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.mobile-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== MOBILE FOOTER ===== */
.mobile-menu-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.mobile-trust-badges {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.mobile-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.mobile-trust-item svg {
    width: 16px;
    height: 16px;
    color: var(--success);
}

.mobile-contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.mobile-contact-link:hover {
    text-decoration: underline;
}

.mobile-contact-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.mobile-contact-link svg {
    width: 16px;
    height: 16px;
}

/* ===== SEARCH DRAWER (MOBILE) ===== */
.search-drawer {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border);
}

.search-drawer[aria-hidden="false"] {
    display: block;
}

.search-drawer-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.search-drawer-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.search-drawer-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    background: var(--bg);
}

.search-drawer-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(91, 76, 219, 0.15);
}

.search-drawer-form button[type="submit"] {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
}

.search-drawer-form button[type="submit"] svg {
    width: 20px;
    height: 20px;
}

.search-drawer-form button[type="submit"]:hover {
    background: var(--primary-dark);
}

.search-drawer-form button[type="submit"]:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.search-drawer-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: none;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-drawer-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.search-drawer-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-desktop {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .search-form {
        display: none;
    }
}

@media (min-width: 1025px) {
    .search-drawer {
        display: none !important;
    }
}

/* Tablet breakpoint */
@media (max-width: 768px) {
    .header {
        min-height: 90px;
    }
    
    .header-main {
        height: 58px;
        padding: 0 16px;
    }
    
    .header-inner {
        gap: 12px;
    }
    
    .announcement-bar {
        height: 32px;
        padding: 0 16px;
    }
    
    .announcement-slide {
        font-size: 12px;
    }
    
    .announcement-dots {
        display: none;
    }
    
    /* Smaller logo on tablet */
    .logo-img {
        height: 40px;
        width: 59px;
        min-height: 40px;
        min-width: 59px;
    }
    
    .logo-tagline {
        display: none;
    }
    
    .logo-name {
        font-size: 16px;
    }
    
    /* Cart icon only on mobile */
    .cart-btn {
        padding: 10px;
        min-width: 44px;
        justify-content: center;
    }
    
    .cart-btn .cart-details {
        display: none;
    }
    
    .cart-total {
        display: none;
    }
    
    .toast {
        bottom: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        left: 16px;
        left: calc(16px + env(safe-area-inset-left, 0px));
        right: 16px;
        right: calc(16px + env(safe-area-inset-right, 0px));
        transform: translateX(0) translateY(100px) scale(0.9);
        max-width: none;
    }
    
    .toast.active {
        transform: translateX(0) translateY(0) scale(1);
    }
    
    .toast-message {
        max-width: 160px;
    }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
    .header {
        min-height: 84px;
    }
    
    .header-main {
        height: 52px;
        padding: 0 12px;
    }
    
    .header-inner {
        gap: 8px;
    }
    
    /* Even smaller logo on small mobile */
    .logo-img {
        height: 32px;
        width: 48px;
        min-height: 32px;
        min-width: 48px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .logo-name {
        font-size: 14px;
    }
    
    .logo {
        gap: 8px;
    }
    
    /* Smaller action buttons */
    .action-btn {
        width: 40px;
        height: 40px;
    }
    
    .action-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .cart-btn {
        padding: 8px;
        min-width: 40px;
    }
    
    .cart-icon {
        width: 18px;
        height: 18px;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .menu-toggle-bar {
        width: 18px;
    }
    
    .search-drawer {
        padding: 12px 16px;
    }
}

/* ===== BODY STATES ===== */
body.menu-open {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body.menu-open,
body.menu-open .header {
    touch-action: none;
}

html.menu-open {
    overflow: hidden;
}

/* ===== PRINT STYLES ===== */
@media print {
    .header {
        position: static !important;
        box-shadow: none !important;
    }
    
    .announcement-bar,
    .search-form,
    .header-actions,
    .nav-desktop,
    .mobile-menu,
    .mobile-overlay,
    .toast,
    .search-drawer,
    .skip-to-content {
        display: none !important;
    }
    
    .header-main {
        padding: 10px 0;
        background: white !important;
    }
    
    .logo-name {
        color: black !important;
    }
    
    .logo-tagline {
        color: #666 !important;
    }
}

/* ===== TOUCH DEVICE FIXES ===== */
@media (hover: none) and (pointer: coarse) {
    .nav-link:hover,
    .action-btn:hover,
    .cart-btn:hover,
    .announcement-dot:hover::before,
    .mobile-nav-item:hover,
    .mobile-cart-banner:hover,
    .toast-action:hover,
    .toast-close:hover,
    .menu-toggle:hover,
    .mobile-menu-close:hover,
    .search-drawer-close:hover,
    .logo:hover .logo-img,
    .logo:hover .logo-icon {
        background: inherit;
        color: inherit;
        transform: none;
        box-shadow: none;
    }
    
    .nav-link:active,
    .action-btn:active,
    .cart-btn:active,
    .mobile-nav-item:active,
    .mobile-cart-banner:active {
        opacity: 0.8;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (forced-colors: active) {
    .skip-to-content,
    .cart-btn,
    .toast-action,
    .search-drawer-form button[type="submit"] {
        border: 2px solid currentColor;
    }
    
    .announcement-bar {
        border-bottom: 1px solid currentColor;
    }
    
    .cart-badge {
        border: 1px solid currentColor;
    }
    
    .mobile-menu {
        border-left: 2px solid currentColor;
    }
    
    .mobile-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .announcement-dot::before {
        border: 1px solid currentColor;
    }
    
    .announcement-dot.active::before {
        background: currentColor;
    }
    
    :focus-visible {
        outline: 2px solid currentColor !important;
        outline-offset: 2px !important;
    }
}

@media (prefers-contrast: more) {
    .logo-tagline {
        color: var(--text);
    }
    
    .search-input::placeholder {
        color: var(--text);
    }
    
    .toast-message {
        color: var(--text);
    }
    
    .announcement-dot::before {
        background: rgba(255, 255, 255, 0.7);
    }
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
    .header {
        background: var(--surface-dark);
    }
    
    .header.scrolled {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .logo-name {
        color: var(--text-dark);
    }
    
    .logo-tagline {
        color: var(--text-muted-dark);
    }
    
    .search-input {
        background: var(--bg-dark);
        border-color: var(--border-dark);
        color: var(--text-dark);
    }
    
    .search-input:hover {
        border-color: var(--text-muted-dark);
    }
    
    .search-input:focus {
        background: var(--surface-dark);
        border-color: var(--primary);
    }
    
    .search-input::placeholder {
        color: var(--text-muted-dark);
    }
    
    .search-kbd {
        background: var(--surface-dark);
        border-color: var(--border-dark);
        color: var(--text-muted-dark);
    }
    
    .search-submit {
        color: var(--text-muted-dark);
    }
    
    .search-submit:hover {
        background: var(--bg-dark);
        color: var(--primary-light-dark);
    }
    
    .search-clear {
        background: var(--bg-dark);
        color: var(--text-muted-dark);
    }
    
    .search-clear:hover {
        background: rgba(239, 68, 68, 0.2);
        color: var(--danger);
    }
    
    .nav-link {
        color: var(--text-dark);
    }
    
    .nav-link:hover {
        background: var(--bg-dark);
    }
    
    .action-btn {
        color: var(--text-dark);
    }
    
    .action-btn:hover {
        background: var(--bg-dark);
    }
    
    /* DARK MODE: Menu toggle with white bars */
    .menu-toggle {
        color: var(--text-dark);
    }
    
    .menu-toggle:hover {
        background: var(--bg-dark);
    }
    
    .menu-toggle-bar {
        background: var(--text-dark);
    }
    
    .toast {
        background: var(--surface-dark);
        border-color: var(--border-dark);
    }
    
    .toast-title {
        color: var(--text-dark);
    }
    
    .toast-message {
        color: var(--text-muted-dark);
    }
    
    .toast-close {
        color: var(--text-muted-dark);
    }
    
    .toast-close:hover {
        background: rgba(239, 68, 68, 0.2);
    }
    
    .mobile-menu {
        background: var(--surface-dark);
    }
    
    .mobile-menu-header {
        border-color: var(--border-dark);
    }
    
    .mobile-menu-close {
        background: var(--bg-dark);
        color: var(--text-dark);
    }
    
    .mobile-cart-banner {
        background: var(--bg-dark);
        border-color: var(--border-dark);
        color: var(--text-dark);
    }
    
    .mobile-cart-label,
    .mobile-cart-amount {
        color: var(--text-muted-dark);
    }
    
    .mobile-nav-item {
        color: var(--text-dark);
        border-color: var(--border-dark);
    }
    
    .mobile-nav-item:hover {
        background: var(--bg-dark);
    }
    
    .mobile-menu-footer {
        border-color: var(--border-dark);
    }
    
    .mobile-trust-item {
        color: var(--text-muted-dark);
    }
    
    .mobile-contact-link {
        color: var(--primary-light-dark);
    }
    
    .search-drawer {
        background: var(--surface-dark);
        border-color: var(--border-dark);
    }
    
    .search-drawer-form input {
        background: var(--bg-dark);
        border-color: var(--border-dark);
        color: var(--text-dark);
    }
    
    .search-drawer-form input:focus {
        background: var(--surface-dark);
    }
    
    .search-drawer-close {
        background: var(--bg-dark);
        color: var(--text-dark);
    }
}