/* --- RESET & FONTS --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; }
body { background-color: #fff; color: #1a1a1a; padding-top: 70px; /* Space for fixed navbar */ }

/* --- NAVBAR --- */
.navbar { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 15px 5%; background: white; border-bottom: 1px solid #eee;
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
}
.logo { font-size: 20px; font-weight: bold; text-decoration: none; color: black; letter-spacing: 1px; }
.nav-center a { margin: 0 15px; text-decoration: none; color: #555; font-size: 14px; text-transform: uppercase; }
.nav-right { display: flex; gap: 15px; align-items: center; }
.socials a { color: black; margin-right: 10px; }

/* --- HERO --- */
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { font-size: 2.5rem; letter-spacing: 2px; }
.subtitle { color: #777; font-style: italic; margin-top: 10px; }

/* --- GRID COLLECTION --- */
.section-title { text-align: center; margin-bottom: 30px; font-weight: normal; text-transform: uppercase; letter-spacing: 1px; }
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 40px; 
    padding: 0 5% 50px 5%; 
}
.product-card { cursor: pointer; transition: transform 0.2s; }
.product-card:hover { transform: translateY(-5px); }
.image-container { position: relative; overflow: hidden; border-radius: 4px; }
.image-container img { width: 100%; height: 400px; object-fit: cover; display: block; }

/* --- SLIDE BUTTONS --- */
.slide-controls { 
    position: absolute; top: 50%; left: 0; width: 100%; 
    display: flex; justify-content: space-between; padding: 0 10px; 
    transform: translateY(-50%); pointer-events: none; 
}
.slide-controls button { 
    pointer-events: auto; background: white; border: none; 
    width: 35px; height: 35px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
}
.slide-controls button i { font-size: 14px; color: black; }

/* --- PRODUCT PAGE (PDP) --- */
.pdp { padding: 20px 5%; min-height: 100vh; background: white; }
.back-btn { background: none; border: none; font-size: 16px; cursor: pointer; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }

/* THE LAYOUT CORRUPTION FIX */
.pdp-layout { 
    display: flex; 
    flex-wrap: wrap; /* Allows stacking on mobile */
    gap: 50px; 
    max-width: 1200px; 
    margin: 0 auto; 
}
.pdp-image-side { flex: 1; min-width: 300px; }
.pdp-image-side img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }

