/* ═══════════════════════════════════════════════════════════════
   NutriZaika — interactive layer (shared across all pages)
   Progress bar · kinetic headings · nutrient vine · unmask reveals
   ═══════════════════════════════════════════════════════════════ */

/* ── Scroll progress bar — teal → gold, with a leaf tip ────────── */
.nz-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 500;
  pointer-events: none;
}
.nz-progress-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--primary, #004B49) 0%, #0a7a68 55%, var(--gold, #D4AF37) 100%);
  transform-origin: left;
  transform: scaleX(0);
  box-shadow: 0 0 8px rgba(212,175,55,.45);
}
.nz-progress-leaf {
  position: absolute; top: -5px;
  width: 14px; height: 14px;
  margin-left: -7px;
  transition: opacity .3s;
  opacity: 0;
  filter: drop-shadow(0 1px 3px rgba(0,60,50,.4));
}
.nz-progress.is-active .nz-progress-leaf { opacity: 1; }

/* ── Nav: current page indicator ───────────────────────────────── */
.nav-links a.is-current { color: var(--primary, #004B49); }
.nav-links a.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ── FAQ: rotate the + into ×, ease the answer in ──────────────── */
details > summary { cursor: pointer; }
details > summary > span:last-child {
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  display: inline-block;
}
details[open] > summary > span:last-child { transform: rotate(45deg); }
details[open] > *:not(summary) { animation: nz-faq-in .45s cubic-bezier(.16,1,.3,1) both; }
@keyframes nz-faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Tilt targets get GPU hinting ──────────────────────────────── */
.nz-tilt { will-change: transform; transform-style: preserve-3d; }

/* ── Kinetic headings: blurred word-stagger reveal ─────────────── */
.nz-heading .nz-w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.85em) rotate(1.5deg);
  filter: blur(8px);
  transition:
    opacity .55s cubic-bezier(.16,1,.3,1),
    transform .7s cubic-bezier(.16,1,.3,1),
    filter .7s cubic-bezier(.16,1,.3,1);
  will-change: transform, filter;
}
.nz-heading.is-in .nz-w {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ── Nutrient vine: scroll-drawn SVG through the process row ───── */
.nz-vine {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 48px;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.nz-vine .nz-vine-leaf {
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: transform .55s cubic-bezier(.34,1.56,.64,1);
}
.nz-vine .nz-vine-leaf.is-grown { transform: scale(1); }
.process-step .step-num { transition: opacity .5s, color .5s; }
.process-step.is-lit .step-num { opacity: .85; }
.process-step.is-lit h4 .arrow { opacity: 1; transform: translateX(0); }

/* ── Editorial unmask: photos wipe open as they enter ──────────── */
.nz-unmask {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s cubic-bezier(.16,1,.3,1);
}
.nz-unmask.is-in { clip-path: inset(0 0 0 0); }

/* ── Masala pop particles (spawned on CTA clicks) ──────────────── */
.nz-pop { position: fixed; inset: 0; pointer-events: none; z-index: 2147483000; }
.nz-pop span { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform, opacity; }

/* ── Review lightbox (tap a polaroid to read it full-size) ─────── */
.polaroid img { cursor: zoom-in; }
.nz-lightbox {
  position: fixed; inset: 0; z-index: 2147483200;
  background: rgba(10,26,24,.88);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: max(2rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
  opacity: 0; transition: opacity .25s ease;
  cursor: zoom-out;
}
.nz-lightbox.is-open { opacity: 1; }
.nz-lightbox img {
  max-width: min(92vw, 560px); max-height: 88vh;
  width: auto; height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  transform: scale(.94);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.nz-lightbox.is-open img { transform: scale(1); }
.nz-lightbox-close {
  position: absolute; top: max(1rem, env(safe-area-inset-top)); right: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.nz-lightbox-close:hover { background: rgba(255,255,255,.22); }
body.nz-lightbox-open { overflow: hidden; }

/* ── Sticky mobile action bar: Call · WhatsApp · Book ──────────── */
.nz-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 480;
  display: none;
  gap: 1px;
  background: rgba(0,40,38,.55);
  border-top: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(105%);
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.nz-actionbar.is-on { transform: translateY(0); }
.nz-actionbar a {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 52px;
  font-size: .8rem; font-weight: 600; letter-spacing: -.005em;
  color: #fff; text-decoration: none;
  background: rgba(0,75,73,.86);
}
.nz-actionbar a svg { flex-shrink: 0; }
.nz-actionbar a:active { background: rgba(0,55,53,.95); }
.nz-actionbar .nz-ab-book {
  background: linear-gradient(135deg, #DDB94B, #b99720 70%);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
@media (max-width: 700px) {
  .nz-actionbar { display: flex; }
  body.nz-bar-on { padding-bottom: calc(53px + env(safe-area-inset-bottom)); }
}

/* ── Contact form: honeypot + validation states (shared, so every
      page shows the same error styling the inline JS toggles) ────── */
.nz-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}
/* Text/textarea invalid state is already styled per-page via
   .contact-field.error; add a soft glow to reinforce it. */
.contact-field.error input,
.contact-field.error textarea {
  box-shadow: 0 0 0 3px rgba(162,91,68,.12);
}
/* Consent checkboxes flagged when unticked (pages don't style these). */
label.contact-consent.error { color: var(--clay, #A25B44); }
label.contact-consent.error input[type="checkbox"] {
  outline: 2px solid var(--clay, #A25B44);
  outline-offset: 2px;
  accent-color: var(--clay, #A25B44);
}

/* ── Laptop: with the longer PCOS/PMOS label the full nav plus two
      CTAs no longer fits under ~1200px — drop the Call button first
      (phone stays reachable via page CTAs and the mobile bar). ───── */
@media (max-width: 1200px) {
  .nav-cta .btn-outline { display: none; }
  .nav { gap: .75rem; }
}

/* ── Tablet: the 5-link nav (now with the longer PCOS/PMOS label)
      can't fit between 680–1040px, so switch to the hamburger
      earlier than the pages' own 680/700px rules. ────────────────── */
@media (max-width: 1040px) {
  .nav-links { display: none; }
  .nav-cta .btn-outline { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: block; }
}

/* ── Mobile fixes shared by every page ─────────────────────────── */
@media (max-width: 700px) {
  /* Header: subpages lack index's compact rules, so the gold CTA
     overflowed and pushed the hamburger off-screen. */
  .nav { gap: .5rem; padding: .75rem 0; }
  .brand { gap: .5rem; }
  .brand-name { font-size: 1.1rem; }
  .nav-cta .btn-outline { display: none; }
  .nav-cta .btn-gold {
    padding: .55rem .85rem;
    font-size: .72rem;
    letter-spacing: .02em;
    white-space: nowrap;
  }
  /* iOS zooms any focused field under 16px — hold the line at 16. */
  .contact-field input,
  .contact-field textarea { font-size: 16px; }
  /* Comfortable touch targets for dense link lists */
  .footer ul li a { display: inline-block; padding: .3rem 0; }
  .footer-contact-row span { padding: .15rem 0; }
  .see-more-reviews { padding: .6rem 0; }
}
@media (max-width: 390px) {
  .brand-name { font-size: 1rem; }
  .nav-cta .btn-gold { padding: .5rem .7rem; font-size: .66rem; }
}

@media (prefers-reduced-motion: reduce) {
  .nz-heading .nz-w { opacity: 1; transform: none; filter: none; transition: none; }
  .nz-unmask { clip-path: none; transition: none; }
  .nz-vine { display: none; }
  .nz-actionbar { transition: none; }
  .nz-lightbox img { transition: none; }
  details[open] > *:not(summary) { animation: none; }
}
