:root {
    --green-deep: #1b6b34;
    --green-light: #2e8b46;
    --green-pale: #eaf6ec;
    --accent-orange: #f5821f;
    --text-dark: #1a1a1a;
    --text-muted: #6b7280;
    --bg-neutral: #fafaf7;
    --white: #ffffff;
    --border: #e5e7eb;
    --radius: 10px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
    --max-width: 1200px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-dark);
    background: var(--bg-neutral);
    padding-bottom: 64px; /* space for mobile bottom nav */
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
    border: none;
}
.btn-primary { background: var(--accent-orange); color: var(--white); }
.btn-secondary { background: var(--green-deep); color: var(--white); }

/* ---------- Header ---------- */
.announce-bar {
    background: var(--green-deep);
    color: var(--white);
    font-size: 12px;
    padding: 6px 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.announce-phone { color: var(--white); font-weight: 600; margin-left: auto; }
.announce-sep { opacity: 0.6; }

.main-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 4px; font-weight: 800; }
.brand-mark { color: var(--accent-orange); font-size: 22px; }
.brand-word { color: var(--green-deep); font-size: 20px; letter-spacing: 0.5px; }

.search-form {
    flex: 1 1 220px;
    display: flex;
    order: 3;
}
.search-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
}
.search-form button {
    background: var(--green-deep);
    border: none;
    color: var(--white);
    padding: 0 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.location-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: none;
    border: none;
    line-height: 1.2;
}
.location-label { font-size: 11px; color: var(--text-muted); }
.location-value { font-size: 13px; font-weight: 600; }

.header-icon-link {
    font-size: 13px;
    font-weight: 600;
    position: relative;
    padding: 4px 6px;
}
.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent-orange);
    color: var(--white);
    border-radius: 999px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.category-nav {
    display: none;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    gap: 20px;
    overflow-x: auto;
}
.category-nav a { padding: 10px 0; font-size: 13px; font-weight: 600; white-space: nowrap; }
.category-nav a.active { color: var(--green-deep); border-bottom: 2px solid var(--green-deep); }

/* ---------- Mobile bottom nav ---------- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 50;
}
.mobile-bottom-nav a {
    flex: 1;
    text-align: center;
    font-size: 11px;
    padding: 8px 0 6px;
    color: var(--text-muted);
    position: relative;
}
.mobile-bottom-nav a.active { color: var(--green-deep); }
.mobile-bottom-nav .icon { display: block; font-size: 18px; margin-bottom: 2px; }
.mobile-bottom-nav .cart-badge { top: 2px; right: 22%; }

/* ---------- Hero ---------- */
.hero {
    padding: 56px 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 320px;
    justify-content: center;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,73,35,0.82) 0%, rgba(27,107,52,0.55) 70%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 600px; }
