/* Product page. The homepage's sections, palette and components, arranged as a
   product detail page: gallery and buy box first, then the story below it. */

/* --- Product: gallery beside the buy box ---------------------------------- */
.product {
  position: relative;
  padding: 26px var(--edge) 132px;
  background: var(--cream);
}
.product > .wave-bottom { fill: var(--forest); }
.product-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1240px;
  margin: 0 auto 24px;
  color: var(--muted);
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.product-crumbs a { color: inherit; text-decoration: none; }
.product-crumbs a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 4px; }
.product-crumbs [aria-current] { color: var(--forest); }
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(36px, 5.5vw, 96px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

/* The gallery is the homepage's formula gallery: a square stage with frosted
   arrows and round thumbnails, held in view while the buy box scrolls. */
.product-gallery { position: sticky; top: 124px; min-width: 0; }
.product-gallery .gallery-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 20px;
  background: var(--sage-light);
  outline: 1px solid rgb(48 62 48 / 0.06);
  outline-offset: -1px;
}
.product-gallery .gallery-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.product-gallery .gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  padding: 0;
  border: 1px solid rgb(48 62 48 / 0.1);
  border-radius: 50%;
  background: rgb(251 249 243 / 0.82);
  color: var(--forest);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px -8px rgb(48 62 48 / 0.35);
  cursor: pointer;
  transition: background-color 150ms, transform 150ms;
}
.product-gallery .gallery-prev { left: 18px; }
.product-gallery .gallery-next { right: 18px; }
.product-gallery .gallery-next svg { transform: scaleX(-1); }
.product-gallery .gallery-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product-gallery .gallery-arrow:active { transform: scale(0.94); }
.product-gallery .gallery-arrow:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.product-gallery .gallery-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.product-gallery .gallery-controls button {
  flex: none;
  width: 58px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: var(--sage-light);
  opacity: 0.72;
  transition: opacity 150ms;
}
.product-gallery .gallery-controls img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.product-gallery .gallery-controls button[aria-pressed="true"] {
  opacity: 1;
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}
.product-gallery .gallery-controls button:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }

/* --- Buy box --------------------------------------------------------------- */
.product-buy { min-width: 0; padding-top: 6px; }
.product-eyebrow {
  color: var(--gold);
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.product-buy h1 {
  margin-top: 14px;
  color: var(--forest);
  font-size: clamp(48px, 5.2vw, 78px);
  line-height: 0.97;
  text-wrap: balance;
}
.product-sub {
  max-width: 30ch;
  margin-top: 20px;
  color: var(--forest);
  font-family: "Fraunces Italic", var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(19px, 1.55vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.product-actives {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.product-actives li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgb(48 62 48 / 0.14);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.55);
  color: var(--forest);
  font: 500 12px/1.4 var(--font);
}
.product-actives li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* The pack picker is the homepage's phone picker, shown at every width. */
.product-purchase { display: block; margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line); }
.product-purchase .mobile-pack-picker { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.product-legend {
  margin-bottom: 14px;
  padding: 0;
  color: var(--forest);
  font: 700 24px/1.1 var(--display);
  letter-spacing: -0.035em;
}
.product-purchase .mobile-pack-option { position: relative; display: block; cursor: pointer; }
.product-purchase .mobile-pack-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-purchase .mobile-pack-content {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto 20px;
  gap: 14px;
  align-items: center;
  min-height: 94px;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms;
}
.product-purchase .mobile-pack-content img {
  width: 70px;
  height: 56px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.product-purchase .mobile-pack-copy { display: grid; gap: 4px; min-width: 0; }
.product-purchase .mobile-pack-copy strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--forest);
  font: 700 23px/1.1 var(--display);
  letter-spacing: -0.035em;
}
.product-purchase .mobile-pack-copy > span { color: var(--muted); font: 400 12.5px/1.4 var(--font); }
.product-purchase .mobile-pack-copy [data-savings] { color: var(--forest); font-weight: 500; }
.product-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--forest);
  font: 500 9.5px/1 var(--mono);
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.product-purchase .mobile-pack-price { display: grid; justify-items: end; gap: 4px; text-align: right; }
.product-purchase .mobile-pack-amount {
  color: var(--forest);
  font: 700 27px/1 var(--display);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.product-purchase .mobile-pack-unit {
  color: var(--muted);
  font: 500 9.5px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.product-purchase .mobile-pack-check { width: 20px; height: 20px; border: 1px solid var(--muted); border-radius: 50%; }
.product-purchase .mobile-pack-option input:checked + .mobile-pack-content {
  border-color: var(--forest);
  background: var(--butter);
  box-shadow: inset 0 0 0 1px var(--forest);
}
.product-purchase .mobile-pack-option input:checked + .mobile-pack-content .mobile-pack-check {
  border-color: var(--forest);
  background: var(--forest);
  box-shadow: inset 0 0 0 4px var(--butter);
}
.product-purchase .mobile-pack-option input:focus-visible + .mobile-pack-content { outline: 2px solid var(--forest); outline-offset: 3px; }
.product-purchase .mobile-pack-option input:disabled + .mobile-pack-content { opacity: 0.6; cursor: not-allowed; }
.product-purchase .mobile-purchase-button {
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  margin-top: 18px;
  padding-inline: 24px;
  border: 0;
  border-radius: 10px;
  background: var(--forest);
  color: var(--cream);
  font: 600 17px/1.3 var(--font);
  letter-spacing: -0.005em;
  text-transform: none;
  transition: background-color 160ms, color 160ms;
}
.product-purchase .mobile-purchase-button > span:last-child { font-size: 22px; }
.product-purchase .mobile-notify {
  display: block;
  min-height: 44px;
  margin: 8px auto 0;
  border: 0;
  background: none;
  font: 500 14px/1.4 var(--font);
}
.product-buy .purchase-shipping { margin-top: 12px; }
.product-buy .run-meter { width: 100%; margin-top: 24px; }

.product-assurance {
  display: grid;
  gap: 16px;
  margin: 30px 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.product-assurance li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font: 400 14px/1.5 var(--font);
}
.product-assurance svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 50%;
  background: var(--yellow-light);
  fill: none;
  stroke: var(--forest);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product-assurance strong { color: var(--forest); font-weight: 600; }

/* The details a buyer checks before paying: the homepage FAQ rows, quieter. */
.buy-details { margin-top: 26px; border-top: 1px solid var(--line); }
.buy-details details { border-bottom: 1px solid var(--line); }
.buy-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  color: var(--forest);
  font: 600 15px/1.35 var(--font);
  list-style: none;
  cursor: pointer;
}
.buy-details summary::-webkit-details-marker { display: none; }
.buy-details summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sage-light);
  font: 500 17px/1 var(--font);
  transition: background-color 150ms, rotate 200ms var(--groove-ease);
}
.buy-details details[open] summary::after { background: var(--yellow); rotate: 45deg; }
.buy-details summary:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.buy-details details > :not(summary) { max-width: 54ch; color: var(--muted); font: 400 14px/1.65 var(--font); }
.buy-details details > p + p { margin-top: 10px; }
.buy-details details > :last-child { margin-bottom: 20px; }
.buy-details ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.buy-details li { position: relative; padding-left: 18px; }
.buy-details li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.buy-details li strong { color: var(--forest); font-weight: 600; }
.buy-details .text-link { display: inline-flex; margin-top: 12px; color: var(--forest); font-size: 13px; font-weight: 500; }

/* The preorder band borrows the carry layout: steps on sage beside a framed photo. */
.preorder .preorder-steps { margin-top: 30px; }
.preorder .preorder-steps li { border-color: rgb(36 63 49 / 0.2); }
.preorder .preorder-steps h3 { font-size: 24px; }
.preorder .preorder-steps p { max-width: 44ch; }
.preorder .preorder-cta {
  gap: 12px;
  width: fit-content;
  min-height: 56px;
  margin-top: 32px;
  padding-inline: 26px;
  border: 0;
  border-radius: 10px;
  background: var(--forest);
  color: var(--cream);
  font: 600 16px/1.3 var(--font);
  letter-spacing: -0.005em;
  text-decoration: none;
  text-transform: none;
  transition: background-color 160ms, color 160ms;
}
.preorder figure img { aspect-ratio: 912 / 1120; object-fit: cover; }

