/* =========================================================
   Home page specific styles
   ========================================================= */

/* Why choose us strip */
.why-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.why-item {
  text-align: center;
}

.why-icon {
  width: 95px;
  height: 95px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.why-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.why-item h3 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
}

/* Story / mission alternating rows */
.story-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
}

.story-row + .story-row {
  margin-top: 20px;
}

/* Keep the three editorial blocks (story, mission and family trust) at
   one consistent 20px desktop separation. */
#why-choose + .section {
  padding-bottom: 20px;
}

#family-trust {
  padding-top: 0;
}

.story-row.reverse .story-media {
  order: 2;
}

.story-media img {
  border-radius: var(--radius-lg);
  width: 100%;
  height: 460px;
  object-fit: cover;
}

.story-text p {
  font-size: 17px;
  color: #333;
  margin-top: 18px;
}

.story-text ul {
  margin-top: 18px;
}

.story-text ul li {
  font-size: 17px;
  color: #333;
  padding-left: 26px;
  position: relative;
  margin-bottom: 10px;
}

.story-text ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-mid);
}

.story-text ul li strong {
  font-weight: 600;
}

/* Product carousel section — centered heading, "See All" below the row (design) */
.shop-head {
  text-align: center;
  margin-bottom: 40px;
}

.carousel-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.see-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-deep);
  color: #fff;
  padding: 10px 28px;
  border-radius: 20px;
  font-weight: 500;
}

.see-all:hover {
  background: var(--green-deep-hover);
}

.product-carousel {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 22px;
  scrollbar-color: var(--green-mid) var(--grey-light);
  scrollbar-width: thin;
}

.product-carousel::-webkit-scrollbar {
  height: 8px;
}

.product-carousel::-webkit-scrollbar-track {
  background: var(--grey-light);
  border-radius: 30px;
}

.product-carousel::-webkit-scrollbar-thumb {
  background: var(--green-mid);
  border-radius: 30px;
}

.product-carousel .product-card {
  flex: 0 0 calc((100% - 4 * 30px) / 5); /* 5 cards visible, like the design grid */
  min-width: 250px;
  scroll-snap-align: start;
}

/* Quality / certification section */
.quality-highlights {
  margin-top: 70px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.quality-highlights h3 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 20px;
}

.check-list li {
  font-size: 17px;
  padding-left: 30px;
  position: relative;
  margin-bottom: 12px;
  color: #333;
}

.check-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green-mid);
  font-weight: 700;
}

.trust-note {
  margin-top: 18px;
  font-size: 17px;
  color: #333;
}

.badges-image {
  background: #fff;
  border-radius: 20px;
  padding: 34px;
}

/* =========================================================
   Traditional extraction process — animated HTML/CSS/SVG
   serpentine diagram (recreates the design's graphic)
   ========================================================= */

.process-flow {
  position: relative;
  max-width: 1520px;
  margin: 60px auto 0;
  aspect-ratio: 1620 / 700;
}

.process-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Green flow line — draws itself in on scroll */
.pp-green {
  stroke: #006028;
  stroke-width: 21;
  stroke-linecap: round;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
}

.is-inview .pp-green {
  animation: pp-draw 2.4s ease-in-out 0.2s forwards;
}

/* Brown counter-arcs completing each loop */
.pp-brown {
  stroke: #5b2711;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
  opacity: 0;
}

.is-inview .pp-brown {
  animation: pp-draw-arc 0.9s ease-out forwards;
}

.is-inview .pp-brown:nth-of-type(1) { animation-delay: 0.55s; }
.is-inview .pp-brown:nth-of-type(2) { animation-delay: 0.95s; }
.is-inview .pp-brown:nth-of-type(3) { animation-delay: 1.35s; }
.is-inview .pp-brown:nth-of-type(4) { animation-delay: 1.75s; }

/* Waypoint dots on the flow line */
.pp-dot {
  fill: #5b2711;
  stroke: #fafafa;
  stroke-width: 6;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
}