.hero-copy-dark h1 { color: #ffffff; }
.hero-copy-dark p  { color: rgba(255,255,255,0.88); }
.hero-copy h1 { font-size: 28px; line-height: 1.15; margin: 0 0 10px; color: var(--text-dark); }
.hero-copy p  { color: var(--text-muted); margin: 0 0 16px; font-size: 14px; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.trust-strip { list-style: none; padding: 0; margin: 0; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #a8e6bc; font-weight: 600; }
.hero-image img { border-radius: var(--radius); }

/* ---------- Sections ---------- */
.section { padding: 24px 16px; max-width: var(--max-width); margin: 0 auto; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.section-heading h2 { font-size: 18px; margin: 0; }
.view-all { font-size: 13px; color: var(--green-deep); font-weight: 600; }

.category-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.category-pill { flex: 0 0 auto; text-align: center; width: 78px; }
.category-pill-image {
    width: 72px; height: 72px; border-radius: 50%;
    overflow: hidden; background: var(--green-pale);
    margin: 0 auto 6px; display: flex; align-items: center; justify-content: center;
}
.category-pill span:last-child { font-size: 11px; font-weight: 600; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    position: relative;
    box-shadow: var(--shadow-card);
}
.discount-badge {
    position: absolute; top: 8px; left: 8px;
    background: var(--accent-orange); color: var(--white);
    font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.product-card-image { display: block; aspect-ratio: 1 / 1; background: var(--green-pale); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.product-card-name { font-size: 13px; font-weight: 600; display: block; margin-bottom: 2px; }
.product-card-unit { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.product-card-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.price-current { font-weight: 700; font-size: 14px; }
.price-strike { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }

.btn-add {
    width: 100%;
    background: var(--green-deep);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 8px 0;
    font-weight: 700;
    font-size: 13px;
}
.qty-stepper {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--green-deep); border-radius: 6px; color: var(--white);
}
.qty-btn { background: none; border: none; color: var(--white); font-size: 16px; padding: 6px 12px; font-weight: 700; }
.qty-value { font-weight: 700; font-size: 13px; }

/* ---------- Promo banner ---------- */
.promo-banner {
    background: var(--green-pale);
    margin: 24px 16px;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.promo-copy h2 { margin: 0 0 8px; font-size: 20px; }
.promo-copy p { color: var(--text-muted); font-size: 14px; margin: 0 0 14px; }
.promo-image img { border-radius: var(--radius); }

/* ---------- Why choose ---------- */
.why-choose h2 { text-align: center; font-size: 20px; margin-bottom: 20px; }
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.why-item { text-align: center; }
.why-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.why-item h3 { font-size: 14px; margin: 0 0 4px; }
.why-item p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: #0f4923; color: rgba(255,255,255,0.85); padding: 32px 16px 16px; margin-top: 24px; }
.footer-grid { display: grid; gap: 24px; max-width: var(--max-width); margin: 0 auto; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { color: var(--white); font-size: 13px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a, .footer-col span { font-size: 13px; color: rgba(255,255,255,0.75); }
.footer-brand .brand-word, .footer-brand .brand-mark { color: var(--white); }
.footer-bottom {
    max-width: var(--max-width); margin: 20px auto 0; padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    display: flex; flex-direction: column; gap: 4px;
    font-size: 12px; color: rgba(255,255,255,0.6);
}
.footer-built-by {
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.2px;
}
.damerax-link {
    color: #f5c842;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
}
.damerax-link:hover { color: #ffd966; text-decoration: underline; }

/* ---------- Legal / Static Pages ---------- */
.legal-page { padding: 24px 16px 48px; }
.legal-wrap {
    max-width: 820px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px 28px;
}
.legal-wrap h1 {
    font-size: 26px;
    color: var(--green-deep);
    margin: 0 0 4px;
    border-bottom: 3px solid var(--green-pale);
    padding-bottom: 12px;
}
.legal-updated { font-size: 12px; color: var(--text-muted); margin: 0 0 24px; }
.legal-wrap h2 { font-size: 16px; color: var(--green-deep); margin: 28px 0 10px; }
.legal-wrap p  { font-size: 14px; line-height: 1.75; color: #374151; margin: 0 0 12px; }
.legal-wrap ul { padding-left: 20px; margin: 0 0 14px; }
.legal-wrap ul li { font-size: 14px; line-height: 1.75; color: #374151; margin-bottom: 6px; }
.legal-wrap a  { color: var(--green-deep); font-weight: 600; }
.legal-wrap a:hover { text-decoration: underline; }

.legal-notice {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    margin: 20px 0 28px;
    font-size: 13px;
    line-height: 1.7;
    color: #78350f;
}
.legal-notice strong { color: #92400e; }

/* Delivery highlight box */
.delivery-highlight {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--green-pale);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 20px 0 28px;
}
.delivery-icon { font-size: 28px; flex-shrink: 0; }
.delivery-highlight strong { display: block; font-size: 15px; color: var(--green-deep); margin-bottom: 4px; }
.delivery-highlight p { margin: 0; font-size: 13px; color: #374151; }

/* Contact page grid */
.contact-grid {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}
.contact-card {
    background: var(--bg-neutral);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 20px;
}
.contact-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.contact-card h3 { font-size: 15px; margin: 0 0 6px; color: var(--green-deep); }
.contact-card p  { font-size: 13px; color: #374151; margin: 0 0 10px; line-height: 1.6; }
.contact-action {
    display: inline-block;
    background: var(--green-deep);
    color: var(--white) !important;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    margin-right: 8px;
    text-decoration: none !important;
}
.contact-action:hover { background: var(--green-light); }
.contact-wa { background: #25d366 !important; }
.contact-wa:hover { background: #128c4a !important; }
.contact-hours { font-size: 12px; color: var(--text-muted); margin-top: 8px !important; }

@media (min-width: 640px) {
    .contact-grid { grid-template-columns: repeat(3, 1fr); }
    .legal-wrap { padding: 40px 48px; }
}

/* ---------- Cart / Checkout ---------- */

.cart-page, .checkout-page { max-width: 700px; margin: 0 auto; padding: 16px; }
.cart-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item-image { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--green-pale); flex-shrink: 0; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-unit { font-size: 12px; color: var(--text-muted); }
.cart-summary { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.summary-row.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }

.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.form-error { background: #fdecec; color: #b3261e; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.address-option { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
    body { padding-bottom: 0; }
    .mobile-bottom-nav { display: none; }
    .category-nav { display: flex; }
    .main-header { padding: 14px 32px; }
    .search-form { order: 0; flex: 1 1 400px; }
    .hero { flex-direction: row; align-items: center; padding: 48px 32px; gap: 32px; }
    .hero-copy { flex: 1; }
    .hero-copy h1 { font-size: 40px; }
    .hero-image { flex: 1; }
    .section { padding: 40px 32px; }
    .product-grid { grid-template-columns: repeat(4, 1fr); }
    .promo-banner { flex-direction: row; align-items: center; margin: 32px; padding: 40px; }
    .why-grid { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

/* ============================================================
   PWA Install Popup / Banner
   - Mobile: slides up from the bottom (full-width)
   - Desktop (>=600px): centred floating card
   ============================================================ */
#pwa-install-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 3px solid var(--green-deep);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.14);
    border-radius: 18px 18px 0 0;
    padding: 20px 20px 28px;
    animation: pwaSlideUp 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
#pwa-install-popup.pwa-visible {
    display: block;
}
@keyframes pwaSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.pwa-popup-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}
.pwa-popup-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
}
.pwa-popup-text {
    flex: 1;
}
.pwa-popup-text strong {
    display: block;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 3px;
}
.pwa-popup-text span {
    font-size: 12px;
    color: var(--text-muted);
}
.pwa-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
#pwa-install-btn {
    flex: 1;
    padding: 11px 0;
    background: var(--green-deep);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
}
#pwa-install-btn:hover { background: var(--green-light); }
#pwa-dismiss-btn {
    padding: 11px 16px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}
#pwa-dismiss-btn:hover { background: var(--bg-neutral); }

@media (min-width: 600px) {
    #pwa-install-popup {
        bottom: 24px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 380px;
        border-radius: 16px;
        border-top: none;
        border: 2px solid var(--green-deep);
        animation: pwaFadeIn 0.3s ease both;
    }
    @keyframes pwaFadeIn {
        from { opacity: 0; transform: translateX(-50%) translateY(16px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
}

