/* ==========================================================
   Nutri Kai — Stylesheet
   Mobile-first. Breakpoints at 700px (tablet) and 1080px (desktop).
   ========================================================== */

:root {
  --color-bg: #F6F2E7;
  --color-bg-alt: #EAE6D6;
  --color-ink: #2B2620;
  --color-ink-soft: #5B5647;
  --color-forest: #33402A;
  --color-forest-dark: #262F1F;
  --color-gold: #B98B2E;
  --color-line: #D8D0BC;
  --color-card: #FBF9F2;

  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1180px;
  --radius-s: 3px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}
p { margin: 0 0 1em; color: var(--color-ink-soft); max-width: 62ch; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--color-forest); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-forest); color: #fff;
  padding: 0.75em 1.25em; z-index: 200;
}
.skip-link:focus { left: 0; }

section { padding: 3.25rem 0; }
.section-head { max-width: var(--container); margin: 0 auto 1.75rem; padding: 0 1rem; }
.section-head h2 { font-size: 1.7rem; }
.section-head p { font-size: 1rem; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0.8em 1.5em;
  font-size: 0.98rem; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius-s);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--color-forest); color: #FBF9F2; }
.btn-primary:hover { background: var(--color-forest-dark); }
.btn-primary:disabled { background: var(--color-line); color: var(--color-ink-soft); cursor: not-allowed; }
.btn-text { background: transparent; color: var(--color-forest); border-color: var(--color-forest); }
.btn-text:hover { background: var(--color-forest); color: #FBF9F2; }
.btn-block { width: 100%; }

/* ==========================================================
   HEADER
   ========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}
.header-inner {
  max-width: var(--container); margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; }
.brand-mark { display: block; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.01em; }

.main-nav {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
  display: flex; flex-direction: column;
  padding: 0 1rem;
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease;
}
.main-nav.is-open { max-height: 280px; padding-bottom: 0.5rem; }
.main-nav a { padding: 0.9rem 0; font-size: 1.02rem; border-bottom: 1px solid var(--color-line); }
.main-nav a:last-child { border-bottom: none; }

.header-actions { display: flex; align-items: center; gap: 0.2rem; }
.icon-btn {
  background: none; border: none; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: var(--color-forest);
}
.cart-count {
  position: absolute; top: 3px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  background: var(--color-gold); color: #FBF9F2;
  font-size: 0.65rem; font-weight: 700; line-height: 17px; text-align: center;
}
.cart-count[data-empty="true"] { display: none; }

.nav-toggle { flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--color-forest); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================
   HERO
   ========================================================== */
.hero { padding: 1.25rem 0 2.5rem; }
.hero-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 1rem;
  display: flex; flex-direction: column-reverse; gap: 1.5rem;
}
.hero-copy h1 { font-size: 2rem; max-width: 14ch; margin-bottom: 0.35em; }
.hero-tagline {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.1rem; color: var(--color-forest); margin-bottom: 0.9rem;
}
.hero-lede { font-size: 1rem; max-width: 48ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.4rem 0 1.8rem; }
.hero-actions .btn { flex: 1 1 auto; }
.hero-facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
  border-top: 1px solid var(--color-line); padding-top: 1.2rem; max-width: 34rem; margin: 0;
}
.hero-facts dt { font-size: 0.74rem; color: var(--color-ink-soft); margin-bottom: 0.2rem; }
.hero-facts dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.hero-visual { width: 100%; }

.product-carousel {
  position: relative; width: 100%; overflow: hidden;
  border: 1px solid var(--color-line); background: var(--color-card);
  touch-action: pan-y;
}
.carousel-track { position: relative; aspect-ratio: 1 / 1; }
.carousel-slide {
  position: absolute; inset: 0; opacity: 0; transform: scale(1.025);
  transition: opacity 0.55s ease, transform 0.8s ease; pointer-events: none;
}
.carousel-slide.is-active { opacity: 1; transform: scale(1); }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-dots {
  position: absolute; left: 50%; bottom: 0.8rem; transform: translateX(-50%);
  display: flex; gap: 0.5rem; padding: 0.5rem 0.7rem;
  background: rgba(251, 249, 242, 0.88); border: 1px solid var(--color-line);
}
.carousel-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: var(--color-line); }
.carousel-dot.is-active { background: var(--color-forest); }

