/* =========================================================================
   BANSAL SNAX — STYLESHEET
   =========================================================================
   Design language: premium, organic, export-quality. Clean lines, generous
   whitespace, a forest-green + warm-mustard-gold palette on a soft cream
   background — built to read as a modern international food brand rather
   than a conventional namkeen website.

   FILE MAP (search these headings to jump around):
     1. Design tokens (colors, fonts, spacing)      -> :root
     2. Base / reset
     3. Layout helpers
     4. Header + nav
     5. Category filter pills
     6. Product grid + cards (home page)
     7. Flavour chips (color-coded by flavour)
     8. Product detail page
     9. Footer
     10. Scroll-reveal + motion (respects reduced-motion)
     11. Responsive breakpoints
   ========================================================================= */


/* -------------------------------------------------------------------------
   1. DESIGN TOKENS
   All colors, fonts and spacing are defined once here as CSS variables.
   Change a value here and it updates everywhere on the site.
   ------------------------------------------------------------------------- */
:root {
  /* --- Color palette ------------------------------------------------- */
  --forest:       #2E5D3A; /* primary brand color — buttons, links, active states */
  --forest-dark:  #234A2D; /* darker green — button hover state */
  --forest-tint:  #E7EFE7; /* very light green tint — soft backgrounds/badges */
  --mustard:      #C89A2B; /* premium accent — NEW badge, highlights, small details */
  --mustard-dark: #A87F1F; /* darker mustard for hover/emphasis */
  --cream:        #F8F5EE; /* primary page background */
  --white:        #FFFFFF; /* card backgrounds */
  --beige-line:   #EAE3D3; /* thin borders on cards */
  --charcoal:     #2C2C2C; /* headings */
  --warm-grey:    #6B6B6B; /* body text */
  --warm-grey-soft: #8C8C8C; /* muted / tertiary text */

  /* --- Typography -------------------------------------------------------
     Display: Bodoni Moda (high-contrast editorial serif — premium feel)
     Body:    Manrope (clean, modern, humanist geometric sans)
     Utility: JetBrains Mono (SKUs, eyebrows, tags — a precise spec-sheet feel) */
  --font-display: 'Bodoni Moda', 'Times New Roman', Georgia, serif;
  --font-body:    'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* --- Spacing scale ---------------------------------------------------- */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.75rem;
  --space-lg:  3rem;
  --space-xl:  5rem;

  /* --- Shape --------------------------------------------------------------
     A single consistent 16px radius across cards/panels/buttons, per the
     "premium, modern" brief — no hand-drawn irregularity in this version. */
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-soft: 0 6px 20px -8px rgba(44, 44, 44, 0.12);
  --shadow-lift: 0 16px 32px -12px rgba(44, 44, 44, 0.18);
}

/* -------------------------------------------------------------------------
   2. BASE / RESET
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--warm-grey);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  color: var(--charcoal);
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.01em;
}

p { margin: 0 0 var(--space-sm); color: var(--warm-grey); }
button { font-family: inherit; cursor: pointer; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
   3. LAYOUT HELPERS
   ------------------------------------------------------------------------- */
.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: var(--space-xs);
}
.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mustard);
}

/* Generic button style shared by the PDF button, "View Product", etc. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--forest);
  color: var(--white);
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-primary:hover { background: var(--forest-dark); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn-primary:disabled { opacity: 0.7; cursor: progress; transform: none; }

/* -------------------------------------------------------------------------
   4. HEADER + NAV
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 245, 238, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--beige-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.brand { display: flex; align-items: center; gap: 0.6rem; }

.brand-mark {
  width: 70px;
  height: 70px;
  border-radius: 0px;
  border: 0px solid var(--forest);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--forest);
  flex-shrink: 0;
  /*background: var(--forest-tint);*/
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--charcoal);
  line-height: 1.1;
}
.brand-tagline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--warm-grey-soft);
  text-transform: uppercase;
}

.site-nav { display: flex; align-items: center; gap: var(--space-md); font-size: 0.92rem; font-weight: 500; }
.site-nav a { position: relative; padding: 0.25rem 0; color: var(--charcoal); }
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--mustard);
  border-radius: 2px;
  transition: right 0.25s ease;
}
.site-nav a:hover::after { right: 0; }

/* Home-page intro strip: replaces the old hero band. Short, no imagery —
   just enough framing before the product grid, per the "remove the hero
   section" brief (the old dark banner + kadai animation are gone). */
