/* ==========================================================================
   Commerce components: pouch placeholder, product cards, cart drawer,
   free-ship bar, sticky ATC. (Pouch = CSS placeholder until Q31 packshots.)
   ========================================================================== */

/* ----- CSS pouch placeholder ----- */
.pouch {
  --pouch-a: var(--ink-soft);
  --pouch-b: var(--bg-soft);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-align: center;
  width: 150px; aspect-ratio: 3 / 4.2;
  margin-inline: auto;
  background:
    radial-gradient(120% 90% at 30% 15%, rgba(255,255,255,0.35), transparent 55%),
    linear-gradient(160deg, var(--pouch-a), var(--pouch-b));
  border-radius: 18px 18px 26px 26px / 14px 14px 30px 30px;
  box-shadow: inset 0 -10px 24px rgba(0,0,0,0.12), var(--shadow);
  color: #fff; padding: var(--sp-4) var(--sp-3);
}
.pouch-cap {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 14px; border-radius: 4px 4px 0 0;
  background: #fff; opacity: 0.85;
  box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}
/* The wordmark as it sits on the pack, so it takes the wordmark face (see .proto-word).
   Size, tracking and opacity are unchanged — only the family and weight move. */
.pouch-brand { font-family: var(--font-wordmark); font-weight: 900; font-stretch: 125%; font-size: 0.8em; letter-spacing: 0.06em; opacity: 0.9; }
.pouch-name  { font-family: var(--font-display); font-weight: 800; font-size: 1.15em; line-height: 1.1; }
.pouch-flavor { font-size: 0.65em; opacity: 0.9; }
.pouch-stat  { font-size: 0.55em; opacity: 0.75; margin-top: var(--sp-2); }
.pouch-focus  { --pouch-a: var(--focus);  --pouch-b: var(--focus-deep); }
.pouch-reset  { --pouch-a: var(--reset);  --pouch-b: var(--reset-deep); }
.pouch-flow   { --pouch-a: var(--flow);   --pouch-b: var(--flow-deep); }
.pouch-neutral { --pouch-a: var(--coral); --pouch-b: #b85a44; }
.pouch-lg { width: 230px; font-size: 1.35rem; }
.pouch-md { font-size: 1rem; }
.pouch-sm { width: 92px; font-size: 0.7rem; }

/* Real packshot drop-in (replaces the CSS pouch when a product image exists).
   Widths mirror the CSS-pouch sizes so it slots into the same layouts. */
.pouch-img { display: block; margin-inline: auto; height: auto; object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(51, 41, 31, 0.18)); }
.pouch-img-lg { width: 260px; max-width: 100%; }
.pouch-img-md { width: 180px; max-width: 100%; }
.pouch-img-sm { width: 110px; max-width: 100%; }
/* Bundle packshots are outer boxes of differing proportions (the 9-pack shot is upright, the
   3- and 15-pack shots wider — note both are still the old 5/10-pack photography).
   Fit each into one identical, generous frame so all three match in footprint and none is
   cropped — object-fit:contain scales each box to fill the frame. */
.product-card--pack .product-card-media {
  width: 100%; height: 340px;
  display: flex; align-items: center; justify-content: center;
}
.pack-img { width: 100%; height: 100%; object-fit: contain; }

/* "The jiggle" placeholder motion (disabled under prefers-reduced-motion via base.css) */
@keyframes jiggle {
  0%, 88%, 100% { transform: rotate(0deg) scaleY(1); }
  90% { transform: rotate(-2deg) scaleY(0.97); }
  93% { transform: rotate(2deg) scaleY(1.02); }
  96% { transform: rotate(-1deg) scaleY(0.99); }
}
.pouch-jiggle { animation: jiggle 5s ease-in-out infinite; transform-origin: 50% 90%; }

/* ----- Product card (mirrors the home "Pick your moment" ritual card) ----- */
.product-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-4); padding: var(--sp-5); }
.product-card-media { display: block; padding: var(--sp-3) 0; text-decoration: none; }
/* Uppercase to match the ritual badge sitting directly under it - the two were fighting
   otherwise. Transform, not the stored name, so the DB value, the alt text, the page title
   and the JSON-LD all keep their real casing. A touch of tracking because caps set solid
   at display size close up too tightly. */
