/* ===============================================
   HEADER COMPONENT - RESPONSIVE DESIGN
   =============================================== */

/* Global fix for white lines on mobile */
html {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

body {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    overflow-x: hidden;
}

/* Reset and Base Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid #000000;
    border-top: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom-color: #000000;
    border-top: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* Navigation Container */
.nav-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "left brand right";
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 85px;
    position: relative;
    box-sizing: border-box;
}

/* Brand/Logo Section */
.nav-brand {
    grid-area: brand;
    justify-self: center;
    flex-shrink: 0;
    z-index: 1001;
}

.brand-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #000000;
    transition: all 0.3s ease;
}

.brand-link:hover {
    transform: translateY(-1px);
}

.brand-text {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    line-height: 1;
    margin-bottom: 2px;
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1, 'liga' 1;
}

.brand-tagline {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: rgba(0, 0, 0, 0.75);
    text-transform: uppercase;
    line-height: 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.nav-toggle:focus {
    outline: none; /* Remove focus outline */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); /* Use box-shadow instead */
}

.nav-toggle-icon {
    position: relative;
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.toggle-line {
    width: 100%;
    height: 2px;
    background: #000000;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Toggle Animation */
.nav-toggle.active .toggle-line {
    background: #ffffff; /* White when menu is open */
}

.nav-toggle.active .toggle-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active .toggle-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Cart Icon */
.mobile-cart {
    display: none; /* Hidden by default, shown only on mobile */
    position: relative;
    z-index: 1001;
}

.mobile-cart-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #000000;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.mobile-cart-link:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.mobile-cart-link i {
    font-size: 1.2rem;
    color: #000000;
}

.mobile-cart-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4444;
    color: white;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
    z-index: 10;
}

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

/* Navigation Menu */
.nav-menu {
    grid-area: left / right;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    pointer-events: none;
}

.nav-left,
.nav-right {
    display: flex;
    overflow: visible; /* Ensure cart badge isn't clipped */
    pointer-events: all;
}

.nav-left {
    justify-self: start;
}

.nav-right {
    justify-self: end;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    overflow: visible; /* Ensure cart badge isn't clipped */
}

.nav-item {
    position: relative;
    overflow: visible; /* Ensure cart badge isn't clipped */
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.9);
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1, 'liga' 1;
}

.nav-link:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.nav-link:focus {
    outline: none; /* Remove focus outline */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); /* Use box-shadow instead */
}

/* Active Link Indicator */
.nav-link.active {
    color: #000000;
    background: rgba(0, 0, 0, 0.15);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #000000, transparent);
    border-radius: 1px;
}

/* CTA Button - Removed */
/* 
.nav-cta {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    font-weight: 600;
}

.nav-cta:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}
*/

/* Cart Link */
.nav-cart {
    position: relative;
    min-width: 44px;
    justify-content: center;
    padding: 0.75rem 1.5rem 0.75rem 1rem; /* Extra right padding for badge */
    overflow: visible; /* Ensure badge isn't clipped */
}