.intro-strip {
  padding: var(--space-lg) 0 var(--space-md);
  text-align: center;
}
.intro-strip h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  max-width: 26ch;
  margin: 0 auto var(--space-sm);
}
.intro-strip p {
  max-width: 56ch;
  margin: 0 auto;
  font-size: 1.02rem;
}

/* -------------------------------------------------------------------------
   5. CATEGORY FILTER PILLS
   ------------------------------------------------------------------------- */
.filter-bar { padding: var(--space-md) 0 var(--space-sm); }
.filter-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}
.filter-pill {
  flex-shrink: 0;
  border: 1.5px solid var(--beige-line);
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.filter-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.filter-pill.active { background: var(--forest); border-color: var(--forest); color: var(--white); }

/* -------------------------------------------------------------------------
   6. PRODUCT GRID + CARDS
   Inspired by Hunter Foods' "Discover Our Bestsellers" layout — large
   image, name, short description, a clear "View Product" button — but
   built from scratch for Bansal Snax's own palette and proportions.
   ------------------------------------------------------------------------- */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.section-title h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.result-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--warm-grey-soft); }

/* 4 columns on desktop, per the brief (previously 5) — wider cards make
   room for a genuinely large product image instead of a small icon. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  padding-bottom: var(--space-xl);
}

.product-card {
  background: var(--white);
  border: 1px solid var(--beige-line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateY(18px);
  /* grid rows stretch every card in a row to equal height automatically */
}
.product-card.is-visible { opacity: 1; transform: translateY(0); }
.product-card:hover, .product-card:focus-visible { transform: translateY(-6px); box-shadow: var(--shadow-lift); }

.card-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--forest-tint);
  overflow: hidden;
}
.card-image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.product-card:hover .card-image { transform: scale(1.04); }

/* NEW badge: only rendered when a product's "isNew" field is true — see
   js/main.js buildCardHTML(). Never hardcoded per-product in markup. */
