/* --- CSS Variables for Easy Theme Change --- */
:root {
    --color-primary: #8F493C; /* Terracotta / Earth Red */
    --color-secondary: #F4EADF; /* Light Cream / Beige */
    --color-accent: #587D71; /* Sage Green */
    --color-text: #3D2B1F; /* Dark Brown */
    --color-background: #FFFFFF;
    --font-family: 'Inter', sans-serif;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- Base & Mobile-First Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-secondary); /* Light background */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    padding: 1rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
}

h1 {
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

h2 {
    color: var(--color-accent);
    margin-bottom: 1rem;
    text-align: center;
}

/* --- Buttons and CTAs --- */
.primary-cta-btn {
    display: block;
    width: fit-content;
    margin: 1.5rem auto 0;
    padding: 1rem 2rem;
    background-color: var(--color-accent);
    color: var(--color-background);
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: var(--shadow);
}
.primary-cta-btn:hover {
    background-color: #4a6c62;
    transform: translateY(-2px);
}

/* --- Header & Navigation (Mobile) --- */
header {
    background-color: var(--color-primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between; /* Space logo and icon */
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative; /* Context for z-index */
}

/* --- LOGO STYLES (Mobile: Inline with Hamburger) --- */
.logo {
    display: flex;
    flex-direction: row; /* Logo image and text inline */
    align-items: center;
}

.logo-image {
    width: 40px; /* Consistent small size for mobile & desktop header */
    height: auto;
    object-fit: contain;
    margin-right: 0.5rem; /* Space between image and text */
    /* Styles for 'trimmed and pretty' look */
    border-radius: 50%;
    border: 2px solid var(--color-secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-text {
    font-size: 1.8rem; 
    font-weight: bold;
    color: var(--color-secondary); 
    /* Approximating the script font from your image */
    font-family: 'Times New Roman', serif; 
}
/* --- LOGO STYLES END --- */

/* --- MOBILE HAMBURGER MENU STYLES --- */
.menu-toggle {
    display: block; /* Show on mobile */
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001; /* Above the menu */
    padding: 0.5rem;
    color: var(--color-secondary);
    font-size: 1.5rem;
}

.main-nav {
    /* Menu is hidden off-screen by default */
    position: fixed;
    top: 0;
    right: 0;
    width: 280px; /* Width of the menu */
    height: 100vh;
    background-color: var(--color-primary);
    z-index: 1000;
    padding: 6rem 2rem 2rem; /* Padding for header/icon spacing */
    transition: transform 0.3s ease-out;
    transform: translateX(100%); /* Start off-screen */
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* State when menu is open */
.main-nav.nav-open {
    transform: translateX(0);
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 1rem 0; /* Larger clickable area in the menu */
    display: block;
    text-align: left; /* Left-align links in the menu */
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}
.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.main-nav a:last-child {
    border-bottom: none;
}
/* --- END MOBILE NAV STYLES --- */

/* --- Hero Section --- */
.hero-section {
    background-color: var(--color-background);
    padding: 3rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}
.hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.hero-subtitle {
    font-size: 1.2rem;
    color: #6a6a6a;
}

/* --- Value Proposition --- */
.value-proposition {
    padding: 1.5rem 0;
    text-align: center;
}
.value-points {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.value-points > div {
    background-color: var(--color-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.value-points h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* --- Category Navigation (Shop Page) --- */
#category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-btn {
    background-color: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 20px;
    font-weight: 500;
}

.category-btn:hover, .category-btn.active {
    background-color: var(--color-primary);
    color: white;
}

/* --- Product Grid (Mobile-First) --- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 2rem;
}

.product-card {
    background-color: var(--color-background);
    border: 1px solid var(--color-secondary);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.product-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1 / 1; 
}

.product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-price {
    font-size: 1.4rem;
    color: var(--color-accent);
    font-weight: bold;
    margin: 0.5rem 0;
}

.product-description {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.whatsapp-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #25D366; /* WhatsApp Green */
    color: white;
    text-decoration: none;
    padding: 0.8rem;
    border-radius: 6px;
    margin-top: auto;
    font-weight: bold;
    transition: background-color 0.3s;
}

.whatsapp-btn:hover {
    background-color: #128C7E;
}

/* --- About & Contact Page Content --- */
.content-section {
    background-color: var(--color-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}
.content-section p, .content-section ul {
    margin-bottom: 1rem;
}
.content-section ul {
    list-style: disc;
    margin-left: 1.5rem;
}

/* Contact Form Styling */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.contact-form-container {
    padding: 1.5rem;
    border: 1px solid var(--color-secondary);
    border-radius: 8px;
    background-color: #fff;
}
.contact-form-container label {
    display: block;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    font-weight: bold;
}
.contact-form-container input, .contact-form-container textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}
.contact-form-container textarea {
    resize: vertical;
    min-height: 120px;
}
.contact-info-block {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--color-secondary);
    border-radius: 8px;
    border: 1px solid var(--color-primary);
}
.contact-info-block h3 {
    color: var(--color-primary);
}
.contact-info-block a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: bold;
}

/* --- Footer --- */
footer {
    background-color: var(--color-text);
    color: var(--color-secondary);
    padding: 1.5rem 1rem;
    text-align: center;
    margin-top: 2rem;
}

/* Styles for social icon images container */
.social-links {
    /* Set up container to display icons side-by-side */
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Space between icons */
    margin-top: 1rem;
}

.social-links a {
    /* Ensure the link container is block-level for sizing images */
    display: block;
    line-height: 0; /* Removes any default space below the image */
}

.social-links img.social-icon {
    /* Enforce 100x100 pixel size */
    width: 50px; 
    height: 50px; 
    object-fit: contain; /* Ensures the image aspect ratio is respected */
    transition: opacity 0.3s;
}

.social-links a:hover img.social-icon {
    opacity: 0.8; /* Provides visual feedback on hover */
}

/* --- Desktop Styles (Media Query) --- */
@media (min-width: 768px) {
    /* Header: Side-by-side layout */
    header {
        justify-content: space-between;
        padding: 1rem 3rem;
    }
    
    /* Hide the mobile toggle button on desktop */
    .menu-toggle {
        display: none;
    }

    /* Navigation: Static for desktop */
    .main-nav {
        position: static;
        width: auto;
        height: auto;
        background-color: transparent;
        transform: translateX(0); /* Ensure it's visible */
        box-shadow: none;
        padding: 0;
        flex-direction: row; /* Links inline */
    }

    .main-nav a {
        display: inline;
        padding: 0.5rem 1rem;
        border-bottom: none;
        text-align: center;
    }

    /* Logo adjustments for desktop (Inline: Image + Text) */
    .logo {
        flex-direction: row; 
        margin-bottom: 0;
    }
    .logo-image {
        width: 40px; 
        margin-right: 0.5rem;
    }
    .logo-text {
        font-size: 1.8rem;
        margin-top: 0;
    }
    
    /* Hero */
    .hero-section {
        padding: 5rem 3rem;
    }
    
    /* Value Points */
    .value-points {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Product Grid: Two columns for tablet/desktop */
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Contact Page */
    .contact-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* --- Shopping Cart Icon Styling --- */

/* Base styling for the cart link container */
.cart-link {
    position: relative;
    /* Reset link/button styles as needed */
    text-decoration: none;
    color: var(--color-secondary); /* CHANGE: Must be white for the primary color header */
    font-size: 1.5rem; 
    padding: 0 10px;
}

/* Base styling for the counter badge */
.cart-badge {
    position: absolute;
    top: -5px; 
    right: 0px; 
    background-color: var(--color-accent); /* Use Sage Green for visibility */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 5px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
    display: none; 
}

/* 1. Mobile Header Placement (Visible on Mobile) */
.mobile-header-placement {
    display: none; 
}

/* 2. Desktop Navigation Placement (Visible on Desktop) */
.desktop-nav-placement {
    display: none;
}

/* Media Query for Mobile Styles (Fixing the order here) */
@media (max-width: 767px) {
    /* FIX: Set the order for all main header elements */
    
    /* Logo: First item */
    .logo {
        order: 1; 
    }
    
    /* Cart Icon: Second item */
    .mobile-header-placement {
        display: flex; 
        align-items: center;
        margin-right: 15px;
        order: 2;
    }
    
    /* Hamburger Menu: Last item */
    .menu-toggle {
        order: 3;
    }

    /* Hide the desktop placement in the navigation menu on mobile */
    .desktop-nav-placement {
        display: none;
    }
}

/* Media Query for Desktop Styles */
@media (min-width: 768px) {
    /* Desktop styles only */
    
    /* Hide the mobile placement element */
    .mobile-header-placement {
        display: none;
    }

    /* Show the desktop placement in the main-nav */
    .desktop-nav-placement {
        display: block;
        color: white; /* Ensure it looks like a nav link */
        padding: 0.5rem 1rem;
    }
}

/* --- New Cart Page Styles --- */

.empty-cart-message {
    text-align: center;
    padding: 3rem;
    border: 2px dashed var(--color-secondary);
    border-radius: 8px;
    background-color: var(--color-background);
}

.cart-items-container {
    background-color: var(--color-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    padding: 1rem;
}

.cart-list {
    border: 1px solid var(--color-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-name {
    flex-grow: 1;
    font-weight: 500;
}

.cart-item-price {
    font-weight: bold;
    color: var(--color-accent);
    margin-right: 1.5rem;
}

.remove-btn {
    /* Reusing whatsapp-btn class for styling */
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background-color: var(--color-primary); /* Use primary color for 'Remove' */
}

.remove-btn:hover {
    background-color: #a35d51;
}

/* Cart Summary Styles */
.cart-summary-container {
    background-color: var(--color-secondary);
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    padding: 1.5rem;
}

.cart-summary-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-subtotal {
    font-size: 1.8rem;
    color: var(--color-text);
    text-align: right;
    border-top: 2px dashed var(--color-primary);
    padding-top: 1rem;
}

.cart-subtotal span {
    font-weight: bold;
    color: var(--color-primary);
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.checkout-btn {
    background-color: #25D366; /* WhatsApp Green */
    width: auto;
}

.clear-btn {
    background-color: #ccc;
    color: var(--color-text);
    width: auto;
}

.clear-btn:hover {
    background-color: #bbb;
}

/* Desktop adjustments for cart items */
@media (min-width: 768px) {
    .cart-summary-box {
        max-width: 400px; /* Constrain the summary box width on desktop */
        margin-left: auto;
    }
}

/* Add to existing .cart-item in styles.css */
.cart-item {
    /* ... existing styles ... */
    grid-template-columns: 1fr auto auto auto; /* New grid structure for desktop */
    display: grid; 
    gap: 1rem;
    align-items: center;
}

/* Ensure the info is not compressed */
.cart-item-info {
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-weight: bold;
}

.cart-item-price-unit {
    font-size: 0.85rem;
    color: #666;
}

/* Quantity Control Group */
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    width: 100px; /* Fixed width for consistency */
}

.qty-btn {
    background-color: #f0f0f0;
    color: var(--color-text);
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.qty-btn:hover:not(:disabled) {
    background-color: #ddd;
}

.qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.qty-display {
    width: 40px;
    text-align: center;
    border: none;
    background-color: transparent;
    font-weight: bold;
    font-size: 1rem;
    -moz-appearance: textfield; /* Hide arrows in Firefox */
}

.qty-display::-webkit-outer-spin-button,
.qty-display::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Hide arrows in Chrome/Safari */
    margin: 0;
}

.cart-item-subtotal {
    font-weight: bold;
    color: var(--color-primary);
    text-align: right;
}

/* Adjust button styles to fit the grid */
.remove-item-btn {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
    background-color: var(--color-primary);
}

/* Mobile Layout adjustments for Cart Items */
@media (max-width: 767px) {
    .cart-item {
        grid-template-columns: 1fr auto; /* Name/Unit on one line, Controls/Total/Remove wrap below */
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0.75rem;
    }
    
    .cart-item-info {
        grid-column: 1 / 3; /* Span the whole top row */
        margin-bottom: 0.5rem;
    }
    
    .quantity-control {
        order: 3; /* Move control to the bottom left */
    }
    
    .cart-item-subtotal {
        order: 4; /* Move total next to control */
    }
    
    .remove-item-btn {
        grid-column: 1 / 3; /* Make remove button span full width at the bottom */
        order: 5;
    }
}


/* --- New styles for Customer Info Form (cart.html) --- */

.customer-info-section {
    background-color: var(--color-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.customer-info-section h2 {
    text-align: left;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

#details-form label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-weight: bold;
    color: var(--color-text);
}

#details-form input[type="text"],
#details-form input[type="tel"],
#details-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box; 
    transition: border-color 0.3s;
}

#details-form input:focus,
#details-form textarea:focus {
    border-color: var(--color-accent);
    outline: none;
}

#details-form textarea {
    resize: vertical;
    min-height: 80px;
}

.required {
    color: var(--color-primary);
    font-weight: normal;
}