.pdp-info-side { flex: 1; min-width: 300px; padding-top: 10px; }
#pdp-title { font-size: 2rem; margin-bottom: 15px; line-height: 1.2; }
#pdp-description { color: #666; margin-bottom: 25px; line-height: 1.6; }
.price-display { font-size: 1.5rem; font-weight: bold; margin-bottom: 30px; color: #1a1a1a; }

/* --- OPTIONS --- */
.option-group { margin-bottom: 20px; }
.option-group label { display: block; font-size: 13px; font-weight: bold; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
select { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; background: white; }

.color-options { display: flex; gap: 12px; }
.color-dot { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #ddd; cursor: pointer; transition: transform 0.2s; }
.color-dot:hover { transform: scale(1.1); }
.color-dot.black { background: #000; }
.color-dot.white { background: #fff; }
.color-dot.natural { background: #d2b48c; }
.color-dot.gold { background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728); border: none; }
.color-dot.selected { ring: 2px solid #000; box-shadow: 0 0 0 2px white, 0 0 0 4px black; }

.add-to-bag-btn-pdp { 
    width: 100%; padding: 18px; background: #FFF; color: black; 
    font-size: 16px; font-weight: bold; letter-spacing: 2px; 
    border: 1px solid black; border-radius: 4px; cursor: pointer; margin-top: 20px; transition: opacity 0.3s;
}
.add-to-bag-btn-pdp:hover { opacity: 0.8; }

/* --- STORY & FOOTER --- */
.story-section { padding: 60px 10%; text-align: center; background: #fafafa; margin-top: 50px; }
footer { text-align: center; padding: 20px; border-top: 1px solid #eee; font-size: 12px; color: #999; }

/* --- MOBILE --- */
@media (max-width: 768px) {
    .navbar { padding: 15px; }
    .nav-center { display: none; /* Hide middle links on small mobile */ }
    .pdp-layout { flex-direction: column; gap: 20px; }
}
/* --- CART DRAWER --- */
.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

/* Starting position: Hidden off-screen to the right */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px; 
    width: 450px;
    height: 100%;
    background: white;
    z-index: 2100;
    transition: right 0.4s ease-in-out; /* This is the "Slide" animation */
}

/* Opening position: Slide into view */
.cart-drawer.open {
    right: 0 !important;
}

/* The dark background behind the drawer */
.cart-overlay.open {
    opacity: 1 !important;
    visibility: visible !important;
}
.cart-step {
    display: none; 
    flex-direction: column;
    height: 100%;
    padding: 30px;
}

.cart-step.active {
    display: flex;
}

/* This makes the items scrollable while keeping buttons visible */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}

.cart-summary-footer {
    margin-top: auto; /* Pushes footer to bottom */
    background: white;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cart-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-bottom: 20px; /* Space from bottom of screen */
}

/* Mobile Fix */
@media (max-width: 500px) {
    .cart-drawer { width: 100%; right: -100%; }
}
.cart-drawer.open { right: 0; }

.cart-header {
    padding: 20px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.close-cart { background: none; border: none; font-size: 24px; cursor: pointer; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid #f9f9f9; padding-bottom: 10px; }
.cart-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; }
.cart-item-info h4 { font-size: 14px; margin-bottom: 5px; }
.cart-item-info p { font-size: 12px; color: #666; margin-bottom: 2px; }

.cart-form { padding: 20px; background: #fcfcfc; border-top: 1px solid #eee; }
.cart-form h3 { font-size: 14px; margin-bottom: 15px; text-transform: uppercase; }
.cart-form input { 
    width: 100%; padding: 12px; margin-bottom: 10px; 
    border: 1px solid #ddd; border-radius: 4px; font-size: 14px; 
}

.cart-footer { padding: 20px; background: white; border-top: 1px solid #eee; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.summary-row.total { font-weight: bold; font-size: 18px; margin-top: 15px; }
.checkout-btn { 
    width: 100%; background: #000; color: white; padding: 15px; 
    border: none; font-weight: bold; letter-spacing: 2px; cursor: pointer; margin-top: 15px; 
}

/* Mobile Cart */
@media (max-width: 500px) {
    .cart-drawer { width: 100%; right: -100%; }
}
/* --- CART QUANTITY & CONTROLS --- */
.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    align-items: center;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-info p {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.cart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.qty-btn {
    background: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.qty-btn:hover { background: #f9f9f9; }

.qty-display {
    padding: 0 10px;
    font-size: 13px;
    font-weight: bold;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}

.remove-btn:hover { color: #d9534f; }

/* Checkout Button with Arrow */
.checkout-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333; /* Dark Grey like screenshot */
    border-radius: 6px;
}
/* --- CART ACTIONS ROW --- */
.cart-actions {
    display: flex;
    gap: 15px; /* Space between buttons */
    margin-top: 20px;
}

/* Make both buttons take equal width */
.cart-actions button {
    flex: 1; 
    padding: 15px 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: 0.3s;
}

/* Secondary Button (Keep Shopping) */
.keep-shopping-btn {
    background: white;
    border: 1px solid #000;
    color: #000;
}
.keep-shopping-btn:hover {
    background: #f0f0f0;
}

/* Primary Button (Place Order) */
.checkout-btn {
    background: #000;
    border: 1px solid #000;
    color: white;
    /* Overwriting previous width:100% */
    width: auto !important; 
    margin-top: 0 !important; 
}
.checkout-btn:hover {
    background: #333;
}
/* Drawer Sizing */
.cart-drawer {
    width: 450px; /* Bigger drawer */
    padding: 30px;
}

.cart-step { display: none; flex-direction: column; height: 100%; }
.cart-step.active { display: flex; }

.cart-title { font-family: 'Playfair Display', serif; font-size: 32px; margin-bottom: 30px; }

/* Item Layout */
.cart-item {
    display: flex; gap: 15px; margin-bottom: 25px; align-items: flex-start;
}
.cart-item img { width: 100px; height: 100px; border-radius: 8px; object-fit: cover; background: #f9f9f9; }
.item-details { flex: 1; }
.item-details h4 { font-size: 18px; margin-bottom: 5px; }
.item-meta { font-size: 13px; color: #777; line-height: 1.4; }

/* Qty Controls like the pic */
.qty-wrapper {
    display: flex; align-items: center; border: 1px solid #ddd; 
    border-radius: 6px; width: fit-content; margin-top: 10px;
}
.qty-wrapper button { padding: 5px 12px; background: none; border: none; cursor: pointer; }
.qty-wrapper span { padding: 0 10px; font-weight: bold; font-size: 14px; }

/* Footer & Buttons */
.cart-summary-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid #eee; }
.price-line { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 16px; }
.price-line.total { font-size: 22px; font-weight: bold; margin-top: 10px; }
.free-ship-promo { text-align: center; font-size: 13px; color: #666; margin: 15px 0; }

.cart-actions-row { display: flex; gap: 10px; }
.btn-primary { 
    flex: 2; background: #3d3d3b; color: white; border: none; 
    padding: 18px; border-radius: 8px; cursor: pointer; display: flex; 
    justify-content: center; align-items: center; gap: 10px; font-weight: bold;
}
.btn-secondary { flex: 1; background: white; border: 1px solid #3d3d3b; padding: 18px; border-radius: 8px; cursor: pointer; }

/* Form Styling */
.section-label { font-weight: bold; font-size: 14px; color: #555; margin-bottom: 20px; }
.checkout-form label { display: block; font-size: 11px; font-weight: bold; color: #888; margin-bottom: 5px; }
.checkout-form input { 
    width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #e0e0e0; border-radius: 8px; 
}
/* Hide all steps by default */
.cart-step {
    display: none !important; 
    flex-direction: column;
    height: 100%;
    padding: 30px;
}

/* Only show the step that has the 'active' class */
.cart-step.active {
    display: flex !important;
}

/* Ensure the footer stays at the bottom */
.cart-summary-footer {
    margin-top: auto; 
    padding-top: 20px;
    border-top: 1px solid #eee;
    background: white;
}

.cart-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.buy-now-btn {
    width: 100%;
    padding: 18px;
    margin-top: 10px;
    background-color: #000; /* Solid Black */
    color: white;
    border: 1px solid #000;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: 0.3s;
}

.buy-now-btn:hover {
    background-color: #333;
}

/* Ensure the PDP buttons look good stacked */
.pdp-info-side {
    display: flex;
    flex-direction: column;
}
/* --- MOBILE PROFESSIONAL FIX --- */
@media (max-width: 768px) {

    /* 1. Fix the Giant Title (so it doesn't say "NewEraDecora") */
    header.hero h1 {
        font-size: 2.2rem !important; /* Smaller size to fit screen */
        padding: 0 15px; /* Adds safe space on sides */
        line-height: 1.2;
    }
    
    /* 2. The "Bey & Bey" Grid Style (2 items side-by-side) */
    #product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important; /* Two columns */
        gap: 15px; /* Space between the two pictures */
        padding: 0 15px; /* Space from the edges of the phone screen */
    }

    /* 3. Clean up the Product Cards to fit the new grid */
    .product-card {
        margin-bottom: 20px;
    }

    .product-card img {
        /* Makes sure images are consistent */
        height: 200px; 
        object-fit: cover; 
        width: 100%;
        border-radius: 4px; /* Subtle smooth corners like the example */
    }

    /* 4. Make text smaller so it fits nicely under the smaller images */
    .product-card h3 {
        font-size: 0.9rem;
        margin-top: 10px;
    }
    
    .product-card p {
        font-size: 0.85rem;
    }
    /* --- FIX FOR HIDDEN CART --- */

/* 1. Stop the screen from moving left/right */
html, body {
    overflow-x: hidden !important;
    width: 100%;
    position: relative;
}

/* 2. Force the cart to stay fully hidden until clicked */
#cart-drawer {
    right: -100% !important; /* Pushes it fully away (relative to screen width) */
    width: 85%; /* On mobile, 85% width looks better than full screen */
    max-width: 400px; /* Limits size on big screens */
    visibility: hidden; /* Makes it invisible so it doesn't "peek" */
    transition: right 0.4s ease, visibility 0.4s; /* Smooth slide effect */
}

/* 3. When the cart is active (opened), bring it back */
#cart-drawer.open {
    right: 0 !important;
    visibility: visible; /* Make it visible again */
    box-shadow: -5px 0 15px rgba(0,0,0,0.2); /* Adds a nice shadow */
}
}