/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Muli:wght@300;400;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Warm neutral palette inspired by the design */
    --primary-color: #3D3D3D;        /* Charcoal */
    --secondary-color: #5A5A5A;      /* Medium gray */
    --accent-color: #C17B5C;         /* Terracotta */
    --accent-light: #E8B298;         /* Light terracotta */
    --text-dark: #2B2B2B;            /* Dark charcoal */
    --text-light: #7A7A7A;           /* Medium gray */
    --bg-cream: #F5F1ED;             /* Soft cream */
    --bg-beige: #E8E3DD;             /* Warm beige */
    --bg-light: #FAF8F6;             /* Very light cream */
    --success-color: #8FB88F;        /* Muted sage green */
    --border-color: #D4CFC8;         /* Warm gray border */
    --white: #FFFFFF;
}

body {
    font-family: 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    padding-top: 0; /* Header overlays snap sections */
}

h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Caveat Brush', cursive;
}

/* Header */
header {
    background: var(--white);
    color: var(--text-dark);
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.cart-icon {
    position: relative;
    display: inline-block;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: cartBounce 0.5s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes cartWiggle {
    0%   { transform: scale(1)   rotate(0deg); }
    20%  { transform: scale(1.3) rotate(-12deg); }
    40%  { transform: scale(1.3) rotate(10deg); }
    60%  { transform: scale(1.2) rotate(-6deg); }
    80%  { transform: scale(1.1) rotate(3deg); }
    100% { transform: scale(1)   rotate(0deg); }
}

.cart-wiggle {
    animation: cartWiggle 0.6s ease !important;
}

/* Hero Section */
.hero {
    background: var(--bg-cream);
    padding: 70px 2rem 2rem; /* top padding for fixed header */
    margin-bottom: 0;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    height: 100%;
    padding: 2rem 0;
}

.hero-content {
    padding-left: 2rem;
    padding-right: 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    line-height: 1.2;
    text-align: left;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.badge {
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: left;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    font-family: 'Caveat Brush', cursive;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.hero-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-right: 2rem;
}

.hero-image {
    width: min(500px, 45vh);
    height: min(500px, 45vh);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background: var(--bg-beige);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-image-emoji {
    font-size: 8rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Products Section & Carousel */
.products-section {
    padding: 70px 2rem 0; /* Same as hero - top padding for fixed header */
    justify-content: flex-start;
    background: var(--bg-light);
}

.products-section-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.products-section-inner .section-title {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.free-delivery-banner {
    flex-shrink: 0;
    text-align: center;
    padding: 0.25rem 0;
    margin-bottom: 0; /* Ensure no extra margin */
}

.free-delivery-banner .alert {
    margin-bottom: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, #C17B5C 0%, #F5D970 50%, #23C6D9 100%);
    border-radius: 2px;
}

/* ── Products Grid Layout ── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image-wrapper {
        max-height: 200px;
        aspect-ratio: auto;
    }

    .product-info-below {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .product-name-section {
        padding-bottom: 0.3rem;
        border-bottom: 1px solid var(--border-color);
        gap: 0.4rem;
    }

    .product-name {
        font-size: 0.95rem;
    }

    .product-serving-badge {
        font-size: 0.62rem;
        padding: 0.22rem 0.45rem;
    }

    .pack-size-btn {
        flex: 0 1 calc(33.333% - 0.5rem);
        min-width: 80px;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .product-benefits {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.5rem;
        justify-content: space-around;
        font-size: 0.7rem;
    }

    .product-benefits li {
        margin-bottom: 0;
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    .benefit-value-badge {
        font-size: 0.58rem;
        padding: 0.16rem 0.35rem;
    }

    .product-controls {
        padding: 0 0.75rem 0.75rem;
        gap: 0.5rem;
    }

    .qty-input {
        width: 32px;
        font-size: 0.85rem;
    }

    .qty-btn {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }

    .btn.btn-primary {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}

/* ── Product card (portrait grid layout) ── */
.product-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Image wrapper */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: min(400px, calc(var(--app-vh, 100vh) * 0.34));
    border-radius: 16px 16px 0 0;
    background: var(--bg-cream);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* Product Info Below Image */
.product-info-below {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.product-name-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    min-width: 0;
    flex: 1;
}

.product-serving-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-beige);
    color: var(--text-dark);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Benefits List */
.product-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.product-benefits li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.benefit-text {
    min-width: 0;
}

.benefit-value-badge {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.product-benefits li:before {
    content: "●";
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Pack Size Selector */
.pack-size-selector {
    width: 100%;
}

.pack-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pack-size-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
}

.pack-size-btn:hover {
    border-color: var(--accent-color);
    background: rgba(193, 123, 92, 0.05);
}

.pack-size-btn.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Product Controls */
.product-controls {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-light);
    width: fit-content;
    align-self: center;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-dark);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: rgba(193, 123, 92, 0.1);
}

.qty-input {
    width: 40px;
    border: none;
    text-align: center;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

/* George-only product styling */
.product-card.george-only-product {
    position: relative;
}

.george-only-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.product-card.george-only-product:hover .george-only-overlay {
    opacity: 1;
}

.george-only-badge {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.george-only-text {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.george-only-subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.product-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin: 0;
    white-space: nowrap;
}

/* ── About / Why Choose grid ── */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin: 0 auto 0;
    flex-shrink: 1;
    min-height: 0;
    max-width: 80%;
}

.about-card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 0;
    overflow: visible;
    position: relative;
}

 .about-card::before {
    content: attr(data-number);
    position: absolute;
    top: -13px;
    left: -13px;
    width: 42.5px;
    height: 42.5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    z-index: 10;
}
@media (max-width: 900px) {
    .about-card::before {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        top: -8px;
        left: -8px;
        z-index: 10;
    }
}

.about-card:nth-child(1)::before {
    content: "1";
    background-color: var(--accent-color);
}

.about-card:nth-child(2)::before {
    content: "2";
    background-color: var(--success-color);
}

.about-card:nth-child(3)::before {
    content: "3";
    background-color: var(--secondary-color);
}

.about-card-emoji {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.about-card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-family: 'Caveat Brush', cursive;
}

.about-card-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Pack Size Selector */
.pack-size-selector {
    margin: 0;
}

.pack-size-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.pack-size-options {
    display: flex;
    gap: 0.5rem;
}

.pack-size-option {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: var(--white);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-align: center;
    flex: 1;
}

.pack-size-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-cream);
}

.pack-size-option.selected {
    border-color: var(--primary-color);
    background: #e8f4f8;
    box-shadow: 0 0 0 1px var(--primary-color);
}

.pack-size-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pack-size-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
}

.pack-size-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

.pack-size-price {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 123, 92, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #7DA77D;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Cart Page */
.cart-container {
    padding: 2rem 0;
}

.cart-items {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    background: var(--bg-cream);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.cart-item-pack-size {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: var(--bg-cream);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    display: inline-block;
}

.cart-item-price {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--bg-light);
}

.quantity {
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 30px;
    text-align: center;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-left: auto;
}

.remove-btn:hover {
    background: #c82333;
}

.cart-summary {
    background: var(--bg-cream);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.summary-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Checkout Form */
.checkout-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.checkout-form {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.order-summary-checkout {
    background: var(--bg-cream);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.order-summary-checkout h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--bg-light);
    text-align: center;
    padding: 1.5rem 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

footer.visible {
    opacity: 1;
    pointer-events: auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

footer .footer-links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── About / Why Choose section ── */
.about-section {
    padding: 70px 2rem 4rem 2rem; /* Add bottom padding for footer space */
    background: var(--bg-light);
    min-height: -webkit-fill-available; /* iOS Chrome fix */
}

.about-section-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.about-section-inner .section-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
    text-align: center;
}

/* Only lock scrolling on pages with snap-scroll (index.html) */
html:has(#snap-container) {
    height: var(--app-vh, 100vh);
    height: var(--app-vh, 100dvh);
    overflow: hidden;
}

html:has(#snap-container) body {
    height: var(--app-vh, 100vh);
    height: var(--app-vh, 100dvh);
    overflow: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-top: 70px; /* push content below fixed header */
}

main#snap-container {
    padding-top: 0; /* snap sections handle their own padding */
    height: var(--app-vh, 100vh);
    height: var(--app-vh, 100dvh);
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    position: fixed; /* Fix for iOS Chrome viewport issues */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ── Snap sections ── */
.snap-section {
    height: var(--app-vh, 100vh);
    height: var(--app-vh, 100dvh);
    min-height: -webkit-fill-available; /* iOS Chrome fix */
    flex-shrink: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

/* ── Landscape / wide screens: multiple cards visible ── */
@media (min-width: 900px) and (orientation: landscape),
       (min-width: 900px) {
    .product-card {
        flex: 0 0 calc(50% - 8px);
    }
}
@media (min-width: 1200px) {
    .product-card {
        flex: 0 0 calc(25% - 12px);
    }
}

/* ── Portrait / mobile: single card ── */
@media (max-width: 899px) and (orientation: portrait),
       (max-width: 767px) {
    .product-card {
        flex: 0 0 100%;
    }
    .carousel-arrow {
        display: none; /* swipe on mobile, dots are enough */
    }
}

/* Tablet and medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-container {
        gap: 3rem;
        padding: 1.5rem 0;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero-image {
        width: min(400px, 40vh);
        height: min(400px, 40vh);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 80px 1.25rem 2rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 1.5rem;
        align-content: start;
        padding: 0;
        height: auto;
    }

    .hero-content {
        padding-left: 0;
        padding-right: 0;
        padding-top: 0;
        text-align: center;
        order: 1;
    }

    .hero-image-container {
        padding-right: 0;
        order: 2;
        margin-top: 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.75rem;
        text-align: center;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }

    .hero-badges {
        justify-content: center;
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }

    .badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .hero-stats {
        justify-content: center;
        margin-bottom: 1rem;
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .hero .btn {
        padding: 0.5rem 1.25rem;
        font-size: 0.9rem;
    }

    .hero-image {
        width: min(220px, 28vh);
        height: min(220px, 28vh);
    }

    .hero-image-emoji {
        font-size: 3rem;
    }

    .cart-item {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }

    .section-title::after {
        width: 80px;
        height: 2px;
    }

    .products-section {
        padding: 70px 1rem 0; /* Consistent with hero */
    }

    .about-section {
        padding: 70px 1rem 0;
    }

    footer {
        padding: 0.75rem 1rem;
        font-size: 0.7rem;
    }

    footer p {
        margin: 0;
        line-height: 1.3;
    }

    .footer-links {
        gap: 0.25rem;
        line-height: 1.25;
    }

    /* About grid → single column on mobile */
    .about-grid {
        flex: 0 1 auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.5rem;
        margin-bottom: 0.5rem; /* Add small margin before footer */
    }

    .about-card {
        padding: 0.5rem 0.75rem;
        border-radius: 10px;
        flex-direction: row;
        gap: 0.75rem;
        text-align: left;
        min-height: 0;
        overflow: hidden;
    }

    .about-card-emoji {
        font-size: 1.8rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .about-card-title {
        font-size: 0.95rem;
        margin-bottom: 0.1rem;
    }

    .about-card-desc {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Success Message / Notification */
.success-message {
    background: var(--white);
    color: var(--text-dark);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid var(--success-color);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Products carousel overrides */
.products-carousel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex: 1;
    min-height: 0;
}

.products-track {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    min-height: 0;
}

.products-track::-webkit-scrollbar {
    display: none;
}

.products-track.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.products-grid {
    --product-gap: 1.5rem;
    display: flex;
    flex-wrap: nowrap;
    gap: var(--product-gap);
    width: 100%;
    margin-bottom: 0.5rem;
    height: 100%;
    align-items: stretch;
}

.products-grid .product-card {
    flex: 0 0 calc((100% - (var(--product-gap) * 3)) / 4);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100%;
}

.carousel-arrow {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--white);
    color: var(--text-dark);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carousel-arrow:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--bg-cream);
}

.carousel-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #cfc8c0;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.carousel-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

@media (max-width: 1024px) {
    .products-grid {
        --product-gap: 1rem;
    }

    .products-grid .product-card {
        flex: 0 0 calc((100% - var(--product-gap)) / 2);
    }
}

@media (max-width: 768px) {
    .products-carousel {
        gap: 0.5rem;
    }

    .carousel-arrow {
        display: flex;
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
    }

    .products-grid {
        --product-gap: 0.75rem;
    }

    .products-grid .product-card {
        flex: 0 0 100%;
    }
}

@media (max-width: 900px) {
    .products-grid {
        --product-gap: 0;
    }

    .products-grid .product-card {
        flex: 0 0 100%;
        min-width: 100%;
        max-width: 100%;
    }
}

/* Mobile products card sizing (placed late so it wins over base card styles). */
@media (max-width: 768px) {
    .products-grid .product-card .product-image-wrapper {
        aspect-ratio: auto;
        max-height: min(200px, calc(var(--app-vh, 100vh) * 0.28));
    }

    .products-grid .product-card .product-info-below {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .products-grid .product-card .product-name-section {
        padding-bottom: 0.3rem;
    }

    .products-grid .product-card .product-name {
        font-size: 0.95rem;
    }
}

/* Short viewport compaction for products section (desktop/tablet landscape + smaller laptop heights). */
@media (min-width: 769px) and (max-height: 780px) {
    .products-section {
        padding-top: 64px;
    }

    .products-section-inner .section-title {
        margin-top: 0.15rem;
        margin-bottom: 0.35rem;
        padding-bottom: 0.5rem;
    }

    .products-carousel {
        gap: 0.5rem;
        margin-bottom: 0.35rem;
    }

    .carousel-dots {
        margin-bottom: 0.35rem;
    }

    .free-delivery-banner .alert {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
    }

    .products-grid .product-card .product-info-below {
        gap: 0.45rem;
        padding: 0.75rem;
    }
}

/* Extra compaction for short mobile viewports (iOS browser chrome visible). */
@media (max-width: 768px) and (max-height: 760px) {
    .products-section {
        padding-top: 66px;
    }

    .products-section-inner .section-title {
        margin-top: 0.5rem;
        margin-bottom: 0.35rem;
    }

    .products-carousel {
        gap: 0.4rem;
        margin-bottom: 0.35rem;
    }

    .carousel-dots {
        margin-bottom: 0.35rem;
    }

    .products-grid .product-card .product-image-wrapper {
        max-height: min(160px, calc(var(--app-vh, 100vh) * 0.22));
    }

    .products-grid .product-card .product-info-below {
        padding: 0.6rem;
        gap: 0.35rem;
    }

    .products-grid .product-card .product-benefits {
        gap: 0.35rem;
        font-size: 0.66rem;
    }

    .products-grid .product-card .product-benefits li {
        margin-bottom: 0;
        font-size: 0.66rem;
    }

    .products-grid .product-card .pack-size-options {
        gap: 0.4rem;
    }

    .products-grid .product-card .pack-size-btn {
        min-width: 72px;
        padding: 0.42rem 0.55rem;
        font-size: 0.75rem;
    }

    .products-grid .product-card .qty-btn {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }

    .products-grid .product-card .qty-input {
        width: 28px;
        font-size: 0.8rem;
    }

    .products-grid .product-card .product-controls {
        padding: 0 0.6rem 0.6rem;
        gap: 0.35rem;
    }

    .products-grid .product-card .btn.btn-primary {
        font-size: 0.78rem;
        padding: 0.45rem 0.7rem;
    }
}