.product-card-title { margin: 0; font-size: clamp(var(--text-lg), 2.2vw, var(--text-xl)); text-transform: uppercase; letter-spacing: 0.015em; }
.product-card-title a { color: var(--ink); text-decoration: none; }
.product-card-body { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); flex: 1; width: 100%; }
.product-card-badge { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; font-size: var(--text-sm); }
.product-card-ritual  { color: var(--ink-soft); font-weight: 600; margin: 0; }
.product-card-flavour { color: var(--ink);      font-weight: 600; margin: 0; }
/* Title carries its ritual's accent, matching the home cards (-deep clears AA on white). */
.product-card.card-focus .product-card-title a { color: var(--focus-deep); }
.product-card.card-reset .product-card-title a { color: var(--reset-deep); }
.product-card.card-flow  .product-card-title a { color: var(--flow-deep); }

/* Ritual cards: a soft-gradient top accent that WRAPS the rounded corners. It's drawn as the
   card's own 4px top border (borders follow border-radius) via a border-box gradient layer —
   a 4px-tall pseudo-bar can't curve a 24px corner, so it must be a real border. Sides/bottom
   keep the neutral hairline; the per-accent solid colour is dropped so all three match. */
.product-card {
  position: relative; isolation: isolate; overflow: hidden;
  --card-accent: var(--brand);
  border: 1px solid var(--line);
  border-top: 4px solid transparent;
  background-color: transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), var(--grad-brand-border);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
}
/* Sunburst rays behind the pouch, revealed only on hover. Big square centred near the pouch;
   spinning the whole element turns the rays around a fixed point, the radial mask keeps the
   soft round fade put. z-index:-1 (inside the card's own stacking context) sits over the tinted
   fill but under the pouch + text. Accent per card via --card-accent. */