.new-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--mustard);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.card-body {
  padding: var(--space-sm) var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1; /* pushes the button to the bottom, keeping every card's button aligned */
}
.card-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mustard-dark);
  margin-bottom: 0.3rem;
}
.product-card h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.card-tagline {
  font-size: 0.88rem;
  color: var(--warm-grey);
  margin-bottom: var(--space-sm);
  /* clamp to 2-3 lines so every card's description takes the same space */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cta {
  margin-top: auto;
  width: 100%;
}

.no-results { text-align: center; padding: var(--space-xl) 0; color: var(--warm-grey); display: none; }
.no-results.is-visible { display: block; }

/* -------------------------------------------------------------------------
   7. FLAVOUR CHIPS — color-coded by flavour family
   The mapping from a flavour name (e.g. "Pudina") to one of these classes
   happens in js/main.js (see flavourChipClass()). Colors are muted,
   premium tones that stay inside the brand's overall palette rather than
   clashing neon shades.
   ------------------------------------------------------------------------- */
.flavour-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.flavour-chip--blue     { background: #E7EEF6; color: #2F5E8C; border-color: #CBDCEC; } /* Salted */
.flavour-chip--green    { background: #E7EFE7; color: #2E5D3A; border-color: #CFE0CF; } /* Pudina / Mint */
.flavour-chip--orange   { background: #FBEADB; color: #B5651D; border-color: #F3D6B7; } /* Masala / Classic Masala */
.flavour-chip--red      { background: #F8E3E1; color: #A13A2E; border-color: #EFC7C3; } /* Tomato */
.flavour-chip--yellow   { background: #FBF3D2; color: #8A6D14; border-color: #F2E4A6; } /* Lime Chilli */
.flavour-chip--purple   { background: #EEE6F3; color: #6B3F82; border-color: #DCC9E6; } /* Garlic */
.flavour-chip--brown    { background: #EFE5DA; color: #6B4A2C; border-color: #E1CFB9; } /* Hing Jeera / Dry Fruit */
.flavour-chip--pink     { background: #FBE6EE; color: #A3436B; border-color: #F2C9DA; } /* Sweet & Sour / Cranberry */
.flavour-chip--gold     { background: #F7EDD3; color: #8A6A14; border-color: #ECDBA3; } /* Navratan / Butter Tomato */
.flavour-chip--deepred  { background: #F5DEDA; color: #8C2E1F; border-color: #E9BEB6; } /* Peri Peri / Achari */
.flavour-chip--grey     { background: #EEEEEC; color: #5A5A57; border-color: #DDDDD8; } /* Plain */
.flavour-chip--forest   { background: var(--forest-tint); color: var(--forest); border-color: #D4E3D5; } /* default */

/* -------------------------------------------------------------------------
   8. PRODUCT DETAIL PAGE — kept minimal: light panels, no heavy borders,
   generous whitespace, one clean scroll (no tabs).
   ------------------------------------------------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--forest);
}
.back-link:hover { text-decoration: underline; }

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.btn-pdf-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* Image column is at least half the page width, per the brief. */
.product-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.product-gallery { display: flex; flex-direction: column; gap: 0.75rem; position: sticky; top: 90px; }

.gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--forest-tint);
  box-shadow: var(--shadow-soft);
}
.gallery-image { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-icon-frame { width: 100%; height: 100%; display: grid; place-items: center; background: var(--forest-tint); }
.gallery-icon-frame .stamp-icon { width: 40%; height: 40%; color: var(--forest); }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--forest);
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.18s ease, transform 0.18s ease;
}
.gallery-arrow:hover { background: var(--forest); color: var(--white); transform: translateY(-50%) scale(1.06); }
.gallery-arrow--prev { left: 14px; }
.gallery-arrow--next { right: 14px; }

.gallery-thumbs { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.gallery-thumb {
  width: 64px; height: 64px; padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--beige-line);
  background: var(--forest-tint);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.gallery-thumb:hover { transform: translateY(-2px); }
.gallery-thumb.active { border-color: var(--forest); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-category-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mustard-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.product-hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin: 0.3rem 0 0.5rem; }
.product-sku { font-family: var(--font-mono); font-size: 0.75rem; color: var(--warm-grey-soft); }

.badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: var(--space-sm) 0; }
.badge-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--forest-tint);
  color: var(--forest);
}

.badge-row--flavours { align-items: center; margin-top: var(--space-xs); }
.flavour-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--warm-grey-soft); margin-right: 0.3rem; }

.product-description p { font-size: 1.02rem; color: var(--charcoal); }

/* "Everything you need to know" panels — minimal: shadow only, no border,
   same radius language as the product cards. */
.detail-heading { font-size: 1.25rem; margin: var(--space-lg) 0 var(--space-md); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.detail-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: var(--space-md);
}
.detail-card-title {
  font-size: 1.05rem;
  margin-bottom: var(--space-sm);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--mustard);
  display: inline-block;
}
.nutrition-panel .detail-card-title { border-bottom-color: var(--forest); }

.info-row { padding: var(--space-xs) 0; border-bottom: 1px dashed var(--beige-line); }
.info-row:last-child { border-bottom: none; }
.info-row .info-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mustard-dark);
  display: block;
  margin-bottom: 0.2rem;
}
.info-row .info-value { font-size: 0.92rem; color: var(--charcoal); }

.nutrition-basis {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--warm-grey-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-sm);
}
.nutrition-row { display: flex; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px dashed var(--beige-line); font-size: 0.92rem; }
.nutrition-row:last-child { border-bottom: none; }
.nutrition-row--strong { font-weight: 700; color: var(--charcoal); }
.nutrition-row--indent { padding-left: 1rem; font-style: italic; color: var(--warm-grey-soft); font-size: 0.85rem; }

.related-heading { font-size: 1.3rem; margin-bottom: var(--space-sm); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-sm);
  padding-bottom: var(--space-xl);
}
.related-grid .product-card { opacity: 1; transform: none; }

/* -------------------------------------------------------------------------
   9. FOOTER
   ------------------------------------------------------------------------- */
.site-footer { background: var(--charcoal); color: #D8D5CE; padding: var(--space-lg) 0 var(--space-md); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--space-lg); }
.footer-brand .brand-name { color: var(--white); }
.footer-brand p { color: #B8B4AB; max-width: 40ch; }
.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: var(--space-sm);
}
.footer-grid a, .footer-grid p { font-size: 0.92rem; }
.footer-grid a:hover { color: var(--mustard); }
.footer-bottom {
  margin-top: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255,255,255,0.12);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #B8B4AB;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* -------------------------------------------------------------------------
   10. MOTION PREFERENCES
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product-card { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { transition-duration: 0.01ms !important; }
}

/* -------------------------------------------------------------------------
   11. RESPONSIVE BREAKPOINTS
   ------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .product-hero { grid-template-columns: 1fr; }
  .product-gallery { position: static; max-width: 420px; margin: 0 auto; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .brand-tagline { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
  .product-hero { text-align: center; }
  .product-gallery { max-width: 320px; }
  .badge-row { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr; }
}
