* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Premium Artisanal Theme */
    --primary: #4A3B32;
    /* Deep espresso */
    --accent: #A34335;
    /* Terracotta / Rust */
    --bg-gradient: radial-gradient(ellipse at top center, #FDFCFB 0%, #F4ECE3 100%);
    --surface: #FFFFFF;
    --text-main: #362D28;
    --text-muted: #857568;
    --shadow-soft: 0 12px 35px rgba(74, 59, 50, 0.05);
    --shadow-hover: 0 16px 45px rgba(74, 59, 50, 0.1);
    --border-light: #EDE4DB;
    --radius: 8px;
    /* Slightly sharper for a more classic feel */
}

html {
    background: var(--bg-gradient);
    min-height: 100vh;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('doodles_padaria.png');
    background-repeat: repeat;
    background-size: 400px;
    opacity: 0.05;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: -1;
}

/* --- Typography Enhancements --- */
h1,
h2,
h3,
.logo {
    font-family: 'Playfair Display', serif;
}

.text-italic {
    font-style: italic;
    font-family: 'Lora', serif;
}

/* --- Header --- */
header {
    width: 100%;
    padding: 20px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    backdrop-filter: blur(15px);
    background: rgba(253, 252, 251, 0.85);
    border-bottom: 1px solid rgba(237, 228, 219, 0.6);
    z-index: 900;
    transition: 0.3s;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo img {
    width: 90px !important;
    height: 90px !important;
}

.cart-trigger {
    background: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.cart-trigger:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cart-count {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cart-trigger:hover .cart-count {
    background: white;
    color: var(--primary);
}

/* --- Hero --- */
.hero {
    padding: 80px 5% 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
}

.hero-text h1 {
    font-size: 4rem;
    line-height: 1.1;
    color: var(--primary);
    margin-bottom: 24px;
}

.hero-text p {
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 35px;
    font-style: italic;
}

.hero-image {
    position: relative;
}

/* Decorative background behind hero image */
.hero-image::before {
    content: '';
    position: absolute;
    inset: -15px 15px 15px -15px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    z-index: -1;
    opacity: 0.4;
}

.hero-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* --- Buttons --- */
.checkout-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    /* classic look */
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 59, 50, 0.15);
}

.checkout-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(163, 67, 53, 0.2);
}

/* --- Category Filters --- */
.category-filters {
    display: flex;
    gap: 12px;
    padding: 0 5% 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 10px;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    padding: 8px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s;
}

.filter-btn:hover {
    background: rgba(163, 67, 53, 0.05);
    color: var(--accent);
    border-color: rgba(163, 67, 53, 0.2);
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(163, 67, 53, 0.2);
}

/* --- Products Grid --- */
.section-title {
    text-align: center;
    font-size: 2.8rem;
    margin: 40px 0 10px;
    color: var(--primary);
    position: relative;
}

.section-subtitle {
    text-align: center;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 50px;
}

.category-session {
    margin: 40px 0 20px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 10px;
}

.category-title {
    font-size: 2.2rem;
    color: var(--primary);
}

.products {
    padding: 0 5% 100px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(163, 67, 53, 0.3);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-light);
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.card-content p {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-grow: 1;
    line-height: 1.6;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-light);
    padding-top: 16px;
}

.price {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
}

.old-price {
    display: block;
    font-size: 0.85rem;
    text-decoration: line-through;
    color: #AFA196;
    margin-bottom: -2px;
}

.stock-badge {
    display: inline-block;
    background: #F3EAE8;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(163, 67, 53, 0.1);
}

.card.out-of-stock {
    opacity: 0.7;
}

.card.out-of-stock img {
    filter: grayscale(0.8) opacity(0.8);
}

.add-btn {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: rotate(90deg);
}

.add-btn:disabled {
    background: #F5F5F5;
    color: #ccc;
    border-color: #EEE;
    cursor: not-allowed;
}

/* --- Cart Sidebar --- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 36, 30, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    z-index: 1001;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
    transition: 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 30px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.5rem;
    color: var(--primary);
}

.close-cart {
    cursor: pointer;
    background: #FFF5F5;
    border: 1px solid rgba(163, 67, 53, 0.3);
    color: var(--accent);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.close-cart:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.cart-items-list {
    padding: 24px;
    flex-grow: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-light);
}

.cart-item img {
    width: 75px;
    height: 75px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--accent);
    font-weight: 600;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.qty-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--primary);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.qty-btn:hover {
    background: var(--border-light);
}

.cart-footer {
    padding: 30px 24px;
    border-top: 1px solid var(--border-light);
    background: rgba(253, 252, 251, 0.9);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 24px;
}

.cart-footer .checkout-btn {
    background: #20A64E;
    /* Refined WhatsApp Green */
    border-radius: 8px;
    padding: 16px;
    width: 100%;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(32, 166, 78, 0.2);
}

.cart-footer .checkout-btn:hover {
    background: #1C9345;
    box-shadow: 0 6px 20px rgba(32, 166, 78, 0.3);
}

.clear-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.3s;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clear-btn:hover {
    background: #FFF5F5;
    color: var(--accent);
    border-color: rgba(163, 67, 53, 0.2);
}

.empty-cart-msg {
    text-align: center;
    color: var(--text-muted);
    font-family: 'Lora', serif;
    font-style: italic;
    margin-top: 50px;
}

/* --- Footer --- */
footer {
    background: var(--primary);
    color: #EDE4DB;
    padding: 50px 5%;
    text-align: center;
    border-top: 4px solid var(--accent);
}

footer h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: white;
}

footer p {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 40px;
        gap: 30px;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-image {
        order: -1;
    }

    .hero-image::before {
        inset: -10px 10px 10px -10px;
    }

    header {
        padding: 15px 5%;
    }

    .logo {
        font-size: 1.5rem;
    }
}