/* --- HEADER & NAVIGATION STYLES (Isolated) --- */

/* 1. Base Header Layout */
header {
    background-color: #1a1a1a; /* Dark Charcoal */
    color: white;
    padding: 10px 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 70px; /* Fixed height to ensure consistency */
    display: flex;
    align-items: center; /* Vertically center everything */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

/* 2. Logo Styles */
a.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    /* Critical for layout stability */
    flex-shrink: 0; 
    z-index: 1002; /* Ensure logo stays above mobile menu */
}

.logo-icon {
    color: #d4af37; /* Gold */
    font-size: 1.8rem;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.logo-text span {
    color: white;
}

/* 3. Desktop Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: #d4af37;
}

/* 4. Mobile Menu Button (Hamburger) */
.mobile-menu-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* 5. Mobile Cart Button (Header version) */
.mobile-cart-visible {
    display: none; /* Hidden by default */
}

/* --- RESPONSIVE STYLES (Mobile/Tablet) --- */
@media (max-width: 992px) {
    
    /* Turn the Nav UL into a Sidebar */
    nav ul {
        display: none; /* Hidden until toggled */
        flex-direction: column;
        position: fixed;
        top: 70px; /* Height of header */
        left: 0;
        width: 100%;
        background-color: #1a1a1a;
        padding: 1rem 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        text-align: center;
    }

    nav ul.active {
        display: flex; /* Show when active */
    }

    nav ul li {
        margin: 10px 0;
    }

    /* Show the Menu Button */
    .mobile-menu-btn {
        display: block;
        margin-left: 15px; /* Space between button and other elements */
    }

    /* Cart Button Visibility */
    .mobile-cart-visible {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #d4af37;
        color: #1a1a1a;
        border-radius: 30px;
        padding: 5px 15px;
        text-decoration: none;
        font-weight: bold;
        font-size: 0.9rem;
        margin-left: auto; /* Push to the right, next to menu button */
        margin-right: 10px;
    }
}

/* --- STRICT MOBILE LAYOUT (Phones) --- */
@media (max-width: 576px) {
    
    /* Logo Sizing for Small Screens */
    .logo-icon {
        font-size: 1.4rem;
    }
    
    .logo-text {
        font-size: 1.1rem; /* Reduce font to fit on one line */
    }

    /* Hide the text "Checkout" on very small screens to save space */
    .mobile-cart-visible .cart-text {
        display: none;
    }
    
    /* Adjust padding for the cart icon */
    .mobile-cart-visible {
        /* Use Flexbox to center the icon perfectly */
        display: flex !important; /* Force Flex to override any block/inline */
        align-items: center;
        justify-content: center;
        
        /* IMPORTANT: Overriding the inline HTML styles (padding: 5px 15px) */
        padding: 0 !important; 
        border-radius: 50% !important;
        width: 40px !important; 
        height: 40px !important; 
    }
    
    /* Ensure the icon inside is centered */
    .mobile-cart-visible i {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 1.1rem;
        line-height: 1; /* Reset line-height to avoid vertical offset */
        display: block; /* Ensures transforms work if needed */
        transform: translateY(1px); /* Tiny visual nudge if needed, usually 0 or 1px works best */
    }
    
    /* Cart Count Badge Position */
    .cart-count {
        top: -5px;
        right: -5px;
    }
}