/*=============== VARIABLES CSS ===============*/
:root {
    --primary-color: hsl(30, 70%, 55%); /* Warm Orange/Brown accent */
    --primary-color-dark: hsl(30, 70%, 45%);
    --text-color-light: hsl(0, 0%, 95%); /* Near white */
    --text-color-dark: hsl(0, 0%, 20%);
    --bg-dark: hsl(30, 8%, 15%); /* Deep earthy brown-grey */
    --bg-medium: hsl(30, 8%, 22%);
    --card-bg: linear-gradient(145deg, hsl(30, 8%, 22%) 0%, hsl(30, 8%, 28%) 100%); /* Slightly lighter, subtle gradient for cards/containers */

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    --border-radius-small: 0.25rem;
    --border-radius-medium: 0.5rem;
    --border-radius-large: 1rem;

    --shadow-light: 0 4px 10px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/*=============== BASE STYLES ===============*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-color-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--text-color-light);
    margin-bottom: 1rem;
}

.section {
    padding: 3rem 0;
    display: none; /* Hidden by default, managed by JS */
}

.section.active {
    display: block; /* Show active section */
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: var(--shadow-light);
}

.button:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/*=============== HEADER ===============*/
.header {
    background-color: var(--bg-medium);
    padding: 1rem 0;
    box-shadow: var(--shadow-medium);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 1rem;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 0.5rem; /* For wrapping on small screens */
}

.nav-link {
    color: var(--text-color-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

#notify-btn {
    margin-left: 1rem;
}

/*=============== PRODUCT LISTING ===============*/
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1; /* Allows info to take available space */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.product-info p {
    font-size: 0.95rem;
    color: var(--text-color-light);
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
}

/*=============== CART SECTION ===============*/
.cart-items {
    background: var(--card-bg);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-medium);
}

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

.cart-item-details h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.cart-item-details p {
    font-size: 0.9rem;
    color: var(--text-color-light);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-actions button {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.cart-item-actions button:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

#empty-cart-message {
    text-align: center;
    font-style: italic;
    color: var(--text-color-light);
    margin-top: 2rem;
}

.cart-summary {
    background: var(--card-bg);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    margin-top: 1.5rem;
    text-align: right;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.checkout-button {
    margin-top: 1rem;
    width: auto;
    padding: 0.8rem 2rem;
}

/*=============== FOOTER ===============*/
.footer {
    background-color: var(--bg-medium);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto; /* Pushes footer to the bottom */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    color: var(--text-color-light);
}

/*=============== UTILITY CLASSES ===============*/
.hidden {
    display: none !important;
}

/*=============== RESPONSIVE DESIGN ===============*/
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        width: 100%;
        justify-content: space-around;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    #notify-btn {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        text-align: center;
    }

    .product-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
    }

    .section-title {
        font-size: 1.7rem;
    }

    .product-card {
        flex-direction: row; /* Horizontal layout for product cards on small screens */
        align-items: center;
    }

    .product-card img {
        width: 120px;
        height: 120px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .product-info {
        padding: 1rem;
    }

    .add-to-cart-btn {
        width: auto; /* Auto width for button in horizontal card */
        align-self: flex-end; /* Push button to the right */
    }

    .cart-item {
        flex-direction: column; /* Stack cart items vertically */
        align-items: flex-start;
    }

    .cart-item-details {
        width: 100%;
    }

    .cart-item-actions {
        width: 100%;
        justify-content: flex-end; /* Align actions to the right */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }

    .product-card {
        flex-direction: column; /* Stack product cards vertically again for very small screens */
        align-items: stretch;
    }

    .product-card img {
        width: 100%;
        height: 180px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .add-to-cart-btn {
        width: 100%;
    }
}