.is-inview .pp-dot {
  animation: pp-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.is-inview .pp-dot-1 { animation-delay: 0.7s; }
.is-inview .pp-dot-2 { animation-delay: 1.1s; }
.is-inview .pp-dot-3 { animation-delay: 1.5s; }
.is-inview .pp-dot-4 { animation-delay: 1.9s; }

/* Step icon + label column, centered on each loop (--x set inline).
   The column spans the diagram's full height; the icon sits at the
   loop centre, the label clears the ring above or below it. */
.process-step {
  position: absolute;
  left: var(--x);
  top: 0;
  bottom: 0;
  width: 260px;
  margin-left: -130px;
  text-align: center;
  opacity: 0;
}

.is-inview .process-step {
  animation: pp-rise 0.7s ease-out forwards;
  animation-delay: calc(0.5s + var(--step) * 0.4s);
}

.process-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* labels: steps 1 & 3 below the loops, 2 & 4 above (dots at 77.1% / 22.9%) */
.process-step--below h3 {
  position: absolute;
  top: 83%;
  left: 0;
  right: 0;
}

.process-step--above h3 {
  position: absolute;
  bottom: 83%;
  left: 0;
  right: 0;
}

.process-step h3 {
  font-size: clamp(14px, 1.75vw, 25px);
  font-weight: 600;
  line-height: 1.35;
  color: #1f1f1f;
}

.process-icon {
  width: clamp(48px, 6vw, 92px);
  height: clamp(48px, 6vw, 92px);
}

.process-icon svg,
.process-end svg {
  width: 100%;
  height: 100%;
  stroke: #5b2711;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.is-inview .process-icon {
  animation: pp-float 3.6s ease-in-out calc(2.4s + var(--step) * 0.3s) infinite;
}

.pp-letter {
  font-family: var(--font);
  font-size: 8.5px;
  font-weight: 700;
  fill: #5b2711;
  stroke: none;
}

/* Endpoint glyphs: farm field (start), oil bottle (finish) */
.process-end {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  opacity: 0;
}

.process-end--farm {
  left: 1.5%;
  width: clamp(56px, 8vw, 124px);
  height: clamp(42px, 6vw, 93px);
}

.process-end--bottle {
  right: 2%;
  width: clamp(38px, 4.8vw, 74px);
  height: clamp(43px, 5.4vw, 83px);
}

.is-inview .process-end {
  animation: pp-rise-end 0.8s ease-out forwards;
}

.is-inview .process-end--farm { animation-delay: 0.15s; }
.is-inview .process-end--bottle { animation-delay: 2.3s; }

@keyframes pp-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes pp-draw-arc {
  from { opacity: 1; }
  to { opacity: 1; stroke-dashoffset: 0; }
}

@keyframes pp-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes pp-rise {
  from { opacity: 0; translate: 0 22px; }
  to { opacity: 1; translate: 0 0; }
}

/* endpoints keep their vertical centering while rising in */
@keyframes pp-rise-end {
  from { opacity: 0; translate: 0 calc(-50% + 22px); }
  to { opacity: 1; translate: 0 -50%; }
}

@keyframes pp-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-green,
  .pp-brown,
  .pp-dot,
  .process-step,
  .process-end {
    animation: none !important;
    opacity: 1;
    stroke-dashoffset: 0;
  }

  .pp-dot {
    transform: scale(1);
  }
}

/* The vertical serpentine SVG only exists on mobile */
.process-path--mobile {
  display: none;
}

/* Small screens: the serpentine goes VERTICAL — same loops, arcs, dots
   and draw/pop/rise animations, transposed to weave down the page.
   The transposed geometry keeps the loop centres at the same fractional
   offsets, so each step's --x becomes its vertical position. */
@media (max-width: 700px) {
  .process-flow {
    aspect-ratio: 700 / 1620;
    /* The Figma diagram runs to the viewport edges (412px frame), while
       the surrounding section retains its normal content padding. */
    width: calc(100% + 32px);
    max-width: 412px;
    margin: 36px -16px 0;
  }

  .process-path {
    display: none;
  }

  .process-path--mobile {
    display: block;
  }

  /* Farm glyph top-centre, bottle bottom-centre. transform does the
     horizontal centering; the rise animations keep driving `translate`. */
  .process-end {
    top: auto;
    left: 50%;
    right: auto;
    translate: none;
    transform: translateX(-50%);
  }

  .process-end--farm {
    top: 0.4%;
  }

  .process-end--bottle {
    bottom: 0.4%;
  }

  .is-inview .process-end {
    animation-name: pp-rise;
  }

  /* Step anchors: a zero-height strip across the loop's vertical centre */
  .process-step {
    top: var(--x);
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 0;
    margin-left: 0;
    z-index: 1;
  }

  /* Icon centred ON the loop (top:50% of a zero-height strip = the line) */
  .process-icon {
    width: clamp(44px, 12vw, 60px);
    height: clamp(44px, 12vw, 60px);
  }

  /* Each label sits OUTSIDE the green edge of its loop. Steps 1/3 use the
     right green edge, while steps 2/4 use the left green edge. The extra
     offset keeps the copy clear of both the green flow and brown counterarc. */
  .process-step h3 {
    z-index: 2;
    width: 19%;
    margin: 0;
    font-size: clamp(9px, 2.4vw, 11px);
    font-weight: 500;
    line-height: 1.18;
  }

  .process-step--below h3 {
    top: 0;
    bottom: auto;
    left: 81%;
    right: auto;
    transform: translateY(-50%);
    text-align: left;
  }

  .process-step--above h3 {
    top: 0;
    bottom: auto;
    left: auto;
    right: 81%;
    transform: translateY(-50%);
    text-align: right;
  }
}

