/* =========================================
   1. RESET & VARIABLES (The Luxury Palette)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #ffffff;
    --text-main: #111111;       /* Jet Black */
    --text-muted: #666666;
    --accent: #d63384;          /* Signature Pink */
    --accent-dark: #a82060;
    --border-light: #e5e5e5;
    --glass: rgba(255, 255, 255, 0.9);
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 50px rgba(0,0,0,0.08);
    --transition: cubic-bezier(0.22, 1, 0.36, 1); /* Elegant easing */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

a { text-decoration: none; color: inherit; transition: 0.4s var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   2. NAVBAR & MOBILE MENU (FIXED)
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(255, 255, 255, 0.95); /* More opaque */
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 9999; /* Highest priority */
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: rgb(28, 27, 27);
}

/* Default Desktop Links */
.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
    position: relative;
}

/* Hamburger Icon (Hidden on Desktop) */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 10001; /* Above the slide-out menu */
}

.hamburger span {
    width: 25px;
    height: 2px;
    background-color: #111;
    transition: 0.3s;
}

.cart-icon {
    font-size: 1.4rem;
    cursor: pointer;
    position: relative;
    z-index: 10001;
}

/* =========================================
   3. CINEMATIC HERO SECTION
   ========================================= */
.hero {
    height: 90vh;
    background: url('https://colorhunt.ai/assets/img/hero-section-bg.webp') center/cover no-repeat fixed;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: white;
    position: relative;
}

/* Dark overlay for readability */
.hero::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
}

.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 0 20px; }

.hero h1 {
    font-size: 4.5rem; line-height: 1.1; margin-bottom: 20px;
    color: white; font-weight: 400;
}

.hero p {
    font-size: 1.1rem; margin-bottom: 40px; font-weight: 300;
    letter-spacing: 1px; color: rgba(255,255,255,0.9);
}

/* Global Button Styles */
.btn {
    display: inline-block; padding: 15px 40px;
    background: var(--text-main); color: white;
    font-weight: 600; text-transform: uppercase; letter-spacing: 2px;
    font-size: 0.8rem; border: 1px solid var(--text-main);
    cursor: pointer; transition: 0.4s var(--transition);
}

.btn:hover {
    background: transparent; color: var(--text-main);
}

/* Hero Button specific overrides */
.hero .btn { background: white; color: black; border-color: white; }
.hero .btn:hover { background: transparent; color: white; }

/* =========================================
   4. LAYOUT UTILITIES
   ========================================= */
.container { padding: 6rem 5%; max-width: 1400px; margin: 0 auto; }

.section-title {
    font-size: 2.8rem; text-align: center; margin-bottom: 4rem;
    position: relative; padding-bottom: 20px;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 60px; height: 1px; background: var(--text-main);
}

/* =========================================
   5. PRODUCT CARDS (3-Column Fix)
   ========================================= */
.product-grid {
    display: grid;
    /* Min-width 200px ensures 3 items fit on laptops */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 40px 25px; /* Tighter gap for better fit */
}

.product-card {
    background: transparent; border: none;
    transition: 0.4s var(--transition);
}

.product-card:hover { transform: translateY(-10px); }

.product-card a { display: block; overflow: hidden; position: relative; }

.product-card img {
    width: 100%; height: 320px; object-fit: cover;
    transition: transform 0.6s var(--transition);
}

.product-card:hover img { transform: scale(1.08); }

.product-info { padding: 15px 0; text-align: center; }

.product-info h4 {
    font-size: 1rem; margin-bottom: 5px; font-family: 'Poppins', sans-serif;
    font-weight: 400; color: var(--text-main);
}

.product-info p {
    color: var(--text-muted); font-size: 0.95rem; margin-bottom: 15px;
}

/* Button appears on hover */
.product-info .btn {
    width: 100%; padding: 12px;
    opacity: 0; transform: translateY(10px);
}
.product-card:hover .product-info .btn { opacity: 1; transform: translateY(0); }

/* =========================================
   6. SHOP PAGE
   ========================================= */
.shop-layout { display: flex; gap: 40px; }
.shop-sidebar { width: 220px; flex-shrink: 0; }
.shop-products { flex-grow: 1; }

.shop-sidebar h3 {
    font-size: 1.5rem; margin-bottom: 30px;
    border-bottom: 1px solid var(--border-light); padding-bottom: 15px;
}

.category-list li {
    padding: 10px 0; color: var(--text-muted); cursor: pointer;
    transition: 0.3s; font-size: 0.95rem; display: flex; justify-content: space-between;
}

.category-list li:hover { color: var(--text-main); padding-left: 10px; }

/* =========================================
   7. CONTACT PAGE (Styled to match Luxury Theme)
   ========================================= */
.contact-wrapper { display: flex; gap: 80px; align-items: flex-start; }
.contact-info { flex: 1; }
.contact-form { flex: 1.5; }

.contact-info h3 { font-size: 1.2rem; margin-bottom: 10px; margin-top: 20px; }
.contact-info p { color: var(--text-muted); font-size: 0.95rem; }

/* Sleek Input Styles for Contact */
.contact-form input, .contact-form textarea {
    width: 100%; padding: 15px 0;
    border: none; border-bottom: 1px solid var(--border-light);
    background: transparent; outline: none;
    font-family: 'Poppins', sans-serif; font-size: 1rem;
    transition: 0.3s; margin-bottom: 20px;
}

.contact-form input:focus, .contact-form textarea:focus {
    border-bottom-color: var(--text-main);
}

