:root {
    --primary-ecom-color: #1a1a1a;
    --secondary-ecom-color: #666;
    --light-gray-color: #f5f5f7;
    --white-color: #ffffff;
    --dark-text-color: #1a1a1a;
}
html { box-sizing: border-box; scroll-behavior: smooth; }
*, *:before, *:after { box-sizing: inherit; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--dark-text-color);
    background-color: var(--white-color);
}
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.button-primary { display: inline-block; padding: 12px 30px; background: var(--primary-ecom-color); color: var(--white-color); text-decoration: none; border-radius: 5px; font-weight: bold; border: none; cursor: pointer; transition: background-color 0.3s ease; }
.button-primary:hover { background: #000; }
.section-title { text-align: center; margin-bottom: 40px; font-size: 2rem; font-weight: 600; }

/* --- Mobile Header --- */
.main-header {
    background: var(--white-color);
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}
.main-header.is-hidden { transform: translateY(-110%); }
.main-header .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
}
.hamburger-button {
    display: block;
    grid-column: 1 / 2;
    justify-self: start;
    z-index: 1001;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}
.logo {
    grid-column: 2 / 3;
    justify-self: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-text-color);
    text-decoration: none;
}
.header-right {
    grid-column: 3 / 4;
    justify-self: end;
}
.cart-link {
    position: relative;
    color: var(--primary-ecom-color);
    font-size: 1.5rem;
    text-decoration: none;
}
.cart-count {
    position: absolute; top: -5px; right: -10px; background: var(--primary-ecom-color);
    color: var(--white-color); border-radius: 50%; width: 20px; height: 20px;
    font-size: 0.8rem; font-weight: bold; display: flex; justify-content: center; align-items: center;
}
.main-nav { display: none; } /* Hidden by default on mobile */

/* Hamburger Icon Animation */
.hamburger-line { display: block; width: 25px; height: 2px; background-color: var(--dark-text-color); border-radius: 5px; margin: 6px 0; transition: all 0.3s ease-in-out; }
.hamburger-button.is-active .hamburger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-button.is-active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger-button.is-active .hamburger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Pop-out Mobile Menu */
.main-nav.is-active {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--white-color); z-index: 1000;
}
.main-nav a { font-size: 2rem; margin: 20px 0; text-decoration: none; color: var(--dark-text-color); }
.main-nav a.active { color: var(--secondary-ecom-color); }

/* --- Mobile Homepage Sections --- */
main > section { padding: 40px 0; }
.hero-section-ecom { background: var(--light-gray-color); text-align: center; padding: 60px 20px; }
.hero-section-ecom h1 { font-size: 2.5rem; margin: 0 0 10px 0; }
.hero-section-ecom p { font-size: 1.1rem; margin-bottom: 30px; color: var(--secondary-ecom-color); }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.product-card a { text-decoration: none; color: inherit; }
.product-card-image { width: 100%; height: 180px; object-fit: cover; }
.product-card-content { padding: 15px; text-align: left; }
.product-card-content h3 { font-size: 1rem; margin: 0 0 5px 0; font-weight: 500;}
.product-card-content .price { font-size: 1.1rem; font-weight: 600; }

/* Footer */
.main-footer-ecom { text-align: center; padding: 20px 0; margin-top: 40px; border-top: 1px solid #eee; color: var(--secondary-ecom-color); }

/* ================================
   DESKTOP STYLES
   ================================ */
@media (min-width: 769px) {
    .main-header .container { display: flex; justify-content: space-between; padding: 0; }
    .main-nav { display: flex; }
    .main-nav a { font-size: 1rem; margin: 0 15px; }
    .hamburger-button { display: none; }
    .main-nav.is-active { display: flex; /* Resets mobile-specific styles */
        flex-direction: row; position: static; height: auto; width: auto;
        background: none; box-shadow: none;
    }
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 30px; }
    .product-card-image { height: 280px; }
}
/* Add to the end of style.css */
.page-header-ecom {
    background: var(--light-gray-color);
    text-align: center;
    padding: 40px 20px;
    border-bottom: 1px solid #eee;
}

.page-header-ecom h1 {
    font-size: 2.5rem;
    margin: 0;
}

.shop-section {
    padding: 60px 0;
}
/* Add to the end of style.css */
.product-detail-section {
    padding: 20px 0;
}
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile-first */
    gap: 30px;
}
.product-gallery-main-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
}
.product-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}
.thumbnail-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
}
.thumbnail-image.active,
.thumbnail-image:hover {
    border-color: var(--primary-ecom-color);
}
.product-info h1 {
    font-size: 2rem;
    margin: 0 0 10px 0;
}
.product-info .price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-ecom-color);
    margin-bottom: 20px;
}
.purchase-options {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
}
.quantity-selector {
    display: flex;
    align-items: center;
}
.quantity-selector input {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    padding: 10px 0;
    height: 48px;
    box-sizing: border-box;
}
.quantity-selector button {
    width: 40px;
    height: 48px;
    border: 1px solid #ddd;
    background: var(--light-gray-color);
    cursor: pointer;
    font-size: 1.1rem;
}
#add-to-cart-btn {
    padding: 14px 20px;
    font-size: 1rem;
}

/* Desktop styles for product detail page */
@media (min-width: 769px) {
    .product-detail-section {
        padding: 60px 0;
    }
    .product-detail-layout {
        grid-template-columns: 1fr 1fr;
        gap: 50px;
    }
    .thumbnail-image {
        height: 100px;
    }
    .product-info h1 {
        font-size: 2.5rem;
    }
    .product-info .price {
        font-size: 1.8rem;
    }
}
/* Add to the end of style.css */
.cart-section {
    padding: 40px 0;
}
.cart-layout {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 30px;
}
.order-summary {
    background: var(--light-gray-color);
    padding: 25px;
    border-radius: 5px;
    align-self: flex-start;
}
.order-summary h2 {
    margin-top: 0;
    text-align: left;
    font-size: 1.5rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}
.summary-total {
    border-top: 1px solid #ddd;
    padding-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}
.checkout-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
}
.cart-item-card {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}
.cart-item-card:last-child { border-bottom: none; }
.cart-item-image-card {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 5px;
}
.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.cart-item-name {
    font-weight: bold;
}
.cart-item-price {
    font-size: 0.9rem;
    color: var(--secondary-ecom-color);
}
.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.quantity-selector-cart {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.quantity-selector-cart input {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 1rem;
    padding: 5px;
    background: transparent;
}
.quantity-selector-cart .qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 1.2rem;
    color: var(--secondary-ecom-color);
}
.cart-item-remove-btn-card {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-ecom-color);
    text-decoration: underline;
    font-size: 0.9rem;
}
.cart-empty-message {
    text-align: center;
    padding: 50px;
    font-size: 1.2rem;
}

/* On larger screens, use a two-column layout for the cart */
@media (min-width: 769px) {
    .cart-layout {
        grid-template-columns: 2fr 1fr;
    }
    .cart-section {
        padding: 60px 0;
    }
}