/* ==========================================================
   SHOP / PRODUCTS  (2 per row on phones)
   ========================================================== */
.shop { background: var(--color-bg-alt); }
.product-grid {
  max-width: var(--container); margin: 0 auto; padding: 0 0.75rem;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem;
}
.product-card { background: var(--color-card); border: 1px solid var(--color-line); display: flex; flex-direction: column; }
.product-image { aspect-ratio: 1 / 1; overflow: hidden; border-bottom: 1px solid var(--color-line); background: var(--color-bg-alt); }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: rgba(51,64,42,0.05); }

.product-body { padding: 0.75rem; display: flex; flex-direction: column; flex: 1; }
.product-heading { display: flex; flex-direction: column; gap: 0.1rem; }
.product-heading h3 { font-size: 1rem; margin: 0; }
.product-pack { font-size: 0.76rem; color: var(--color-ink-soft); }

.product-desc {
  font-size: 0.8rem; line-height: 1.5; margin: 0.45rem 0 0.2rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.product-card.is-expanded .product-desc { display: block; -webkit-line-clamp: unset; }
.product-more {
  align-self: flex-start; background: none; border: none; padding: 0.25rem 0;
  margin-bottom: 0.5rem; font-size: 0.78rem; font-weight: 600;
  color: var(--color-forest); text-decoration: underline;
}

.product-footer { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; margin-bottom: 0.6rem; }
.product-price { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--color-forest); }
.qty-stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--color-line); border-radius: var(--radius-s); }
.qty-btn { background: none; border: none; width: 42px; height: 40px; font-size: 1.1rem; color: var(--color-forest); }
.qty-value { flex: 1; text-align: center; font-size: 0.95rem; font-weight: 600; }

.btn-add {
  width: 100%; min-height: 44px; padding: 0.6em 0.5em;
  background: var(--color-forest); color: #FBF9F2;
  border: none; border-radius: var(--radius-s);
  font-size: 0.9rem; font-weight: 600;
  transition: background-color 0.15s ease;
}
.btn-add:hover { background: var(--color-forest-dark); }
.btn-add:disabled:not(.is-added) { background: var(--color-line); color: var(--color-ink-soft); cursor: not-allowed; }
.btn-add.is-added, .btn-add.is-added:hover { background: #D7D8D2; color: #56584F; cursor: default; }

/* ==========================================================
   STORY
   ========================================================== */
.story-inner { max-width: var(--container); margin: 0 auto; padding: 0 1rem; display: flex; flex-direction: column; gap: 2rem; }
.story-visual { max-width: 160px; margin: 0 auto; }
.story-copy h2 { font-size: 1.7rem; max-width: 20ch; }
.story-copy p { font-size: 1rem; }
.story-list { font-family: var(--font-display); font-style: italic; font-size: 1.08rem !important; color: var(--color-ink); line-height: 1.7; }
.story-close { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem !important; color: var(--color-forest); }

/* ==========================================================
   QUALITY
   ========================================================== */
.quality-list {
  max-width: var(--container); margin: 0 auto; padding: 0 1rem;
  display: grid; grid-template-columns: 1fr; gap: 0;
  border-top: 1px solid var(--color-line);
}
.quality-item { display: flex; gap: 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--color-line); }
.quality-item svg { flex-shrink: 0; margin-top: 0.15rem; }
.quality-item h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.quality-item p { font-size: 0.92rem; margin: 0; }
.fssai-logo { height: 40px; width: auto; margin-top: 0.8rem; }

/* ==========================================================
   CONTACT
   ========================================================== */
