/* =========================================================================
   Purvi Traders — "Fresh Store" theme
   Vanilla CSS, mobile-first, CSS variables.
   ========================================================================= */

:root {
    --green:        #1E8E3E;
    --green-dark:   #166b2f;
    --green-soft:   #e8f4ec;
    --orange:       #F59E0B;
    --orange-soft:  #fff3dd;
    --wa:           #25D366;
    --wa-dark:      #1da851;
    --bg:           #FAFAF7;
    --card:         #ffffff;
    --text:         #1f2937;
    --muted:        #6b7280;
    --line:         #e7e7e0;
    --shadow:       0 4px 14px rgba(20, 40, 25, 0.06);
    --shadow-lg:    0 12px 30px rgba(20, 40, 25, 0.12);
    --radius:       12px;
    --maxw:         1180px;
    --font-head:    'Poppins', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; color: var(--text); }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

.section { padding: 56px 0; }
.section-tight { padding: 40px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow { color: var(--green); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-head); font-weight: 600; font-size: .95rem;
    padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn-outline:hover { background: var(--green-soft); color: var(--green-dark); }
.btn-whatsapp { background: var(--wa); color: #fff; }
.btn-whatsapp:hover { background: var(--wa-dark); color: #fff; }
.btn-disabled { background: #eee; color: #999; cursor: not-allowed; width: 100%; }
.btn-buy { width: 100%; }
.wa-icon { flex: 0 0 auto; }

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.navbar { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: var(--font-head); font-weight: 700; letter-spacing: .04em; color: var(--green); font-size: 1.15rem; }
.brand-name span { color: var(--orange); }

.nav { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text); font-weight: 500; font-family: var(--font-head); font-size: .95rem; padding: 6px 2px; position: relative; }
.nav-links a:hover { color: var(--green); text-decoration: none; }
.nav-links a.active { color: var(--green); }
.nav-links a.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--green); border-radius: 2px;
}
.nav-cta { padding: 9px 16px; font-size: .9rem; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--text); border-radius: 2px; transition: .25s; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(30,142,62,.10), transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(245,158,11,.12), transparent 42%),
        linear-gradient(160deg, #f3faf4 0%, #fafaf7 60%);
}
.hero::before {
    /* subtle grocery dot pattern */
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(30,142,62,.10) 1.4px, transparent 1.6px);
    background-size: 26px 26px; opacity: .5; pointer-events: none;
}
.hero-inner { position: relative; padding: 66px 0 74px; max-width: 720px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: .35em; }
.hero h1 .accent { color: var(--green); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.18rem); color: var(--muted); margin: 0 0 26px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; color: var(--muted); font-size: .9rem; }
.hero-badges span { display: inline-flex; align-items: center; gap: 6px; }
.hero-badges b { color: var(--green); }