@media (hover: hover) and (pointer: fine) {
  .product-gallery .gallery-controls button:hover { opacity: 1; }
  .product-gallery .gallery-arrow:hover { background: rgb(251 249 243 / 0.97); }
  .product-purchase .mobile-pack-option:hover .mobile-pack-content { border-color: var(--forest); }
  .product-purchase .mobile-purchase-button:hover:not(:disabled),
  .preorder .preorder-cta:hover { background: var(--yellow); color: var(--forest); }
}

/* --- Sections below, re-edged for this page's order ------------------------ */
/* A wave takes the colour of the section it bleeds in from. Here the ribbon
   sits above the benefits band, and the routine and formula share the cream. */
[data-page="product"] .story > .wave-top { display: block; fill: var(--forest); }
[data-page="product"] .routine > .wave-top,
[data-page="product"] .routine > .wave-bottom { display: none; }
[data-page="product"] .routine { padding-block: 108px 104px; }
[data-page="product"] .site-footer > .wave-top { fill: var(--cream); }
/* The FAQ follows the sage preorder band, so it rises into it on a wave. */
[data-page="product"] .faq { position: relative; background: var(--cream); }
[data-page="product"] .faq::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  height: 31px;
  background: inherit;
  mask: var(--wave-mask) var(--wave-phase) 0 / 240px 40px repeat-x;
  pointer-events: none;
}

/* --- Tablet and phone ------------------------------------------------------ */
@media (max-width: 980px) {
  .product-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .product-purchase .mobile-pack-content { grid-template-columns: 56px minmax(0, 1fr) auto 18px; gap: 10px; }
  .product-purchase .mobile-pack-content img { width: 56px; height: 48px; }
  .product-purchase .mobile-pack-copy strong { font-size: 20px; }
  .product-purchase .mobile-pack-amount { font-size: 24px; }
}
@media (max-width: 760px) {
  .product { padding: 14px 20px 76px; }
  .product-crumbs { margin-bottom: 14px; font-size: 10px; }
  .product-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .product-gallery { position: static; }
  .product-gallery .gallery-stage { border-radius: 16px; }
  .product-gallery .gallery-arrow { width: 40px; height: 40px; margin-top: -20px; }
  .product-gallery .gallery-prev { left: 10px; }
  .product-gallery .gallery-next { right: 10px; }
  .product-gallery .gallery-controls { gap: 9px; margin-top: 14px; }
  .product-gallery .gallery-controls button { width: 44px; height: 44px; }
  .product-buy { padding-top: 0; }
  .product-buy h1 { font-size: clamp(40px, 11vw, 52px); }
  .product-sub { margin-top: 14px; font-size: 18px; }
  .product-actives { margin-top: 18px; }
  .product-purchase { margin-top: 24px; padding-top: 22px; }
  .product-legend { font-size: 22px; }
  .product-purchase .mobile-pack-content { grid-template-columns: 52px minmax(0, 1fr) auto 18px; min-height: 88px; padding: 12px; }
  .product-purchase .mobile-pack-content img { width: 52px; height: 46px; }
  .product-purchase .mobile-pack-copy strong { font-size: 21px; }
  .product-purchase .mobile-pack-copy > span { font-size: 11.5px; }
  .product-purchase .mobile-pack-amount { font-size: 25px; }
  .product-purchase .mobile-purchase-button { min-height: 58px; }
  .product-assurance li { font-size: 13px; }
  [data-page="product"] .routine { padding-block: 76px 64px; }
  .buy-details summary { min-height: 54px; font-size: 14.5px; }
  .preorder .preorder-cta { width: 100%; justify-content: center; }
}
@media (max-width: 360px) {
  .product { padding-inline: 16px; }
  .product-purchase .mobile-pack-content { grid-template-columns: 42px minmax(0, 1fr) auto 16px; gap: 8px; padding: 10px; }
  .product-purchase .mobile-pack-content img { width: 42px; }
  .product-purchase .mobile-pack-copy strong { font-size: 19px; }
  .product-purchase .mobile-pack-amount { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .product-purchase .mobile-pack-content,
  .product-purchase .mobile-purchase-button,
  .product-gallery .gallery-arrow,
  .product-gallery .gallery-controls button { transition: none; }
}
