/* =========================================================================
   Single product page.

   Loaded on product pages only, after main.css. Everything here is namespaced
   under `.pd`/`.pd-*` so it cannot reach the rest of the design system — the
   PDP carries its own scale (larger display type, shaded photo plates, filled
   size chips) and would otherwise leak into the shop and homepage grids.
   ========================================================================= */

.pd {
  /* Photo plate + inactive control fill. Follows the shared `--tile` token so
     the PDP plates stay in step with the card grids across the site. */
  --pd-shade: var(--tile, #f2f2f2);
  --pd-quiet: #8a8a8a;   /* eyebrows, labels, spec keys */
  --pd-body:  #3d3d3d;   /* running text */
  --pd-gap:   20px;      /* gallery gutter */
}

.pd-main > *, .pd-head > *, .pd-archive > *, .pd-styled > * { min-width: 0; }

/* ----------------------------------------------------------- breadcrumbs */

.pd-crumbs {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px;
  padding-block: 26px 0;
  font-size: 13px; color: var(--pd-quiet);
}
.pd-crumbs a:hover { color: var(--ink); }
.pd-crumbs span[aria-hidden] { color: #c4c4c4; }
.pd-crumbs__here { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- layout */

.pd-main {
  display: grid;
  grid-template-columns: minmax(0, 1.64fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  padding: 28px 0 96px;
}

/* --------------------------------------------------------------- gallery */

/* Shots stack, each one the full width of the column. The plate takes its height
   from the photo rather than imposing a fixed `aspect-ratio`: the catalogue
   mixes square and portrait shots, and any fixed frame either letterboxes them
   inside a band of grey or crops them. Full width, own height, nothing lost. */
.pd-gallery { display: grid; gap: var(--pd-gap); }
.pd-gallery > * { min-width: 0; }

.pd-gallery figure { margin: 0; background: var(--pd-shade); }
.pd-gallery img { width: 100%; height: auto; }

/* Gallery shots are not blended into the plate the way the card grids blend
   theirs: at this size a `mix-blend-mode: multiply` visibly darkens the many
   catalogue photos that already ship on a grey sweep, and the plate is close
   enough to that grey to sit flush without it. */

/* ------------------------------------------------------------------ info */

.pd-brand {
  margin: 0 0 14px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--pd-quiet);
}
.pd-brand a:hover { color: var(--ink); }

.pd-title {
  margin: 0 0 22px;
  font-size: clamp(28px, 2.35vw, 44px);
  font-weight: 700; line-height: 1.06; letter-spacing: -.015em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.pd-price { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.pd-price del { color: var(--pd-quiet); font-weight: 400; margin-right: 12px; }
.pd-price ins { color: var(--sale); text-decoration: none; }

.pd-teaser {
  margin: 0 0 34px;
  font-size: 16.5px; line-height: 1.72; color: var(--pd-body);
}

/* ---------------------------------------------------------- size picker */

.pd-label {
  margin: 0 0 14px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--pd-quiet);
}

.pd-sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pd-size { position: relative; }
.pd-size input { position: absolute; opacity: 0; pointer-events: none; }
.pd-size span {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 78px; height: 58px; padding: 0 14px;
  background: var(--pd-shade); color: var(--ink);
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.pd-size:hover span { background: #e4e3e0; }
.pd-size input:checked + span { background: var(--ink); color: #fff; }
.pd-size input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Sold-out sizes keep the chip shape so the grid stays even — they simply
   recede, struck through, on a paler plate. */
.pd-size.is-out span {
  background: #f8f8f8; color: #c2c2c2;
  text-decoration: line-through; cursor: not-allowed;
}
.pd-size.is-out:hover span { background: #f8f8f8; }

/* Low-stock marker: on the chip, and again in the legend below the grid. */
.pd-dot { width: 5px; height: 5px; background: currentColor; flex: none; }
.pd-size input:checked + span .pd-dot { background: #fff; }

.pd-stocknote {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 22px; font-size: 13px; color: var(--ink);
}

.pd-hint { font-size: 12.5px; color: var(--sale); margin: -12px 0 16px; min-height: 16px; }

/* -------------------------------------------------------------- actions */

.pd-actions { display: flex; align-items: stretch; gap: 12px; }

.pd-qty {
  display: flex; align-items: center;
  flex: 0 0 154px; max-width: 154px;
  border: 1px solid var(--line); background: #fff;
}
.pd-qty button {
  flex: 0 0 44px; height: 58px;
  background: none; border: 0; cursor: pointer;
  font-size: 16px; line-height: 1;
}
.pd-qty button:hover { background: var(--pd-shade); }
.pd-qty input {
  flex: 1 1 auto; width: 100%; min-width: 0; height: 58px;
  border: 0; background: none; outline: none;
  font: inherit; font-size: 15px; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.pd-qty input::-webkit-outer-spin-button,
.pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pd-submit {
  flex: 1 1 auto; min-width: 0; height: 58px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--pd-shade); color: var(--ink);
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.pd-submit:hover { background: #e4e3e0; }
.pd-submit--go { background: var(--ink); color: #fff; }
.pd-submit--go:hover { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pd-submit[disabled] { opacity: .4; pointer-events: none; }

/* The call to action only goes live once a size is chosen. Without `:has()`
   the button still reads "Select size" and server-side validation catches it. */
.pd-submit__add { display: none; }
.pd-form:has(input[name="psc_size"]:checked) .pd-submit { background: var(--ink); color: #fff; }
.pd-form:has(input[name="psc_size"]:checked) .pd-submit:hover { background: #262626; }
.pd-form:has(input[name="psc_size"]:checked) .pd-submit__pick { display: none; }
.pd-form:has(input[name="psc_size"]:checked) .pd-submit__add { display: inline; }

.pd-alt { margin: 18px 0 0; font-size: 13px; }
.pd-alt a { color: var(--pd-body); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.pd-alt a:hover { color: var(--ink); border-color: var(--ink); }

/* Upcoming releases are not purchasable — they get the drop panel instead. */
.pd-soon { border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 16px; }
.pd-soon__title { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.pd-soon__text { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--pd-body); }

/* --------------------------------------------------------------- panels */

.pd-acc { margin-top: 42px; border-top: 1px solid var(--line); }
.pd-acc details { border-bottom: 1px solid var(--line); }
.pd-acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 0; cursor: pointer;
  font-size: 15px; font-weight: 600;
  list-style: none;
}
.pd-acc summary::-webkit-details-marker { display: none; }
.pd-acc summary::after { content: '+'; font-size: 20px; font-weight: 300; line-height: 1; color: var(--ink); }
.pd-acc details[open] summary::after { content: '\00d7'; }
.pd-acc summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.pd-acc__panel { padding: 0 0 26px; font-size: 14.5px; line-height: 1.75; color: var(--pd-body); }
.pd-acc__panel--prose > *:first-child { margin-top: 0; }
.pd-acc__panel--prose > *:last-child { margin-bottom: 0; }
.pd-acc__panel--prose ul { margin: 0; padding-left: 18px; }
.pd-acc__panel--prose li { margin-bottom: 6px; }

.pd-specs { display: grid; grid-template-columns: 120px 1fr; gap: 13px 20px; margin: 0; }
.pd-specs dt { color: var(--pd-quiet); }
.pd-specs dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* ---------------------------------------------------- shared section type */

.pd-kicker {
  margin: 0 0 16px;
  font-size: 12px; font-weight: 600; letter-spacing: .17em;
  text-transform: uppercase; color: var(--pd-quiet);
}
.pd-display {
  margin: 0;
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 600; line-height: 1.08; letter-spacing: -.02em;
  text-transform: none;
}
.pd-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 40px;
}
.pd-arrow { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.pd-arrow span { transition: transform .2s var(--ease); }
.pd-arrow:hover span { transform: translateX(5px); }

.pd-underlink {
  display: inline-block;
  font-size: 15px; font-weight: 600;
  border-bottom: 1px solid var(--ink); padding-bottom: 3px;
}

/* ---------------------------------------------------------- styled with */

.pd-section { padding-block: 76px; }

.pd-styled { display: grid; grid-template-columns: repeat(4, 1fr); gap: 35px; }

/* The shop grid draws cards as cells of a hairline table; here they stand apart
   with air between them. Only the frame and the type are re-dressed — the media
   plate keeps the shared card treatment so this rail matches every other grid. */
.pd-styled .product-card { background: none; }
.pd-styled .product-card__body { padding: 20px 0 0; gap: 9px; }
.pd-styled .product-card__brand { font-size: 11.5px; font-weight: 600; letter-spacing: .13em; color: var(--pd-quiet); }
.pd-styled .product-card__name {
  font-size: 16px; font-weight: 600; color: var(--ink);
  text-transform: none; letter-spacing: 0; line-height: 1.35; min-height: 0;
}
.pd-styled .product-card__price { font-size: 15px; font-weight: 600; padding-top: 4px; }
.pd-styled .product-card__sizes { display: none; }

/* --------------------------------------------------------------- archive */

.pd-archive {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
  border-top: 1px solid var(--line);
  padding-block: 92px;
}
.pd-archive__title { margin: 0 0 22px; font-size: clamp(32px, 3.4vw, 54px); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; }
.pd-archive__text { margin: 0 0 26px; max-width: 46ch; font-size: 16.5px; line-height: 1.6; color: var(--pd-body); }
.pd-archive__media img {
  width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--pd-shade);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1280px) {
  .pd-main { gap: 44px; }
  .pd-archive { gap: 48px; }
}

@media (max-width: 1100px) {
  .pd-main { grid-template-columns: 1fr; gap: 34px; padding-bottom: 64px; }
  .pd-styled { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .pd-archive { grid-template-columns: 1fr; gap: 34px; padding-block: 64px; }
  .pd-archive__body { order: 2; }
  .pd-section { padding-block: 56px; }
}

@media (max-width: 760px) {
  .pd { --pd-gap: 12px; }
  /* Under 16px iOS zooms the page in when the field takes focus, and leaves it
     zoomed — on the one control between the shopper and the basket. */
  .pd-qty input { font-size: 16px; }
  .pd-crumbs { font-size: 12px; gap: 5px; }
  .pd-teaser, .pd-archive__text { font-size: 15px; }
  .pd-styled { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
  .pd-styled .product-card__name { font-size: 14px; }
  .pd-size span { min-width: 68px; height: 52px; }
  .pd-qty { flex-basis: 128px; max-width: 128px; }
  .pd-qty button { flex-basis: 36px; height: 52px; }
  .pd-qty input { height: 52px; }
  .pd-submit { height: 52px; font-size: 11px; letter-spacing: .1em; }
}

@media (max-width: 420px) {
  .pd-actions { flex-wrap: wrap; }
  .pd-qty { flex: 1 1 100%; max-width: none; }
  .pd-submit { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------ touch */

@media (hover: none) {
  /* Both are cursor-scale text links: the crumb trail back out of the product,
     and the rail's "view all". Padding only — neither moves on the page. */
  .pd-crumbs a { display: inline-block; padding-block: 8px; }
  .pd-arrow { padding-block: 11px; }
}