/* Healthy cooking section */
.healthy-section .story-media img {
  height: 560px;
}

.healthy-section ul.two-col {
  columns: 2;
  column-gap: 30px;
  margin-top: 18px;
}

.healthy-section ul.two-col li {
  break-inside: avoid;
}

/* Explore collection CTA */
.explore-cta {
  background: var(--green-mid);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 60px 24px;
  color: #fff;
}

.explore-cta h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
}

@media (max-width: 900px) {
  /* All five icons stay on one row on mobile, like the desktop strip. */
  .why-strip {
    display: flex;
    justify-content: center;
    gap: 0;
  }

  .why-item {
    flex: 1 1 20%;
    min-width: 0;
    padding: 0 4px;
  }

  .why-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
  }

  .why-icon img {
    width: 30px;
    height: 30px;
  }

  .why-item h3 {
    font-size: 13px;
  }

  .why-item h3 br {
    display: none;
  }

  .story-row,
  .story-row.reverse .story-media,
  .quality-highlights {
    grid-template-columns: 1fr;
  }

  .story-row.reverse .story-media {
    order: 0;
  }

  .healthy-section ul.two-col {
    columns: 1;
  }
}

@media (max-width: 560px) {
  .product-carousel .product-card {
    flex-basis: 220px;
  }
}

/* The template keeps the previous hero image for backwards-compatible
   markup, but only the responsive Figma picture is rendered. */
.hero-banner > img,
.hero-banner > .hero-shop-link {
  display: none;
}

/* Three-slide hero. The initial image is duplicated into all slots so the
   carousel is complete immediately; replace each slide asset independently. */
.hero-banner {
  aspect-ratio: 1920 / 1080;
  overflow: hidden;
}

.hero-slides,
.hero-slide,
.hero-slide picture,
.hero-slide img {
  width: 100%;
  height: 100%;
}

.hero-slides {
  position: relative;
  height: 100%;
}

.hero-slide {
  display: none;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
}

.hero-slide.is-active {
  display: block;
  animation: hero-slide-in 550ms ease both;
}

@keyframes hero-slide-in {
  from { opacity: 0; transform: translateX(4%); }
  to { opacity: 1; transform: translateX(0); }
}

.hero-slide picture,
.hero-slide img {
  display: block;
}

.hero-slide picture {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide img {
  object-fit: cover;
}

.hero-content {
  position: absolute;
  z-index: 10;
  top: 24%;
  left: 8.3%;
  max-width: 45%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #111 !important;
  display: block;
  visibility: visible;
  opacity: 1 !important;
}

.hero-content h1,
.hero-content h2 {
  margin: 0 0 4%;
  font-size: clamp(34px, 5vw, 90px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.04em;
  color: #111 !important;
  text-shadow: 0 1px 12px rgba(255, 255, 255, .65);
}

.hero-content em {
  color: var(--green-mid);
  font-style: normal;
}

.hero-content p {
  max-width: 720px;
  margin: 0 0 5%;
  font-size: clamp(15px, 1.5vw, 28px);
  font-weight: 600;
  line-height: 1.35;
  color: #222 !important;
  text-shadow: 0 1px 10px rgba(255, 255, 255, .75);
}

.hero-shop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(132px, 15vw, 290px);
  min-height: clamp(42px, 4.2vw, 76px);
  padding: 10px 32px;
  border-radius: 999px;
  background: var(--green-mid);
  color: #fff;
  font-size: clamp(17px, 1.8vw, 34px);
  font-weight: 700;
}

.hero-shop-button:hover { background: var(--green-deep); color: #fff; }

.hero-brandmark {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 7.2%;
  width: clamp(74px, 7.1vw, 136px);
  aspect-ratio: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #fff;
  border-radius: 0 0 48% 48%;
  box-shadow: 0 8px 10px rgba(0, 0, 0, .1);
}

.hero-brandmark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-dots {
  z-index: 2;
}

.hero-dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  opacity: .9;
  transition: width 200ms ease;
}

.hero-dots button.is-active {
  width: 36px;
  border-radius: 8px;
}

.hero-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(0, 96, 40, .84);
  color: #fff;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
  transition: transform 160ms ease, background 160ms ease;
}

.hero-arrow:hover { background: var(--green-deep); transform: translateY(-50%) scale(1.08); }
.hero-arrow--previous { left: 24px; }
.hero-arrow--next { right: 24px; }

/* Figma 412px Home frame: use one media edge (32px) and one reading
   column (46px), rather than inheriting the desktop spacing. */