.contact { background: var(--color-bg-alt); }
.contact-inner { max-width: var(--container); margin: 0 auto; padding: 0 1rem; display: flex; flex-direction: column; gap: 2rem; }
.contact-copy h2 { font-size: 1.7rem; }
.contact-copy .btn { width: 100%; }
.contact-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 0;
  border-top: 1px solid var(--color-line); padding-top: 1.4rem;
}
.contact-details dt { font-size: 0.78rem; color: var(--color-ink-soft); margin-bottom: 0.2rem; }
.contact-details dd { margin: 0; font-weight: 600; font-size: 0.95rem; }
.contact-details a:hover { color: var(--color-forest); }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer { background: var(--color-forest); color: #E8E4D6; padding-bottom: 5rem; }
.footer-inner {
  max-width: var(--container); margin: 0 auto; padding: 2.5rem 1rem 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem 1rem;
}
.footer-brand { grid-column: 1 / -1; }
.site-footer .brand-name, .site-footer .brand-mark { filter: brightness(0) invert(1); }
.footer-brand p { color: #C7C3B2; font-size: 0.92rem; margin-top: 0.75rem; max-width: 32ch; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.85rem; color: #E8E4D6; margin: 0 0 0.6rem; font-weight: 600; }
.footer-col a { display: block; color: #C7C3B2; font-size: 0.92rem; padding: 0.4rem 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(232,228,214,0.15);
  padding: 1.25rem 1rem; max-width: var(--container); margin: 0 auto;
  font-size: 0.8rem; color: #9C9885;
}
.footer-bottom p { color: #9C9885; margin: 0 0 0.2rem; }
.footer-legal { display: flex; align-items: center; gap: 0.9rem; }
.fssai-badge { height: 40px; width: auto; background: #fff; padding: 4px 8px; border-radius: 4px; flex-shrink: 0; }

/* ==========================================================
   MOBILE CART BAR
   ========================================================== */
.cart-bar {
  position: fixed; left: 0.75rem; right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0.7rem 1.1rem;
  background: var(--color-forest); color: #FBF9F2;
  border: none; border-radius: 6px;
  font-size: 0.95rem; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}
.cart-bar-cta { color: #F0D9A0; }

/* ==========================================================
   CART DRAWER
   ========================================================== */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(43, 38, 32, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 150;
}
.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: 0;
  height: 100%; height: 100dvh; width: 100%; max-width: 420px;
  background: var(--color-bg); z-index: 160;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.25s ease;
  box-shadow: -4px 0 18px rgba(0,0,0,0.08);
}
.cart-drawer.is-open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--color-line);
}
.cart-title-wrap { flex: 1; min-width: 0; }
.cart-header h2 { margin: 0; font-size: 1.25rem; }
.cart-step-label { font-size: 0.76rem; color: var(--color-ink-soft); }
.cart-back, .cart-close {
  background: none; border: none; width: 40px; height: 40px;
  font-size: 1.5rem; line-height: 1; color: var(--color-ink);
}
.cart-back { margin-left: -0.5rem; color: var(--color-forest); }

.cart-step { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 0.5rem 1rem; -webkit-overflow-scrolling: touch; }
.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--color-ink-soft); }
.cart-empty a { color: var(--color-forest); font-weight: 600; text-decoration: underline; }

.cart-line { display: flex; gap: 0.8rem; padding: 1rem 0; border-bottom: 1px solid var(--color-line); }
.cart-line-thumb { width: 60px; height: 60px; flex-shrink: 0; background: var(--color-bg-alt); overflow: hidden; border: 1px solid var(--color-line); }
.cart-line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.cart-line-name { font-size: 0.95rem; font-weight: 600; }
.cart-line-pack { font-size: 0.78rem; color: var(--color-ink-soft); }
.cart-line-remove { background: none; border: none; color: var(--color-ink-soft); font-size: 0.8rem; text-decoration: underline; padding: 0.3rem 0; }
.cart-line-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.cart-line-price { font-weight: 600; font-family: var(--font-display); }
.cart-line .qty-stepper { justify-content: flex-start; }
.cart-line .qty-btn { width: 40px; }
.cart-line .qty-value { flex: none; min-width: 28px; }

.cart-summary {
  padding: 1rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-line); background: var(--color-bg);
}
.cart-total-row { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 700; font-family: var(--font-display); margin-bottom: 0.6rem; }
.cart-note { font-size: 0.8rem; margin-bottom: 0.9rem; }

