/* =========================================
   1. VARIABLES & THEME SETTINGS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --primary-color: #C8A165;   /* Satin Gold */
    --primary-dark: #A68550;
    
    /* LIGHT MODE (Default) */
    --bg-body: #ffffff;
    --bg-card: #f9f9f9;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --border-color: #eee;
    --shadow: rgba(0,0,0,0.05);
    --transition-speed: 0.3s;
}

/* DARK MODE OVERRIDES */
body.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-main: #f4f4f4;
    --text-muted: #cccccc;
    --nav-bg: rgba(18, 18, 18, 0.95);
    --border-color: #333;
    --shadow: rgba(0,0,0,0.5);
}

/* =========================================
   2. GLOBAL RESETS & BASICS
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 { font-weight: 400; line-height: 1.2; }

a { text-decoration: none; color: inherit; }

img { max-width: 100%; display: block; }

.container {
    width: 90%; max-width: 1200px; margin: 0 auto;
}

/* LUXURY SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f0f0f; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; border: 1px solid #0f0f0f; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* =========================================
   3. UTILITY CLASSES & SMART BAR
   ========================================= */
.btn {
    display: inline-block; padding: 12px 30px; 
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem; font-weight: 700;
    transition: var(--transition-speed); cursor: pointer; border: 1px solid transparent;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-outline { border-color: white; color: white; }
.btn-outline:hover { background: white; color: black; transform: translateY(-2px); }

/* NEW: Adapts perfectly to Dark/Light Mode */
.btn-outline-dark { 
    border: 1px solid var(--text-main); /* Border matches Text Color (Black or White) */
    color: var(--text-main); 
    background: transparent;
    transition: 0.3s;
}

.btn-outline-dark:hover { 
    border-color: var(--primary-color); /* Turns Gold on Hover */
    color: var(--primary-color); 
    background: transparent;
}

.divider { height: 2px; width: 60px; background: var(--primary-color); margin: 20px auto; }
.divider-left { height: 2px; width: 60px; background: var(--primary-color); margin: 20px 0; }

.sub-heading {
    display: block; text-transform: uppercase; letter-spacing: 3px; 
    color: var(--primary-color); font-size: 0.85rem; font-weight: 700; margin-bottom: 10px;
}

/* SMART BAR (3-State Logic) */
.smart-bar {
    font-family: 'Playfair Display', serif; 
    font-style: normal;
    font-size: 1.25rem; 
    font-weight: 600;
    letter-spacing: 1px;
    
    background: #111; /* Default: Black (Open) */
    color: #fff;      /* Default: White text */
    text-align: center; 
    padding: 12px 0; 
    transition: all 0.3s ease;
}

.smart-bar.warning { background: var(--primary-color); color: #000; }
.smart-bar.closed { background: #4a0404; color: #fff; }

/* STICKY HEADER WRAPPER */
.sticky-header {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 500; 
    width: 100%;
}

/* =========================================
   4. NAVBAR & MOBILE MENU
   ========================================= */
.navbar {
    width: 100%;
    background: var(--nav-bg);
    padding: 15px 0; 
    box-shadow: 0 2px 10px var(--shadow);
    backdrop-filter: blur(10px);
}

.nav-flex { display: flex; justify-content: space-between; align-items: center; }

.logo { font-family: 'Playfair Display', serif; font-size: 1.5rem; letter-spacing: 1px; font-weight: 700; }
.logo span { color: var(--primary-color); font-style: italic; }

.nav-links { list-style: none; display: flex; gap: 30px; }

.nav-links a {
    font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; transition: 0.3s;
}
.nav-links a:hover { color: var(--primary-color); }

/* Theme Toggle */
.theme-btn {
    background: none; border: 1px solid var(--border-color);
    color: var(--text-main); padding: 8px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.theme-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.theme-btn svg { width: 20px; height: 20px; }

.moon-icon { display: none; }
body.dark-mode .sun-icon { display: none; }
body.dark-mode .moon-icon { display: block; }

/* Hamburger */
.floating-toggle { display: none; cursor: pointer; flex-direction: column; gap: 6px; z-index: 2001; }
.bar { width: 25px; height: 2px; background-color: var(--text-main); transition: 0.4s; }

.floating-toggle.active .bar:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.floating-toggle.active .bar:nth-child(2) { opacity: 0; }
.floating-toggle.active .bar:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

/* Mobile Overlay */
.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--bg-body);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; opacity: 0; pointer-events: none; transition: 0.4s ease;
}
.mobile-menu-overlay.active { opacity: 1; pointer-events: all; }

.mobile-links { list-style: none; text-align: center; padding: 0; }
.mobile-links li { margin: 25px 0; opacity: 0; transform: translateY(20px); transition: 0.4s ease; }

.mobile-menu-overlay.active li:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.mobile-menu-overlay.active li:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.mobile-menu-overlay.active li:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.mobile-menu-overlay.active li:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.mobile-menu-overlay.active li:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

.mobile-link { font-family: 'Playfair Display', serif; font-size: 2rem; font-style: italic; }
.mobile-link:hover { color: var(--primary-color); }

/* =========================================
   5. HERO SECTION (Cinematic)
   ========================================= */
.hero {
    height: 100vh;
    background: url('https://images.unsplash.com/photo-1543353071-873f17a7a088?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: white; margin-top: 0;
}
.hero-overlay {
    background: rgba(0, 0, 0, 0.6); width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.hero-content { max-width: 800px; padding: 20px; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero .sub-heading { opacity: 0; animation: fadeInUp 1s ease-out 0.2s forwards; }
.hero h1 { 
    font-family: 'Playfair Display', serif; 
    font-size: 4rem; margin: 10px 0 20px; line-height: 1.1; 
    opacity: 0; animation: fadeInUp 1s ease-out 0.5s forwards; 
}
.hero em { font-family: 'Playfair Display', serif; font-style: italic; color: var(--primary-color); }
.hero p { 
    font-size: 1.2rem; margin-bottom: 30px; color: #eee; font-weight: 300;
    opacity: 0; animation: fadeInUp 1s ease-out 0.8s forwards;
}
.hero-buttons { 
    display: flex; gap: 20px; justify-content: center;
    opacity: 0; animation: fadeInUp 1s ease-out 1.1s forwards;
}

/* =========================================
   6. SECTIONS GENERAL
   ========================================= */
section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-family: 'Playfair Display', serif; font-size: 2.5rem; }

.row { display: flex; gap: 50px; align-items: center; }
.row.reverse { flex-direction: row-reverse; }
.col-text { flex: 1; }
.col-image { flex: 1; }

/* UPDATED IMAGE STYLING: Matching Meal Plans (Border + Background + Hover) */
.col-image img { 
    width: 100%; 
    border-radius: 4px;
    background: var(--bg-body); 
    padding: 10px; 
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

/* Hover Effect - Desktop Only to prevent mobile stickiness */
@media (hover: hover) {
    .col-image:hover img { 
        transform: translateY(-10px); 
        box-shadow: 0 15px 30px var(--shadow); 
        border-color: var(--primary-color); 
    }
}

/* Curator Section */
.about-section h2 { font-family: 'Playfair Display', serif; font-size: 2.5rem; margin-bottom: 20px; }

/* =========================================
   7. PRICING CARDS
   ========================================= */
.pricing { background-color: var(--bg-card); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.card {
    background: var(--bg-body); padding: 10px; border: 1px solid var(--border-color);
    transition: 0.3s; position: relative;
}
.card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px var(--shadow); border-color: var(--primary-color); }

.card-inner { border: 1px solid var(--border-color); padding: 40px 20px; text-align: center; height: 100%; }
.card h3 { font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; }
.price { font-family: 'Playfair Display', serif; font-size: 2.5rem; color: var(--primary-color); margin-bottom: 15px; }
.price .period { font-size: 1rem; color: var(--text-muted); font-family: 'Lato', sans-serif; }
.details { font-weight: 700; margin-bottom: 10px; }
.desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; }

/* Featured Card */
.featured { transform: scale(1.05); border-color: var(--primary-color); z-index: 2; }
.featured-tag { 
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    background: var(--primary-color); color: white; padding: 5px 15px;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
}

/* =========================================
   8. GALLERY (Quilted + Breathe)
   ========================================= */
.gallery-section {
    background-color: var(--bg-card); /* VISUAL SEPARATION */
    padding: 100px 0;
}

.quilted-gallery {
    display: grid; grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px; gap: 10px;
}

.gallery-item { position: relative; overflow: hidden; background: #000; cursor: pointer; }

.gallery-item img, .gallery-item video {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gallery-item:hover img, .gallery-item:hover video { transform: scale(1.06); }

.gallery-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3); opacity: 0; transition: 0.4s;
    display: flex; align-items: center; justify-content: center;
    color: white; font-family: 'Playfair Display', serif; letter-spacing: 1px; font-style: italic;
    pointer-events: none;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

.item-large { grid-column: span 2; grid-row: span 2; }
.item-wide { grid-column: span 2; }
.item-tall { grid-row: span 2; }

/* =========================================
   9. FOOTER
   ========================================= */
footer { background: #111; color: #fff; text-align: center; padding: 80px 0; }
.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.8rem; margin-bottom: 30px; letter-spacing: 2px; }
.footer-logo span { color: var(--primary-color); font-style: italic; }

.footer-contact p { margin: 10px 0; color: #ccc; font-weight: 400; font-size: 0.95rem; }
.footer-contact a { color: #ccc; transition: 0.3s; }
.footer-contact a:hover { color: var(--primary-color); }

.footer-social-icons { margin: 40px 0; display: flex; justify-content: center; gap: 20px; }
.footer-social-icons a { color: #fff; transition: 0.3s; }
.footer-social-icons a:hover { color: var(--primary-color); transform: translateY(-3px); }

.copyright { margin-top: 40px; font-size: 0.8rem; color: #999; text-transform: uppercase; letter-spacing: 1px; font-weight: 400; }

/* =========================================
   10. MODALS & LIGHTBOX
   ========================================= */
/* LIGHTBOX */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 3000;
    display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.4s ease;
    backdrop-filter: blur(5px);
}
.lightbox.active { display: flex; opacity: 1; }
.lightbox-content { max-width: 90%; text-align: center; position: relative; }
.lightbox-content img { max-height: 85vh; border: 1px solid var(--primary-color); box-shadow: 0 0 30px rgba(0,0,0,0.8); border-radius: 2px; }

#lightbox-caption { color: #fff; margin-top: 15px; font-family: 'Playfair Display', serif; font-style: italic; letter-spacing: 1px; }

.lightbox-close { position: absolute; top: 30px; right: 40px; font-size: 50px; color: #fff; cursor: pointer; transition: 0.3s; line-height: 1; z-index: 3002; }
.lightbox-close:hover { color: var(--primary-color); transform: rotate(90deg); }

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5); color: white; font-size: 2rem;
    padding: 10px 15px; cursor: pointer; transition: 0.3s; border-radius: 50%;
    user-select: none; z-index: 3001;
}
.lightbox-nav:hover { background: var(--primary-color); color: #000; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* MEAL BUILDER MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2500; display: none; align-items: center; justify-content: center; }
.modal-content { background: var(--bg-card); width: 100%; max-width: 600px; border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; max-height: 90vh; color: var(--text-main); }
.modal-header { padding: 25px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.close-modal { font-size: 1.5rem; cursor: pointer; }
.progress-bar { height: 3px; background: var(--border-color); width: 100%; }
.progress-fill { height: 100%; background: var(--primary-color); width: 0%; transition: 0.3s; }
.builder-body { padding: 30px; overflow-y: auto; }
.selection-group { margin-bottom: 25px; }
.selection-group h4 { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 15px; letter-spacing: 1px; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.option-btn { background: var(--bg-body); border: 1px solid var(--border-color); padding: 12px; border-radius: 2px; cursor: pointer; font-size: 0.9rem; color: var(--text-main); transition: 0.2s; font-weight: 400; text-align: center; }
.option-btn:hover { border-color: var(--primary-color); }
.option-btn.selected { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.modal-footer { padding: 25px; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.error-msg { color: #d9534f; font-size: 0.9rem; }

/* =========================================
   11. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    .floating-toggle { display: flex; }
    
    .hero h1 { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; }
    
    .row { flex-direction: column; }
    .row.reverse { flex-direction: column; }
    
    .grid-3 { grid-template-columns: 1fr; }
    .featured { transform: scale(1); }
    
    .quilted-gallery { grid-template-columns: repeat(2, 1fr); }
    
    .lightbox-nav { font-size: 1.5rem; padding: 8px 12px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    
    /* Stack the split layout on mobile */
    .pickup-split-layout { grid-template-columns: 1fr !important; }
}

/* =========================================
   12. SNIPCART COMPATIBILITY FIXES
   ========================================= */

/* 1. Force Snipcart Text to be Black & ON TOP */
/* We target .snipcart-layout because Snipcart v3 appends this to the body, outside #snipcart */
.snipcart-layout, 
.snipcart-modal, 
.snipcart-side-cart,
#snipcart {
    color: #1a1a1a !important; 
    font-family: 'Lato', sans-serif;
    z-index: 9999999 !important; /* Extremely high to beat any sticky headers */
    position: relative; 
}

/* 2. Fix Header/Close Buttons visibility inside Snipcart */
.snipcart-modal__header-button, 
.snipcart-layout__header-button,
.snipcart-cart-header__close-button {
    color: #1a1a1a !important;
    opacity: 1 !important;
}

/* 3. Ensure Inputs (Address/Card) are legible */
#snipcart input, 
#snipcart select, 
#snipcart textarea {
    color: #1a1a1a !important;
    background: #fff !important;
    border-color: #ccc !important;
}

/* 4. Fix for specific Snipcart dark mode conflicts */
.snipcart-item-line__title,
.snipcart-item-line__content,
.snipcart-summary-fees__amount,
.snipcart-base-button {
    color: #1a1a1a !important;
}

.snipcart-base-button {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* =========================================
   13. LUXURY FORM ELEMENTS (Allergies)
   ========================================= */
.luxury-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    color: var(--text-main);
    font-size: 1rem;
    position: relative;
    padding-left: 35px; /* Space for custom checkmark */
    user-select: none;
    justify-content: center; /* Center the label text */
    margin-bottom: 10px;
}

/* Hide default browser checkbox */
.luxury-checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Gold Checkmark Box */
.custom-checkmark {
    position: absolute;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: transparent;
    border: 1px solid var(--text-muted);
    border-radius: 2px;
    transition: 0.3s;
}

/* On Hover */
.luxury-checkbox-label:hover .custom-checkmark {
    border-color: var(--primary-color);
}

/* When Checked */
.luxury-checkbox-label input:checked ~ .custom-checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Checkmark Icon */
.custom-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.luxury-checkbox-label input:checked ~ .custom-checkmark:after {
    display: block;
}

/* Draw the check */
.luxury-checkbox-label .custom-checkmark:after {
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Text Styling */
.luxury-checkbox-label .label-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* =========================================
   14. PICKUP STEP SPLIT LAYOUT
   ========================================= */
.pickup-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Split exactly in half */
    gap: 20px;
    align-items: stretch; /* Stretch heights to match */
}

/* LEFT COLUMN: Allergy */
.allergy-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

#allergy-text {
    width: 100%;
    height: 100%;
    min-height: 60px; /* Base height */
    flex-grow: 1; /* Grow to fill space */
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 10px;
    font-family: 'Lato', sans-serif;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
    border-radius: 2px;
    resize: none; /* Keep it neat */
    display: none; /* Hidden by default */
}

#allergy-text.visible {
    display: block;
    border-color: var(--primary-color);
}

/* RIGHT COLUMN: Service Buttons */
.service-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-column .option-btn {
    padding: 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* If there's only one button, it grows */
}

/* =========================================
   15. PANTRY (BULK) SECTION STYLES
   ========================================= */
/* Alternating Background Color Logic */
.pantry-section {
    /* Use BODY color so it matches "Curator" and "Gallery" */
    background-color: var(--bg-body); 
    color: var(--text-main);
    transition: 0.5s ease;
    padding: 120px 0;
}

/* Special Framing for Pantry Image to match Meal Plans style */
.pantry-img {
    width: 100%;
    border-radius: 4px;
    background: var(--bg-body); 
    padding: 10px; 
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

@media (hover: hover) {
    .pantry-img:hover {
        transform: translateY(-10px); 
        box-shadow: 0 15px 30px var(--shadow); 
        border-color: var(--primary-color);
    }
}