/* --- Variables & Reset --- */
:root {
    --primary-orange: #F58A07;
    --secondary-brown: #5C3D2E;
    --background-cream: #FDF8E2;
    --white: #FFFFFF;
    
    --font-main: 'Nunito', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-cream);
    color: var(--secondary-brown);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Container Utility --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Typography --- */
h1 { font-weight: 800; font-size: 2.5rem; line-height: 1.1; margin-bottom: 1rem; }
h2 { font-weight: 700; font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.5rem; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    background-color: var(--primary-orange);
    color: var(--white);
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover { background-color: #d97805; }
.btn-block { display: block; width: 100%; text-align: center; border-radius: 8px; margin-top: 10px; }

/* --- Header --- */
.main-header {
    background-color: var(--primary-orange);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* Spacing between Cart, Burger, and User icons */
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--white);
}

.brand-logo i { font-size: 1.5rem; }
.nav-logo {
    height: 40px; /* Adjusts the height of the logo */
    width: auto;  /* Keeps the aspect ratio correct */
    display: block;
}

/* Mobile Menu Logic */
.mobile-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.main-nav, .header-icons {
    display: none; /* Hidden on mobile by default */
    width: 100%;
    margin-top: 15px;
}

.main-nav.active, .header-icons.active {
    display: block;
}

.main-nav ul {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.header-icons {
    text-align: center;
    margin-top: 15px;
}

.header-icons a {
    margin: 0 10px;
    font-size: 1.2rem;
}

/* Desktop Header Overrides */
@media (min-width: 768px) {
    .mobile-toggle { display: none; }
    
    .main-nav, .header-icons {
        display: block;
        width: auto;
        margin-top: 0;
    }

    .main-nav ul {
        flex-direction: row;
        gap: 25px;
    }
}

/* --- Hero Section --- */
.hero {
    padding: 40px 0;
    text-align: center;
}

.hero-image img {
    margin: 20px auto 0;
    max-width: 300px;
}

@media (min-width: 768px) {
    .hero-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 40px 0;
    }
    
    .hero-text {
        text-align: left;
        flex: 1;
        padding-right: 20px;
    }

    .hero-image {
        flex: 1;
    }

    .hero-image img {
        margin: 0;
        margin-left: auto;
        max-width: 100%;
    }

    h1 { font-size: 3.5rem; }
}

/* --- Categories --- */
.categories-section { padding: 40px 0; }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns mobile */
    gap: 15px;
}

.cat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.cat-card:hover { transform: translateY(-5px); }

.cat-icon {
    font-size: 2rem;
    color: var(--primary-orange);
    margin-bottom: 10px;
}

.cat-card span { font-weight: 700; color: var(--secondary-brown); }

/* Update the main card class to have a pointer cursor */
.cat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease; /* smooth transition for color changes */
    cursor: pointer; /* <--- Shows the hand cursor */
}

/* Hover Effect */
.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* Selected / Active State */
.cat-card.active {
    background-color: var(--primary-orange);
    color: var(--white);
    transform: scale(1.05); /* Make it pop slightly */
}

/* Change icon color inside the active card to white */
.cat-card.active .cat-icon {
    color: var(--white);
}

/* Keep span color logic consistent */
.cat-card.active span {
    color: var(--white);
}



.variant-selector {
    margin: 10px 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.variant-selector select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-family: inherit;
}



@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns desktop */
    }
}

/* --- Product Sections --- */
.product-section { padding: 20px 0 40px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 cols mobile */
    gap: 15px;
}

/* For very small screens */
@media (max-width: 400px) {
    .product-grid { grid-template-columns: 1fr; }
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #eee;
}

/* --- Quantity Stepper Styles --- */
.qty-selector {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Spreads label and buttons */
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.qty-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-brown);
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover { background-color: #e0e0e0; }

.qty-val {
    width: 30px;
    text-align: center;
    font-weight: 700;
}

.p-info { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }

.p-info h3 { flex-grow: 1; font-size: 1rem; }
.p-info .price {
    font-weight: 800;
    font-size: 1.1rem;
    margin: 5px 0;
}

@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 cols desktop */
        gap: 25px;
    }
}

/* --- Footer --- */
footer {
    background-color: var(--secondary-brown);
    color: var(--white);
    padding: 40px 0;
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

.footer-col h3 { margin-bottom: 15px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { text-decoration: underline; }

.social-icons { font-size: 1.5rem; }
.social-icons a { margin: 0 10px; }

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .social-icons { text-align: right; }
}


/* --- Cart Sidebar --- */
.cart-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none; /* Hidden by default */
}

.cart-sidebar {
    position: fixed;
    top: 0; right: -100%; /* Hidden off-screen */
    width: 350px;
    height: 100%;
    background: var(--white);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1002;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0; /* Slide in */
}

.cart-header {
    padding: 20px;
    background: var(--primary-orange);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header button {
    background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.cart-icon-btn {
    position: relative; /* Needed to position the badge */
    color: var(--white);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #ff0000; /* Red background */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    height: 18px;
    width: 18px;
    border-radius: 50%; /* Makes it a perfect circle */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary-orange); /* Small border to separate from icon */
    
    opacity: 0; /* Hidden by default */
    transform: scale(0);
    transition: all 0.2s ease;
}

.cart-badge.show {
    opacity: 1;
    transform: scale(1);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 15px;
}

/* Cart Item Styling */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.item-details h4 { font-size: 0.9rem; margin-bottom: 5px; }
.item-details p { font-size: 0.8rem; color: #666; }

.remove-btn {
    color: red;
    background: none; border: none; cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 400px) {
    .cart-sidebar { width: 100%; }
}

/* --- Checkout Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 { margin: 0; color: var(--primary-orange); }
.modal-header button { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
}

.order-summary-mini {
    text-align: right;
    font-weight: 800;
    font-size: 1.2rem;
    margin: 20px 0;
    color: var(--secondary-brown);
}

/* --- Success Modal Specifics --- */
.success-content {
    text-align: center;
    max-width: 350px; /* Slightly smaller than the form */
}

.success-icon {
    font-size: 4rem;
    color: #28a745; /* Standard Success Green */
    margin-bottom: 15px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-content h3 {
    color: var(--secondary-brown);
    margin-bottom: 10px;
}

.success-content p {
    margin-bottom: 5px;
}

.sub-text {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 25px;
}

/* Optional: Small animation for the checkmark */
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}