/* ==========================================================================
   TrichoLab PDP options — shared commerce primitives
   Extends the homepage set's base.css (copied unmodified). No new tokens:
   everything binds to the base palette / type / motion custom properties.
   ========================================================================== */

/* Mobile hygiene (390px gotcha: 1fr tracks overflow — always minmax(0,1fr)) */
body { overflow-x: clip; }
[hidden] { display: none !important; }

/* --- Breadcrumbs ----------------------------------------------------------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--shiitake); padding-block: 14px 4px;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--cypress); text-decoration: underline; text-underline-offset: 4px; }
.crumbs .sep { opacity: 0.5; }
.crumbs [aria-current="page"] { color: var(--jet); font-weight: 600; }

/* --- Buy-box layout --------------------------------------------------------- */
.buy-grid {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: clamp(26px, 4.5vw, 60px); align-items: start;
}
@media (min-width: 900px) {
  .buy-grid { grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr); }
}

/* --- Gallery: scroll-snap stage + thumbnails --------------------------------
   The stage swipes natively (scroll-snap, no JS needed); pdp.js wires the
   thumbs to it. */
.gallery { min-width: 0; }
.gallery-stage {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-m);
}
.gallery-stage::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.gallery-frame {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
}
.gallery-frame img { width: 100%; height: 100%; object-fit: contain; }
.gallery-frame--pad img { width: 82%; height: 82%; }
.gallery-frame--zoom img { transform: scale(2.1); transform-origin: 50% 14%; }
.gallery-frame--texture img { object-fit: cover; }
.gallery-frame--deep { background: var(--cypress-deep); }
.gallery-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 0.78rem; color: var(--shiitake);
  padding: 10px 16px; background: linear-gradient(rgba(250, 245, 234, 0), rgba(250, 245, 234, 0.9));
}
.gallery-frame--deep .gallery-cap,
.gallery-frame--texture .gallery-cap { color: var(--paper); background: linear-gradient(rgba(33, 35, 34, 0), rgba(33, 35, 34, 0.55)); }
/* Typographic plate slide (no photography exists for this view) */
.gallery-plate {
  aspect-ratio: 1 / 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: var(--sage-tint); padding: 24px;
}
.gallery-plate .plate-big { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; color: var(--cypress-deep); }
.gallery-plate .plate-sub { font-size: 0.9rem; color: var(--shiitake); max-width: 34ch; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumb {
  width: 62px; height: 62px; border-radius: var(--radius-s); overflow: hidden;
  border: 1.5px solid var(--stucco-tint); background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--t-hover);
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--shiitake); line-height: 1.2;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb--pad img { object-fit: contain; padding: 6px; }
.gallery-thumb:hover { border-color: var(--stucco); }
.gallery-thumb.is-active { border-color: var(--cypress); }

/* --- Price / meta ------------------------------------------------------------ */
.price-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price { font-family: var(--serif); font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1; color: var(--jet); }
.price-note { font-size: 0.8rem; color: var(--shiitake); }
.size-chip {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
  border: 1px solid var(--stucco); color: var(--shiitake);
  border-radius: 999px; padding: 3px 12px;
}
.stock-line {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.88rem; font-weight: 600; color: var(--cypress);
}
.stock-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }

/* --- Quantity stepper -------------------------------------------------------- */
.qty {
  display: inline-flex; align-items: stretch;
  border: 1.5px solid var(--jet); border-radius: 999px; overflow: hidden;
}
.qty button {
  width: 46px; min-height: 46px; font-size: 1.2rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--t-hover);
}
.qty button:hover { background: var(--paper-deep); }
.qty input {
  width: 52px; text-align: center; border: 0; background: transparent;
  font-weight: 600; font-size: 1rem; -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- Buy controls ------------------------------------------------------------- */
.buy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.buy-ctas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 520px) { .buy-ctas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.buy-ctas .btn { width: 100%; }
.btn.is-added { background: var(--sage); color: #fff; border-color: var(--sage); }
.atc-note {
  border-radius: var(--radius-s); background: var(--sage-tint);
  border: 1px solid rgba(84, 90, 61, 0.25);
  padding: 12px 16px; font-size: 0.9rem; color: var(--cypress-deep);
}
.atc-note a { color: var(--cypress); font-weight: 600; }
.demo-tag { font-size: 0.74rem; color: var(--stucco); letter-spacing: 0.04em; }

/* Concern chips (verbatim "Shop by concern" labels from the live page) */
.concern-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.concern-chips a {
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--stucco-tint); border-radius: 999px;
  padding: 6px 14px; color: var(--shiitake);
  transition: border-color var(--t-hover), color var(--t-hover);
}
.concern-chips a:hover { border-color: var(--cypress); color: var(--cypress); }

/* --- Cross-sell cards (no local product photography — typographic panels) --- */
.xsell-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .xsell-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .xsell-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.xsell-mono {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 2.2rem; color: var(--cypress);
  background: var(--sage-tint); border-radius: var(--radius-s);
}

/* --- Sticky mobile ATC bar (Option B) ---------------------------------------- */
.sticky-atc-price { color: var(--paper); font-weight: 600; display: flex; flex-direction: column; justify-content: center; line-height: 1.15; padding-inline: 4px; }
.sticky-atc-price small { font-weight: 400; font-size: 0.7rem; opacity: 0.75; }