.product-card::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 200%; aspect-ratio: 1; left: 50%; top: 30%; transform-origin: center;
  transform: translate(-50%, -50%) rotate(0deg);
  background: repeating-conic-gradient(from 0deg,
    color-mix(in srgb, var(--card-accent) 18%, transparent) 0deg 6deg,
    transparent 6deg 12deg);
  -webkit-mask: radial-gradient(closest-side, #000 32%, transparent 66%);
          mask: radial-gradient(closest-side, #000 32%, transparent 66%);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.product-card.card-hover:hover::before { opacity: 1; animation: pouchRaySpin 24s linear infinite; }
@keyframes pouchRaySpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.product-card.card-focus,
.product-card.card-reset,
.product-card.card-flow { border-top-color: transparent; }
/* At rest, tint each card's fill (the padding-box layer) with its own accent so the trio reads
   clearly purple / green / gold instead of three identical whites. Each also sets --card-accent,
   which drives the hover sunrays + hover fill. The border-box gradient hairline layer is kept. */
.product-card.card-focus { --card-accent: var(--focus); background-image: linear-gradient(color-mix(in srgb, var(--focus) 12%, var(--surface)), color-mix(in srgb, var(--focus) 12%, var(--surface))), var(--grad-brand-border); }
.product-card.card-reset { --card-accent: var(--reset); background-image: linear-gradient(color-mix(in srgb, var(--reset) 12%, var(--surface)), color-mix(in srgb, var(--reset) 12%, var(--surface))), var(--grad-brand-border); }
.product-card.card-flow  { --card-accent: var(--flow);  background-image: linear-gradient(color-mix(in srgb, var(--flow) 12%, var(--surface)),  color-mix(in srgb, var(--flow) 12%, var(--surface))),  var(--grad-brand-border); }
/* Hover: deepen the card's OWN accent tint (not a tri-hue wash) so the sunrays read cleanly in
   the accent colour; the neutral side/bottom border eases to the full gradient hairline. */
.product-card.card-hover:hover {
  background-image:
    linear-gradient(color-mix(in srgb, var(--card-accent) 16%, var(--surface)), color-mix(in srgb, var(--card-accent) 16%, var(--surface))),
    var(--grad-brand-border);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  border-color: transparent;
}
.product-card-buy {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-top: auto; padding-top: var(--sp-4); width: 100%;
}
.price { font-family: var(--font-display); font-weight: 800; font-size: var(--text-md); }
/* Pre-launch cover (price_display): "Deal soon" in the price slot. Steps back from the
   display weight of a real figure so it reads as a note, not as the number itself. */
.price-soon { font-family: inherit; font-weight: 700; font-size: var(--text-xs); color: var(--ink-soft); }

/* The buy row was the smallest type on the card - "Deal soon" below even the ritual and
   flavour lines, and the CTA level with them. Both step up so the row carries the weight the
   bottom of a shoppable card should: the note lands level with the body lines above it, and
   the button clears them to sit second only to the title. Scoped to the card so the site-wide
   [data-add-to-cart] ladder in components.css keeps its one-step-per-tier spacing. */
.product-card-buy .price-soon { font-size: var(--text-sm); }
.product-card-buy .btn[data-add-to-cart] { font-size: var(--text-base); }

/* ----- Pastel wave band -----
   Soft three-tint wash with smooth wavy top & bottom edges (page colour eats into the
   slab in a gentle wave). Shared by the home rituals banner and the shop pouch trio. */
.wave-band {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--focus) 6%, var(--focus-tint)) 0%,
    color-mix(in srgb, var(--reset) 6%, var(--reset-tint)) 52%,
    color-mix(in srgb, var(--flow) 6%, var(--flow-tint)) 100%);
}
.wave-band > .container { position: relative; z-index: 1; }
.wave-band::before, .wave-band::after {
  content: ""; position: absolute; left: -1px; right: -1px; height: 46px; z-index: 2;
  pointer-events: none; background: no-repeat center / 100% 101%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 46' preserveAspectRatio='none'%3E%3Cpath d='M0,0 H1200 V22 C1010,42 900,8 700,24 C505,40 335,8 150,25 C95,30 46,29 0,22 Z' fill='%23FAF7F2'/%3E%3C/svg%3E");
}
.wave-band::before { top: -1px; }
.wave-band::after  { bottom: -1px; transform: scaleY(-1); }
/* The wave eats ~46px at top & bottom; add clearance so content never sits under it. */
.wave-band.section       { padding-block: calc(var(--sp-8) + 26px); }
.wave-band.section-tight  { padding-block: calc(var(--sp-6) + 26px); }

/* ----- Bundles page banner -----
   The three-pouch scene at the top of /bundles, sitting in a .wave-band slab.

   Deliberately NO aspect-ratio and NO object-fit: the image is simply drawn at its own
   intrinsic ratio, width-capped. That is the one arrangement that cannot crop or letterbox it,
   for this render or any that replaces it later — the alternative is a frame ratio that has to
   be re-tuned every time the artwork changes, and cropping a scene whose pouches run nearly its
   full height is what cuts the caps off. The band's own pastel wash fills the width either side
   once the viewport is wider than the cap. */