.nav-cart i {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.cart-count {
    position: absolute;
    top: 6px;
    right: 2px;
    background: #ff4444;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
    z-index: 10; /* Ensure it appears above other elements */
}

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

/* Mobile Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* ===============================================
   RESPONSIVE BREAKPOINTS
   =============================================== */

/* Large Desktop */
@media (min-width: 1400px) {
    .nav-container {
        padding: 0 3rem;
    }
    
    .nav-list {
        gap: 2.5rem;
    }
    
    .brand-text {
        font-size: 1.4rem;
        letter-spacing: 3px;
    }
    
    .brand-tagline {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }
    
    .nav-link {
        font-size: 0.95rem;
        letter-spacing: 1.5px;
    }
}

/* Desktop */
@media (max-width: 1199px) {
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .nav-list {
        gap: 1.5rem;
    }
    
    .nav-menu {
        margin-left: 2rem;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .nav-container {
        height: 80px;
        padding: 0 1rem;
    }
    
    .nav-menu {
        margin-left: 1rem;
    }
    
    .nav-list {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        letter-spacing: 1px;
    }
    
    .brand-text {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    
    .brand-tagline {
        letter-spacing: 1.2px;
    }
}

/* Mobile and Tablet Portrait */
@media (max-width: 768px) {
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        grid-template-columns: none;
        grid-template-areas: none;
        height: 70px;
        padding: 0 1rem;
    }
    
    .nav-brand {
        grid-area: unset;
        justify-self: unset;
        flex: 1;
        display: flex;
        justify-content: center;
        order: 1;
    }
    
    /* Show mobile cart */
    .mobile-cart {
        display: flex;
        order: 2;
    }
    
    .nav-menu {
        grid-area: unset;
        grid-column: unset;
        margin: 0;
    }
    
    .nav-left,
    .nav-right {
        justify-self: unset;
    }
    
    .brand-text {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    
    .brand-tagline {
        font-size: 0.6rem;
    }
    
    /* Show mobile toggle */
    .nav-toggle {
        display: flex;
        order: 3; /* Make sure it's last */
    }
    
    /* Hide desktop menu */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(180deg, 
            rgba(0, 0, 0, 0.98) 0%, 
            rgba(10, 10, 10, 0.95) 50%, 
            rgba(0, 0, 0, 0.98) 100%);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 0;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-left,
    .nav-right {
        width: 100%;
        justify-content: center;
        margin: 2rem 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        max-width: 300px;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0.25rem 0;
        color: #ffffff !important; /* Force white text on mobile */
    }
    
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.02);
        color: #ffffff !important; /* Force white text on hover */
    }
    
    .nav-text {
        color: #ffffff !important; /* Force white text for nav text spans */
    }
    
    /* Mobile focus styles */
    .nav-link:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.2);
    }
    
    .nav-toggle:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.1);
    }
    
    .nav-cta {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
        border: 2px solid rgba(255, 255, 255, 0.4);
        font-size: 1.2rem;
        font-weight: 700;
        padding: 1.25rem 2rem;
    }
    
    .nav-cta:hover {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%);
        border-color: rgba(255, 255, 255, 0.6);
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    }
    
    .nav-cart {
        position: relative;
        min-width: auto;
        width: 100%;
        padding: 0.75rem 2rem 0.75rem 1rem; /* Extra right padding for badge */
        overflow: visible; /* Ensure badge isn't clipped */
        color: #ffffff !important; /* Force white text for cart icon */
    }
    
    .nav-cart i {
        margin-right: 0.75rem;
        font-size: 1.3rem;
        color: #ffffff !important; /* Force white color for cart icon */
    }
    
    .cart-count {
        position: absolute;
        top: 8px;
        right: 8px;
        background: #ff4444;
        min-width: 22px;
        height: 22px;
        border-radius: 11px;
        font-size: 0.75rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        transition: all 0.3s ease;
        z-index: 10; /* Ensure it appears above other elements */
    }
    
    /* Show overlay when menu is active */
    .nav-overlay {
        display: block;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .nav-container {
        height: 65px;
        padding: 0 0.75rem;
    }
    
    .brand-text {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .brand-tagline {
        font-size: 0.55rem;
    }
    
    .nav-toggle {
        width: 40px;
        height: 40px;
        padding: 6px;
    }
    
    .nav-toggle-icon {
        width: 20px;
        height: 16px;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .nav-cta {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .nav-container {
        padding: 0 0.5rem;
    }
    
    .brand-text {
        font-size: 1.1rem;
    }
    
    .brand-tagline {
        font-size: 0.5rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .nav-cta {
        padding: 0.875rem 1.25rem;
    }
}

/* ===============================================
   ACCESSIBILITY & PERFORMANCE
   =============================================== */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .header,
    .nav-link,
    .nav-toggle,
    .toggle-line,
    .nav-menu,
    .nav-overlay {
        transition: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    .nav-cta:hover {
        transform: none;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .header {
        background: #000000;
        border-bottom: 2px solid #ffffff;
    }
    
    .nav-link {
        color: #ffffff;
        border: 1px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        border-color: #ffffff;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .nav-cta {
        background: #ffffff;
        color: #000000 !important;
        border: 2px solid #ffffff;
    }
    
    .nav-cta:hover {
        background: #000000;
        color: #ffffff !important;
        border-color: #ffffff;
    }
}

/* Print Styles */
@media print {
    .header {
        position: static;
        background: #ffffff;
        color: #000000;
        border-bottom: 2px solid #000000;
    }
    
    .nav-link {
        color: #000000;
    }
    
    .nav-toggle,
    .nav-overlay {
        display: none;
    }
    
    .nav-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        height: auto;
        flex-direction: row;
    }
}