/* ---------- Category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cat-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 16px; text-align: center; box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    color: var(--text);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--green); text-decoration: none; }
.cat-ic {
    width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 14px;
    display: grid; place-items: center; background: var(--green-soft); color: var(--green);
}
.cat-ic svg { width: 30px; height: 30px; }
.cat-card h3 { font-size: 1rem; margin: 0; }

/* ---------- Products ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.product-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.product-media { position: relative; background: #f6f7f2; aspect-ratio: 1/1; }
.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.badge {
    position: absolute; top: 10px; font-family: var(--font-head); font-weight: 600;
    font-size: .72rem; padding: 4px 9px; border-radius: 999px; z-index: 2;
}
.badge-discount { left: 10px; background: var(--orange); color: #fff; }
.badge-oos { right: 10px; background: #6b7280; color: #fff; }
.product-body { padding: 14px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.product-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--green); font-weight: 600; margin: 0; }
.product-name { font-size: .98rem; margin: 0; line-height: 1.3; }
.product-pack { font-size: .82rem; color: var(--muted); margin: 0 0 6px; }
.product-price { display: flex; align-items: baseline; gap: 8px; margin: auto 0 12px; }
.price-now { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--text); }
.price-mrp { font-size: .88rem; color: var(--muted); text-decoration: line-through; }
.product-card.out-of-stock { opacity: .72; }
.product-card.out-of-stock .product-media img { filter: grayscale(.6); }

/* ---------- Filter bar (products page) ---------- */
.filter-bar {
    position: sticky; top: 66px; z-index: 30; background: var(--bg);
    padding: 14px 0; border-bottom: 1px solid var(--line);
}
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
#searchInput {
    width: 100%; padding: 12px 14px 12px 42px; border: 1.5px solid var(--line); border-radius: 999px;
    font-family: var(--font-body); font-size: .95rem; background: #fff; transition: border-color .15s;
}
#searchInput:focus { outline: none; border-color: var(--green); }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.cat-tab {
    flex: 0 0 auto; padding: 8px 15px; border-radius: 999px; border: 1.5px solid var(--line);
    background: #fff; color: var(--text); font-family: var(--font-head); font-weight: 500; font-size: .88rem;
    cursor: pointer; white-space: nowrap; transition: .15s;
}
.cat-tab:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.cat-tab.active { background: var(--green); border-color: var(--green); color: #fff; }
.result-count { color: var(--muted); font-size: .9rem; margin: 18px 0; }
.no-results { text-align: center; color: var(--muted); padding: 50px 0; display: none; }

/* ---------- Why-shop strip ---------- */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.why-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); }
.why-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--orange-soft); color: var(--orange); display: grid; place-items: center; margin-bottom: 12px; }
.why-ic svg { width: 26px; height: 26px; }
.why-card h3 { font-size: 1.02rem; margin: 0 0 4px; }
.why-card p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Store info strip ---------- */
.info-strip { background: var(--green); color: #fff; border-radius: 16px; padding: 26px; }
.info-strip .container { padding: 0; }
.info-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.info-item { display: flex; gap: 12px; align-items: flex-start; }
.info-item svg { flex: 0 0 auto; opacity: .9; }
.info-item h4 { margin: 0 0 2px; font-size: 1rem; color: #fff; }
.info-item p, .info-item a { margin: 0; color: rgba(255,255,255,.9); font-size: .92rem; }
.info-item a:hover { color: #fff; }

/* ---------- Featured CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; border-radius: 18px; padding: 40px 26px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.92); max-width: 560px; margin: 0 auto 22px; }

/* ---------- Generic content pages ---------- */
.page-hero { background: var(--green-soft); padding: 46px 0; text-align: center; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .2em; }
.page-hero p { color: var(--muted); max-width: 620px; margin: 0 auto; }
.prose { max-width: 760px; margin: 0 auto; }
.prose p { color: var(--muted); margin: 0 0 1em; }

.about-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.photo-ph {
    background: repeating-linear-gradient(45deg, #eef3ea, #eef3ea 12px, #e6efe1 12px, #e6efe1 24px);
    border: 1px dashed var(--green); border-radius: var(--radius); aspect-ratio: 4/3;
    display: grid; place-items: center; color: var(--green); font-family: var(--font-head); font-weight: 600;
}
.about-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.about-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.values-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.value-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.value-card .why-ic { background: var(--green-soft); color: var(--green); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .ci { width: 42px; height: 42px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: 0 0 auto; }
.contact-list strong { display: block; font-family: var(--font-head); }
.contact-list a, .contact-list span.val { color: var(--muted); }
.map-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.map-embed iframe { width: 100%; height: 340px; border: 0; display: block; }

.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.hours-table th { font-family: var(--font-head); }
.hours-table .open { color: var(--green); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: #16261b; color: #cdd6ce; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 46px 0 34px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; color: #fff; letter-spacing: .04em; margin-bottom: 12px; }
.footer-blurb { margin: 0; font-size: .92rem; color: #a9b6ac; max-width: 340px; }
.footer-col h3 { color: #fff; font-size: 1.02rem; margin: 0 0 14px; }
.footer-links, .footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: #cdd6ce; font-size: .92rem; }
.footer-links a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 10px; font-size: .9rem; color: #a9b6ac; align-items: flex-start; }
.footer-contact a { color: #cdd6ce; }
.footer-contact a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0; font-size: .85rem; color: #8a978c; text-align: center; }

/* ---------- Floating WhatsApp ---------- */
.wa-float {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #fff;
    display: grid; place-items: center; box-shadow: 0 8px 22px rgba(37,211,102,.45);
    transition: transform .18s ease;
}
.wa-float:hover { transform: scale(1.08); text-decoration: none; }
.wa-float svg { width: 30px; height: 30px; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .why-grid { grid-template-columns: repeat(2, 1fr); }
    .info-grid { grid-template-columns: repeat(3, 1fr); }
    .values-grid { grid-template-columns: repeat(3, 1fr); }
    .contact-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
    .cat-grid { grid-template-columns: repeat(6, 1fr); }
    .why-grid { grid-template-columns: repeat(4, 1fr); }
    .about-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile nav */
@media (max-width: 820px) {
    .nav-toggle { display: flex; }
    .nav {
        position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch;
        background: #fff; border-bottom: 1px solid var(--line); padding: 16px 18px 22px; gap: 14px;
        transform: translateY(-140%); transition: transform .28s ease; box-shadow: var(--shadow-lg);
    }
    .nav.open { transform: translateY(0); }
    .nav-links { flex-direction: column; gap: 4px; }
    .nav-links a { padding: 10px 4px; border-bottom: 1px solid var(--line); }
    .nav-links a.active::after { display: none; }
    .nav-cta { align-self: flex-start; }
    .nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    .nav-toggle.open span:nth-child(2) { opacity: 0; }
    .nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