.bundles-banner { padding-inline: max(var(--sp-4), 4vw); }
.bundles-banner img {
  display: block; margin-inline: auto;
  width: min(100%, 1100px); height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ----- Bundle band -----
   The louder cousin of .wave-band: same wave silhouette, several times the saturation. The
   pastel band above carries the single pouches; this one has to sell the bigger baskets, so the
   three ritual hues run through a mesh of blobs instead of a flat wash. Every hue is mixed
   toward white into the same brightness range (~0.5-0.67 luminance) so one dark ink stays
   legible edge to edge; the white cards read as cut-outs against it. */
.bundle-band {
  /* Deep plum, >=6.9:1 against every part of the mesh below. */
  --bundle-ink: color-mix(in srgb, var(--focus-deep) 55%, #000);
  background-color: color-mix(in srgb, var(--focus) 43%, #fff);
  background-image:
    radial-gradient(90% 120% at 4% 88%,  color-mix(in srgb, var(--reset) 52%, #fff) 0%, transparent 62%),
    radial-gradient(80% 115% at 96% 10%, color-mix(in srgb, var(--flow) 53%, #fff) 0%, transparent 60%),
    radial-gradient(70% 100% at 68% 96%, color-mix(in srgb, var(--neon-pink) 41%, #fff) 0%, transparent 64%),
    linear-gradient(104deg in oklab,
      color-mix(in srgb, var(--reset)     49%, #fff) 0%,
      color-mix(in srgb, var(--focus)     46%, #fff) 42%,
      color-mix(in srgb, var(--neon-pink) 39%, #fff) 72%,
      color-mix(in srgb, var(--flow)      50%, #fff) 100%);
}
.bundle-band h2 { color: var(--bundle-ink); }
/* Lift the cards off the loud ground - the pale hairline border alone disappears on it. */
.bundle-band .product-card { box-shadow: var(--shadow); }
/* The trust line is text-xs: too small to sit on the mesh directly, so each claim gets a
   near-white pill, which also gives the green tick and the link their usual contrast back. */
.bundle-band .trust-row { color: var(--bundle-ink); }
.bundle-band .trust-row .tick {
  background: rgba(255, 255, 255, 0.82);
  padding: 0.34em 0.95em; border-radius: var(--radius-pill);
  color: var(--bundle-ink);
}
.bundle-band .trust-row .tick::before { color: var(--reset-deep); }

/* ----- Cart drawer ----- */
.cart-overlay {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(34, 31, 26, 0.45); border: 0; cursor: pointer;
}
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 150;
  width: min(420px, 100vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  padding: var(--sp-5);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease);
  visibility: hidden;
}
.cart-drawer.is-open { transform: translateX(0); visibility: visible; }
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.cart-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.cart-empty { margin-block: auto; }

.cart-line { display: flex; gap: var(--sp-3); align-items: center; }
.cart-line-swatch { width: 44px; height: 58px; border-radius: 8px 8px 12px 12px; background: var(--bg-soft); flex-shrink: 0; }
.cart-line-img { width: 44px; height: 58px; border-radius: 8px 8px 12px 12px; object-fit: contain; background: var(--bg-soft); flex-shrink: 0; }
.swatch-bg-focus { background: linear-gradient(160deg, var(--focus), var(--focus-deep)); }
.swatch-bg-reset { background: linear-gradient(160deg, var(--reset), var(--reset-deep)); }
.swatch-bg-flow  { background: linear-gradient(160deg, var(--flow), var(--flow-deep)); }
.cart-line-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
/* Flavour name and unit price both read bold in the line item. */
.cart-line-flavour { font-weight: 700; color: var(--ink-soft); }
.cart-line-price   { font-weight: 700; }
.cart-line-qty { display: flex; align-items: center; gap: var(--sp-2); }
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 1rem; cursor: pointer; line-height: 1;
}
.qty-btn:hover { border-color: var(--ink); }

.cart-upsell {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); margin-block: var(--sp-4);
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
  background: var(--bg-soft);
}
/* Keep the upsell CTA on a single line instead of wrapping ("Add starter / pack"). */
.cart-upsell .btn { white-space: nowrap; flex-shrink: 0; }
.cart-foot { border-top: 1px solid var(--line); padding-top: var(--sp-4); }
.cart-subtotal { display: flex; justify-content: space-between; font-size: var(--text-md); margin-bottom: var(--sp-2); }

/* ----- Free-shipping progress ----- */
.ship-bar { margin-bottom: var(--sp-4); }
.ship-bar p { margin-bottom: var(--sp-1); }
.ship-track { height: 6px; border-radius: var(--radius-pill); background: var(--bg-soft); overflow: hidden; }
.ship-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--reset), var(--flow));
  transition: width var(--dur-slow) var(--ease);
}
.ship-bar.is-met .ship-fill { background: var(--reset); }

/* ----- Sticky ATC bar ----- */
.sticky-atc {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(34,31,26,0.08);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease);
}
.sticky-atc.is-visible { transform: translateY(0); }
.sticky-atc-inner {
  max-width: var(--container); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
}
.sticky-atc-inner > div { display: flex; flex-direction: column; }