/* =========================================
   8. CHECKOUT PAGE (Styled to match Luxury Theme)
   ========================================= */
.checkout-wrapper { display: flex; gap: 80px; padding-top: 2rem; }
.checkout-form { flex: 1.5; }

/* Boxed Summary */
.checkout-summary {
    flex: 1; background: #fafafa; padding: 40px;
    height: fit-content; border: 1px solid var(--border-light);
}

.checkout-form h3, .checkout-summary h3 { margin-bottom: 25px; font-size: 1.5rem; }

/* Sleek Input Styles for Checkout (Consistent with Contact) */
.form-group { margin-bottom: 25px; }
.form-group label {
    font-size: 0.8rem; text-transform: uppercase;
    color: var(--text-muted); letter-spacing: 1px; display: block; margin-bottom: 5px;
}
.form-group input {
    width: 100%; padding: 12px 0;
    border: none; border-bottom: 1px solid var(--border-light);
    background: transparent; outline: none;
    font-family: 'Poppins', sans-serif; font-size: 1rem;
    transition: 0.3s;
}
.form-group input:focus { border-bottom-color: var(--text-main); }
.form-row { display: flex; gap: 30px; }
.form-row .form-group { flex: 1; }

.checkout-item {
    display: flex; justify-content: space-between;
    padding: 15px 0; border-bottom: 1px dashed var(--border-light);
    font-size: 0.95rem;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.summary-row.total {
    font-size: 1.4rem; font-family: 'Playfair Display', serif;
    margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-light);
}

/* =========================================
   9. PRODUCT DETAILS PAGE
   ========================================= */
.product-detail-wrapper { display: flex; gap: 80px; }
.product-detail-image { flex: 1; }
.product-detail-info { flex: 1; }

.product-detail-image img { width: 100%; object-fit: cover; }

.product-detail-info h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 20px; }
.detail-price { font-size: 1.8rem; font-weight: 300; margin-bottom: 30px; }
.detail-description { color: var(--text-muted); margin-bottom: 40px; font-weight: 300; }

.size-selector { display: flex; gap: 15px; margin: 15px 0 30px; }
.size-btn {
    width: 45px; height: 45px; border: 1px solid var(--border-light);
    background: white; cursor: pointer; transition: 0.3s;
}
.size-btn:hover, .size-btn.active { background: var(--text-main); color: white; border-color: var(--text-main); }

.add-cart-large {
    width: 100%; padding: 18px; margin-top: 20px;
    background: var(--text-main); color: white; letter-spacing: 2px;
}

/* =========================================
   10. CART SIDEBAR & MODAL
   ========================================= */
.sidebar {
    position: fixed; top: 0; right: -450px; width: 450px; height: 100%;
    background: white; z-index: 2000; padding: 40px;
    box-shadow: -10px 0 40px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; transition: 0.5s var(--transition);
}
.sidebar.active { right: 0; }
.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-light); padding-bottom: 20px; margin-bottom: 20px;
}
.cart-items { flex: 1; overflow-y: auto; }
.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 0; border-bottom: 1px solid var(--border-light);
}
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; z-index: 1500; backdrop-filter: blur(2px);
}
.overlay.active { display: block; }

/* Order Modal */
.order-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95); z-index: 3000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.4s;
}
.order-modal.active { opacity: 1; visibility: visible; }
.modal-content { text-align: center; }
.spinner {
    border: 3px solid #eee; border-top: 3px solid var(--text-main);
    width: 50px; height: 50px; border-radius: 50%; margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* =========================================
   11. FOOTER & RESPONSIVE
   ========================================= */
footer {
    background: #111; color: white; padding: 60px 20px;
    text-align: center; margin-top: 100px;
}
footer p { font-weight: 300; letter-spacing: 1px; opacity: 0.7; }

/* Stack layouts for mobile (General Page Layouts) */
@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
    
    /* Removed .nav-links { display: none; } because it broke the hamburger menu */

    .shop-layout, .contact-wrapper, .checkout-wrapper, .product-detail-wrapper {
        flex-direction: column;
    }
    .sidebar { width: 100%; }
    .shop-sidebar { width: 100%; overflow-x: auto; margin-bottom: 20px;}
    .category-list { display: flex; gap: 20px; padding-bottom: 10px; }
    .category-list li { white-space: nowrap; border: 1px solid var(--border-light); padding: 5px 15px; border-radius: 20px; }
}

/* =========================================
   12. MOBILE NAVIGATION (FIXED)
   ========================================= */

/* Default: Hide Close Button on Desktop */
/* IMPORTANT: This must be outside the media query */
.mobile-close-btn { 
    display: none; 
}

@media (max-width: 768px) {
    /* 1. Show the Hamburger with HIGH z-index so it's clickable */
    .hamburger {
        display: flex;
        z-index: 2001; 
    }

    /* 2. Slide-out Menu */
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%; /* Hidden off-screen */
        width: 100%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        
        /* Z-index lower than hamburger (2001) but higher than page */
        z-index: 2000; 
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 50px rgba(0,0,0,0.1);
    }

    /* 3. The 'Active' class slides it in */
    .nav-links.active {
        left: 0;
    }

    /* 4. Make Mobile Links Bigger */
    .nav-links a {
        font-size: 1.5rem;
        font-family: 'Playfair Display', serif;
        color: #111;
    }

    /* 5. Show Close Button */
    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 30px;
        right: 30px;
        font-size: 3rem;
        cursor: pointer;
        z-index: 2002; /* Topmost layer */
        line-height: 1;
    }
}