:root {
    /* Color Palette */
    --color-primary: #3E2723;
    /* Deep Earthy Brown */
    --color-cream: #Fdfbf7;
    /* Warm Cream Background */
    --color-green: #1B4D3E;
    /* Deep Green */
    --color-terra: #8D4004;
    /* Terracotta */
    --color-gold: #C5A059;
    /* Gold Accent */
    --color-text: #2C1810;
    /* Dark Brownish Gray */
    --color-text-light: #Fdfbf7;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lora', serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-cream);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* --- Typography Utilities --- */
.text-gold {
    color: var(--color-gold);
}

.text-green {
    color: var(--color-green);
}

.text-center {
    text-align: center;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--color-gold);
    background-color: transparent;
    color: var(--color-primary);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--color-gold);
    color: var(--color-text-light);
    border-color: var(--color-gold);
}

.btn-primary:hover {
    background-color: #b58f45;
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-gold);
    border-color: var(--color-primary);
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

section {
    padding: var(--spacing-xl) 0;
    scroll-margin-top: 80px;
    /* Offset for fixed navbar */
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: rgba(253, 251, 247, 0.7);
    /* More transparency */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    scroll-margin-top: 80px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-green);
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
}

.nav-links a:hover {
    color: var(--color-gold);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--color-terra);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Hero Section --- */
.hero {
    height: 90vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('assets/hero_tamales.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-light);
    margin-top: 60px;
    /* offset for fixed nav */
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-gold);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Story Section --- */
.story-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.story-img {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.story-img img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 10px 10px 0 var(--color-gold);
}

.story-text h2 {
    font-size: 2.5rem;
    color: var(--color-green);
    margin-bottom: var(--spacing-md);
}

.story-text p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

/* --- Value Prop (Ingredients) --- */
.value-prop {
    background-color: #d67f3b;
    color: var(--color-text-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.value-prop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('assets/ingredients.png');
    background-size: cover;
    opacity: 0.15;
    z-index: 0;
}

.value-content {
    position: relative;
    z-index: 1;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.feature-card {
    padding: var(--spacing-lg);
    border: 1px solid #4a161a;
    border-radius: 4px;
}

.feature-card h3 {
    color: var(--color-gold);
    margin-bottom: var(--spacing-sm);
}

/* --- Menu Section --- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: var(--spacing-lg);
}

.menu-item {
    background: white;
    padding: var(--spacing-md);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-gold);
    padding-bottom: 5px;
}

.item-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-terra);
}

.item-price {
    font-weight: bold;
    color: var(--color-green);
}

.item-desc {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

/* --- Divider --- */
.section-divider {
    width: 80%;
    margin: calc(3rem + 10px) auto 3rem auto;
    border: 0;
    border-top: 1px solid var(--color-primary);
    opacity: 0.3;
}

/* --- Contact / Footer --- */
.footer {
    background-color: var(--color-text);
    color: var(--color-text-light);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.footer-content {
    display: grid;
    gap: var(--spacing-md);
}

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: var(--spacing-lg);
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    section {
        padding: var(--spacing-lg) 0;
    }

    .hero {
        min-height: 80vh;
        height: auto;
        padding-top: 80px;
        /* Extra padding for nav */
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .story-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .story-text h2,
    .value-prop h2,
    .text-center h2 {
        font-size: 1.8rem;
    }

    .section-logo,
    .hero-content img {
        max-width: 200px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: flex;
        /* Keep flex for layout */
        flex-direction: column;
        position: fixed;
        top: 70px;
        /* Below navbar */
        left: 0;
        width: 100%;
        background-color: var(--color-cream);
        padding: 2rem;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.05);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 900;
        text-align: center;
    }

    .nav-links.open {
        transform: translateY(0);
    }

    .btn {
        width: 70%;
        margin: 0 15% 10px 15%;
        text-align: center;
        display: block;
        /* Ensure block behavior for margins to work if it was inline-block */
    }

    /* Stack buttons if multiple */
    .hero-content .btn {
        display: block;
        width: 70%;
        margin: 0 15% 10px 15%;
    }

    /* Fix for menu item buttons - reset to full width without margins */
    .menu-item .btn {
        width: 100% !important;
        /* Ensure inline style is respected or enforce it */
        margin: 10px 0 0 0;
    }
}

/* --- Cart Sidebar --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: var(--color-cream);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    transform: translateX(0);
}

.cart-header {
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
}

.cart-header h3 {
    margin: 0;
    color: var(--color-primary);
}

.close-cart {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-text);
    display: flex;
    padding: 5px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.cart-item-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.cart-item-price {
    font-weight: bold;
    color: var(--color-green);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    align-self: flex-start;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.btn-qty {
    background-color: var(--color-gold);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}

.btn-qty:hover {
    background-color: var(--color-primary);
}

.qty-display {
    font-weight: bold;
    color: var(--color-primary);
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.btn-block {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    gap: 0.5rem;
}

.empty-msg {
    text-align: center;
    color: #999;
    margin-top: 2rem;
}

/* --- Section Logo --- */
.section-logo {
    display: block;
    margin: 0 auto var(--spacing-md);
    max-width: 300px;
    height: auto;
}

#cart-notes {
    width: 100%;
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    font-size: 0.9rem;
    color: #333;
    background-color: #f9f9f9;
}

#cart-notes:focus {
    outline: none;
    border-color: var(--color-gold);
    background-color: #fff;
}

/* --- Social Media --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--color-gold);
    color: white;
    transform: translateY(-3px);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .cart-footer {
        padding-bottom: 2rem;
        /* Add extra space at the bottom for mobile */
    }
}