@media (max-width: 700px) {
  .hero-banner { aspect-ratio: 412 / 231; }
  .hero-content { z-index: 10; top: 14%; left: 6%; max-width: 50%; padding: 0; }
  .hero-content h1, .hero-content h2 { margin-bottom: 5px; font-size: clamp(15px, 6vw, 24px); }
  .hero-content p { display: none; }
  .hero-shop-button { min-width: 70px; min-height: 25px; padding: 4px 12px; font-size: 11px; }
  .hero-brandmark { right: 16px; width: 50px; padding: 4px; box-shadow: 0 3px 6px rgba(0, 0, 0, .1); }
  .hero-arrow { display: none; }
  .hero-dots { bottom: 12px; gap: 1px; }
  .hero-dots button, .hero-dots button.is-active { width: 4px; height: 4px; border-radius: 50%; }
  .hero-dots button.is-active { width: 12px; border-radius: 4px; }

  #why-choose { padding: 10px 0 12px; }
  #why-choose .container { padding: 0 27px; }
  #why-choose .section-title { font-size: 24px; line-height: 1.15; margin-bottom: 4px; }
  .why-strip { margin-top: 0; }
  .why-icon { width: 26px; height: 26px; margin-bottom: 3px; }
  .why-icon img { width: 16px; height: 16px; }
  .why-item { padding: 0 2px; }
  .why-item h3 { font-size: 8px; line-height: 1.15; }

  #why-choose + .section .container, #family-trust .container,
  #certifications .container, .healthy-section .container, #faq .container { padding-right: 32px; padding-left: 32px; }
  #why-choose + .section { padding: 12px 0 18px; }
  #why-choose + .section .story-row { gap: 10px; }
  .story-media img, .healthy-section .story-media img { width: 100%; max-height: none; border-radius: 0; }
  .story-text { padding: 0 14px; }
  .story-text .eyebrow { font-size: 10px; padding: 3px 16px; margin-bottom: 8px; }
  .story-text .section-title, .quality-highlights h3 { font-size: 24px; line-height: 1.2; margin-bottom: 8px; }
  .story-text p, .story-text ul li, .check-list li, .trust-note { font-size: 13px; line-height: 1.45; }

  /* Figma places mission copy before its image. */
  #why-choose + .section .story-row.reverse .story-media { order: 2; }
  #why-choose + .section .story-row + .story-row { margin-top: 26px; }
  #family-trust { padding: 0 0 18px; }
  #family-trust .story-row { gap: 0; }
  #family-trust .story-media { display: none; }
  #family-trust .check-list { margin-top: 10px; }
  #family-trust .check-list li { margin-bottom: 4px; }

  #shop { padding: 12px 0 20px; }
  #shop .container--wide { padding: 0 16px; }
  #shop .section-title { font-size: 24px; line-height: 1.15; }
  .product-carousel { gap: 24px; padding-bottom: 10px; }
  .product-carousel .product-card { flex: 0 0 171px; min-width: 171px; }

  #certifications, .healthy-section, #faq { padding: 16px 0 24px; }
  .quality-highlights { margin-top: 18px; gap: 18px; }
  .badges-image { padding: 0; border-radius: 0; }
  #extraction-process { padding: 28px 0; }
  #extraction-process .section-title, #faq .section-title { font-size: 24px; }
  .faq-question { padding: 12px 13px; font-size: 13px; }
  .faq-answer p { padding: 0 13px 10px; font-size: 12px; }
}

/* =========================================================
   Mobile fixes — single-column sections show images at their
   natural ratio (the fixed 460/560px heights crop them badly
   on phones), and desktop-scale gaps tighten up.
   ========================================================= */
@media (max-width: 900px) {
  /* Full image, no crop, once the row stacks to one column */
  .story-media img,
  .healthy-section .story-media img {
    height: auto;
    max-height: 420px;
    object-fit: contain;
    background: transparent;
  }

  .story-row {
    gap: 28px;
  }

  .story-row + .story-row {
    margin-top: 56px;
  }

  .quality-highlights {
    margin-top: 44px;
    gap: 32px;
  }
}

@media (max-width: 700px) {
  .badges-image {
    padding: 18px;
  }

  .shop-head {
    margin-bottom: 24px;
  }

  .carousel-foot {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  /* Five-across on phones: at 320px each column is ~60px, so the circle
     scales with the viewport instead of a fixed size. */
  .why-icon {
    width: clamp(40px, 13vw, 56px);
    height: clamp(40px, 13vw, 56px);
    margin-bottom: 8px;
  }

  .why-icon img {
    width: 55%;
    height: 55%;
  }

  .why-item h3 {
    font-size: clamp(9px, 2.8vw, 12px);
    line-height: 1.25;
  }

  /* The design's hard line breaks fight the narrow columns — let the
     headings wrap naturally on phones. */
  .why-item h3 br {
    display: none;
  }

  .story-text p,
  .story-text ul li,
  .check-list li,
  .trust-note {
    font-size: 15px;
  }

  .quality-highlights h3 {
    font-size: 22px;
  }
}