/* Step 2 */
.order-recap { margin: 0.5rem 0 1.4rem; padding: 0.4rem 0 0.6rem; border-bottom: 1px solid var(--color-line); }
.order-recap li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; font-size: 0.9rem; color: var(--color-ink-soft); }
.order-recap li span:last-child { color: var(--color-ink); font-weight: 600; white-space: nowrap; }

.checkout-form { display: grid; gap: 0.45rem; margin-bottom: 1rem; }
.checkout-form label { font-size: 0.85rem; font-weight: 600; }
.checkout-form label span { color: var(--color-gold); }
.checkout-form input, .checkout-form textarea {
  width: 100%; border: 1px solid var(--color-line); border-radius: var(--radius-s);
  background: var(--color-card); color: var(--color-ink);
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  padding: 0.8rem; outline: none; resize: vertical; margin-bottom: 0.6rem;
}
.checkout-form input:focus, .checkout-form textarea:focus { border-color: var(--color-forest); box-shadow: 0 0 0 2px rgba(51, 64, 42, 0.08); }
.checkout-error { min-height: 1.2em; margin: 0; color: #9B3B2E; font-size: 0.8rem; }

/* ==========================================================
   TABLET — 700px
   ========================================================== */
@media (min-width: 700px) {
  section { padding: 4.5rem 0; }
  .section-head, .hero-inner, .story-inner, .contact-inner, .quality-list { padding-left: 1.25rem; padding-right: 1.25rem; }
  .section-head { margin-bottom: 2.5rem; }
  .section-head h2 { font-size: 1.9rem; }
  .hero { padding: 3rem 0 3.5rem; }
  .hero-copy h1 { font-size: 2.8rem; }
  .hero-visual { max-width: 520px; margin: 0 auto; }
  .hero-actions .btn { flex: none; }
  .hero-actions { margin: 1.6rem 0 2.2rem; }

  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; padding: 0 1.25rem; }
  .product-card:hover .product-image img { transform: scale(1.04); }
  .product-body { padding: 1.15rem 1.25rem 1.35rem; }
  .product-heading { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
  .product-heading h3 { font-size: 1.12rem; }
  .product-desc { display: block; -webkit-line-clamp: unset; font-size: 0.92rem; margin: 0.5rem 0 1rem; }
  .product-more { display: none; }
  .product-footer { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
  .qty-stepper { justify-content: flex-start; }
  .qty-btn { width: 40px; }
  .qty-value { flex: none; min-width: 26px; }
  .btn-add { padding: 0.7em 1em; font-size: 0.92rem; }

  .quality-list { grid-template-columns: 1fr 1fr; }
  .quality-item:nth-last-child(1), .quality-item:nth-last-child(2) { border-bottom: none; }
  .story-visual { max-width: 220px; }
  .contact-copy .btn { width: auto; }
  .footer-inner { grid-template-columns: repeat(3, 1fr); }
  .site-footer { padding-bottom: 0; }
  .cart-bar { display: none; }
}

/* ==========================================================
   DESKTOP — 1080px
   ========================================================== */
@media (min-width: 1080px) {
  .header-inner { padding: 1.1rem 1.25rem; }
  .main-nav {
    position: static; flex-direction: row; max-height: none; overflow: visible;
    background: none; border: none; padding: 0; gap: 2rem;
  }
  .main-nav a { border-bottom: none; padding: 0; font-size: 0.98rem; }
  .main-nav a:hover { color: var(--color-forest); }
  .nav-toggle { display: none; }

  .hero-inner { flex-direction: row; align-items: center; padding-top: 1rem; }
  .hero-copy { flex: 1; }
  .hero-copy h1 { font-size: 3.2rem; max-width: 12ch; }
  .hero-visual { flex: 1; max-width: 460px; margin: 0; }

  .story-inner { flex-direction: row; align-items: center; gap: 4rem; }
  .story-visual { flex: 0 0 260px; max-width: 260px; margin: 0; }
  .story-copy { flex: 1; }

  .contact-inner { flex-direction: row; justify-content: space-between; }
  .contact-copy { flex: 1; max-width: 30rem; }
  .contact-details { flex: 1; max-width: 26rem; border-top: none; padding-top: 0; align-self: center; }

  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
