/* product.css -- V4 P7 product page (docs/DESIGN-V4-MARKETPLACE.md section 6).
   Loaded through {% block extra_css %} only when the V4 store model is
   present (body.pdp). It ships BEFORE the article/guide bundle, so every
   override of an article.css product rule carries body.pdp.product. */
body.pdp.product main .wrap { max-width: 1320px; }
body.pdp.product h1 { font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 12px; }

/* ---- Top module: media / summary / buy panel ---- */
.pdp-top {
  display: grid; gap: 20px 32px; margin: 0 0 36px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "media" "head" "buy" "specs";
}
.pdp-media { grid-area: media; min-width: 0; }
.pdp-head { grid-area: head; min-width: 0; }
.pdp-specs { grid-area: specs; }
.buy-panel { grid-area: buy; min-width: 0; }
@media (min-width: 1024px) {
  .pdp-top {
    grid-template-columns: minmax(0, 4fr) minmax(0, 4.2fr) minmax(340px, 3.8fr);
    grid-template-areas: "media head buy" "media specs buy";
    grid-template-rows: auto 1fr; align-items: start;
  }
  .buy-panel { position: sticky; top: 80px; }
}

/* ---- Media: gallery / spec tile ---- */
body.pdp .pdp-gallery.product-gallery { display: block; max-width: none; margin: 0; }
.pdp-main {
  display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--image-well); border: 1px solid var(--hairline);
  border-radius: var(--r-card); cursor: zoom-in;
}
@media (min-width: 1024px) { .pdp-main { aspect-ratio: 1 / 1; } }
.pdp-main img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.pdp-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 2px; }
.pdp-thumb {
  flex: none; width: 64px; height: 64px; padding: 0; cursor: pointer;
  background: var(--image-well); border: 1px solid var(--hairline); border-radius: var(--r-line);
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pdp-thumb.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pdp-media .photo-credit { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

.pdp-tile {
  --bg: var(--fam-work-bg); --fg: var(--fam-work-ink);
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; padding: 22px;
  background: var(--bg); color: var(--fg); border-radius: var(--r-tile);
}
.pdp-tile.fam-kitchen { --bg: var(--fam-kitchen-bg); --fg: var(--fam-kitchen-ink); }
.pdp-tile.fam-home { --bg: var(--fam-home-bg); --fg: var(--fam-home-ink); }
.pdp-tile.fam-tech { --bg: var(--fam-tech-bg); --fg: var(--fam-tech-ink); }
.pdp-tile.fam-maker { --bg: var(--fam-maker-bg); --fg: var(--fam-maker-ink); }
.pdp-tile.fam-health { --bg: var(--fam-health-bg); --fg: var(--fam-health-ink); }
.pdp-tile::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px solid var(--tile-rule); border-radius: calc(var(--r-tile) - 3px);
}
.pdp-wm { margin: 0; font-weight: 700; letter-spacing: 0.06em; line-height: 1.12; font-size: 24px; position: relative; }
.pdp-wm.s-m { font-size: 20px; }
.pdp-wm.s-l { font-size: 16px; }
.pdp-tile-specs {
  position: absolute; left: 22px; bottom: 20px; right: 132px; margin: 0; padding: 0; list-style: none;
  font: 12.5px/1.45 var(--font-mono);
}
.pdp-tile-specs li { margin: 0 0 3px; }
.pdp-glyph { position: absolute; right: 22px; bottom: 22px; width: 96px; height: 96px; }
.pdp-ghost { position: absolute; right: -40px; bottom: -40px; width: 200px; height: 200px; opacity: 0.1; }
.pdp-tile-cap { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---- Summary ---- */
.pdp-head .eyebrow { margin-bottom: 8px; }
.pdp-head .dek { font-size: 16px; line-height: 1.55; max-width: none; }
.pdp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
/* Reviewer UX pass 2026-10-01: the badges themselves are the shared .chip
   classes from cards.css (chip-mint / chip-warm) -- the old .pdp-badge mint
   box coloured the owner-signals badge differently from the cards. */
.pdp-specs h2 { font-size: 12.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.pdp-specs ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 24px; }
.pdp-specs li { margin: 0; padding: 9px 0; border-top: 1px solid var(--hairline); font-size: 14.5px; line-height: 1.4; }

/* ---- Buy panel ---- */
.buy-panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: 16px; scroll-margin-top: 80px; }
.bp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bp-head h2 { font-size: 19px; letter-spacing: -0.015em; }
.bp-count { font: 600 12px var(--font-mono); color: var(--muted); }
.bp-from { margin: 6px 0 4px; font: 700 14px var(--font-mono); color: var(--ink); }
.bp-gh { margin: 14px 0 2px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.bp-list { list-style: none; margin: 0; padding: 0; }
.bp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0; padding: 10px 0; min-height: 56px; border-top: 1px solid var(--hairline-soft);
}
.bp-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bp-store { font-weight: 600; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.bp-sub { font-size: 12.5px; line-height: 1.3; color: var(--muted); overflow-wrap: break-word; }
.bp-price { font-family: var(--font-mono); font-size: 13px; }
.bp-amt { font-size: 15px; color: var(--ink); }
/* Price battle (owner 2026-10-01): cheapest fresh price gets a quiet mint mark. */
.bp-row.is-lowest .bp-amt { color: var(--brand); }
.bp-low {
  display: inline-block; margin-left: 6px; padding: 2px 8px; vertical-align: 1px;
  font-size: 11.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  color: var(--mint-ink); background: var(--mint); border-radius: var(--r-chip);
}
a.bp-go {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px; white-space: nowrap; font-size: 14px; font-weight: 600;
  color: var(--brand); border: 1px solid var(--line-strong); border-radius: var(--r-line);
}
a.bp-go::after { content: "\2197"; margin-left: 6px; font-size: 13px; }
a.bp-go:hover { background: var(--surface-soft); text-decoration: none; }
.buy-panel details.bp-more { margin: 8px 0 0; padding: 0; border: 0; background: none; }
.bp-more > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--brand); }
.bp-pending, .bp-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.buy-panel .target-range { margin: 12px 0 0; font-size: 14px; }

/* ---- Evidence column ---- */
.pdp-evidence { display: block; }
.pdp-jump ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.pdp-jump li { margin: 0; }
.pdp-jump a { display: inline-block; padding: 7px 12px; font-size: 13.5px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-chip); }
.pdp-sections { max-width: 760px; min-width: 0; }
.pdp-sections > section, .pdp-sections > aside { scroll-margin-top: 80px; }
@media (min-width: 1280px) {
  .pdp-evidence { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 0 56px; align-items: start; }
  .pdp-jump { grid-column: 2; grid-row: 1; position: sticky; top: 88px; }
  .pdp-sections { grid-column: 1; grid-row: 1; }
  .pdp-jump ul { flex-direction: column; gap: 0; }
  .pdp-jump a { padding: 6px 12px; border: 0; border-left: 2px solid var(--hairline); border-radius: 0; background: none; }
  .pdp-jump a:hover { border-left-color: var(--brand); text-decoration: none; }
}

.pdp-owners, .pdp-sources, .pdp-related, .pdp-lite { margin: 0 0 32px; }
.pdp-owners h3 { font-size: 15px; margin: 16px 0 6px; }
.pdp-owners ul { margin: 0 0 8px 18px; }
.pdp-owners li { font-size: 15px; line-height: 1.5; }
.pdp-owners-label { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.pdp-pill { display: inline-block; margin-right: 6px; padding: 3px 9px; font: 600 12px var(--font-body); border-radius: var(--r-chip); background: var(--warm); color: var(--warm-ink); }
.pdp-cols { display: grid; gap: 0 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .pdp-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pdp-owners-src { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.pdp-lite { padding: 18px 22px; background: var(--warm); color: var(--warm-ink); border-radius: var(--r-card); }
.pdp-lite h2 { font-size: 18px; margin: 0 0 6px; }
.pdp-lite p { margin: 0; font-size: 15px; }
.pdp-sources dt { margin: 12px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pdp-sources dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.pdp-sources p { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }

.rel-list { list-style: none; margin: 12px 0 0; padding: 0; }
.rel-list li { margin: 0; }
.rel-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 6px; border-top: 1px solid var(--hairline); color: var(--ink);
}
.rel-row:hover { background: var(--surface-soft); text-decoration: none; }
.rel-media { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-line); overflow: hidden; background: var(--fam-work-bg); color: var(--fam-work-ink); }
.rel-media img { width: 100%; height: 100%; object-fit: contain; background: var(--image-well); }
.rel-media svg { width: 28px; height: 28px; }
.rel-media.fam-kitchen { background: var(--fam-kitchen-bg); color: var(--fam-kitchen-ink); }
.rel-media.fam-home { background: var(--fam-home-bg); color: var(--fam-home-ink); }
.rel-media.fam-tech { background: var(--fam-tech-bg); color: var(--fam-tech-ink); }
.rel-media.fam-maker { background: var(--fam-maker-bg); color: var(--fam-maker-ink); }
.rel-media.fam-health { background: var(--fam-health-bg); color: var(--fam-health-ink); }
.rel-main { display: flex; flex-direction: column; min-width: 0; }
.rel-name { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.rel-spec { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-meta { font: 12.5px var(--font-mono); color: var(--ink-soft); text-align: right; }
@media (max-width: 639px) {
  .rel-row { grid-template-columns: 44px minmax(0, 1fr); }
  .rel-meta { grid-column: 2; text-align: left; }
}

/* ---- Mobile bottom bar (no JS) ---- */
.pdp-bar { display: none; }
@media (max-width: 1023px) {
  body.pdp { padding-bottom: 76px; }
  .pdp-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    align-items: center; justify-content: space-between; gap: 12px; min-height: 56px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--hairline);
  }
  .pdp-bar-txt { font-size: 14px; }
  .pdp-bar .cta { min-height: 44px; padding: 0 20px; font-size: 15px; }
}

/* ---- Lightbox (<dialog>) ---- */
.pdp-lb { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; background: transparent; color: #fff; }
.pdp-lb::backdrop { background: rgba(4, 10, 7, 0.92); }
.pdp-lb[open] { display: flex; align-items: center; justify-content: center; }
.pdp-lb-img { max-width: min(1120px, 90vw); max-height: 88vh; width: auto; height: auto; object-fit: contain; background: #fff; border-radius: 12px; cursor: pointer; }
.pdp-lb-x, .pdp-lb-nav {
  position: absolute; cursor: pointer; color: #fff; line-height: 1;
  background: rgba(15, 24, 19, 0.82); border: 1px solid rgba(255, 255, 255, 0.25);
}
.pdp-lb-x { top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 999px; font-size: 28px; }
.pdp-lb-nav { top: 50%; width: 44px; height: 64px; margin-top: -32px; border-radius: 12px; font-size: 36px; }
.pdp-lb-prev { left: 10px; }
.pdp-lb-next { right: 10px; }

/* Section headings in the review column: the global h2 (38px) is a homepage
   size; at 26px the dossier sections read as one document, not stacked posters. */
.pdp-sections .at-a-glance h2, .pdp-sections .pdp-owners h2, .pdp-sections .size-context h2,
.pdp-sections .product-review h2, .pdp-sections .pdp-sources h2, .pdp-sections .pdp-related h2 {
  font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px;
}
.pdp-sections > section + section, .pdp-sections > section + aside { margin-top: 40px; }
@media (max-width: 600px) {
  .pdp-sections .at-a-glance h2, .pdp-sections .pdp-owners h2, .pdp-sections .size-context h2,
  .pdp-sections .product-review h2, .pdp-sections .pdp-sources h2, .pdp-sections .pdp-related h2 { font-size: 23px; }
}
.pdp-head .byline{margin-top:8px}

/* ---- Pros / cons (editor pass 2026-10-01) ---- */
.pdp-sections .glance-summary { font-size: 16px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 14px; }
.pdp-sections .glance-cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .pdp-sections .glance-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pdp-sections .glance-col { padding: 16px 18px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--hairline); }
.pdp-sections .glance-col h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pdp-sections .glance-pros h3 { color: var(--mint-ink); }
.pdp-sections .glance-cons h3 { color: var(--warm-ink); }
.pdp-sections .glance-col ul { list-style: none; margin: 0; padding: 0; }
.pdp-sections .glance-col li { position: relative; margin: 0; padding: 7px 0 7px 22px; font-size: 15px; line-height: 1.45; border-top: 1px solid var(--hairline-soft); }
.pdp-sections .glance-col li:first-child { border-top: 0; }
.pdp-sections .glance-col li::before { position: absolute; left: 2px; top: 6px; font-weight: 700; }
.pdp-sections .glance-pros li::before { content: "+"; color: var(--mint-ink); }
.pdp-sections .glance-cons li::before { content: "\2212"; color: var(--warm-ink); }

/* Reading size (owner 2026-10-01: "text is a bit small"). */
.pdp-sections .product-review p, .pdp-sections .product-review li { font-size: 17px; line-height: 1.62; }
.pdp-sections .glance-col li, .pdp-owners li { font-size: 16px; }
.pdp-head .dek { font-size: 17.5px; }
.pdp-manual { margin: 10px 0 0; font-size: 14.5px; font-weight: 600; }
.pdp-manual a::after { content: " \2197"; }

/* Parts & consumables (owner 2026-10-07): static, no JS. */
.pdp-parts { margin: 26px 0; }
.pdp-parts h2 { margin: 0 0 6px; }
.parts-intro { margin: 0 0 16px; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.pdp-parts .part { padding: 16px 18px; margin: 0 0 12px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--hairline); }
.pdp-parts .part-name { margin: 0 0 6px; font-size: 17px; }
.pdp-parts .part-no { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.pdp-parts .part-when, .pdp-parts .part-why { margin: 0 0 4px; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.pdp-parts .part-when-label { font-weight: 700; }
.pdp-parts .part-options { list-style: none; margin: 10px 0 0; padding: 0; }
.pdp-parts .part-opt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 0; border-top: 1px solid var(--hairline-soft); }
.pdp-parts .part-opt:first-child { border-top: 0; }
.pdp-parts .part-opt-link { font-size: 15px; font-weight: 600; }
.pdp-parts .part-opt-meta { font-size: 13.5px; color: var(--ink-soft); }
.pdp-parts .part-kind { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: var(--hairline-soft); }
.pdp-parts .part-kind-oem { background: var(--mint-ink); color: #fff; }
.pdp-parts .part-seen { font-style: italic; }

/* Other versions (owner 2026-10-09): static list, no JS, no prices. */
.variants { margin: 14px 0 0; }
.variants h2 { margin: 0 0 6px; font-size: 17px; }
.variants ul { list-style: none; margin: 0; padding: 0; }
.variants li { padding: 8px 0; border-top: 1px solid var(--hairline-soft); }
.variants li:first-child { border-top: 0; }
.variants li a { font-size: 15px; font-weight: 600; }
.variants-more { margin: 8px 0 0; }
.variants-more a { font-size: 14.5px; font-weight: 600; }

/* Owner 10-11: the tall buy panel left a big empty gap under the photo/specs. On desktop the whole page is one
   grid: the buy panel owns the right column, everything below the card moves up into the left two columns. */
@media (min-width: 1024px) {
  body.pdp.product main .wrap {
    display: grid; column-gap: 32px; align-items: start;
    grid-template-columns: minmax(0, 4fr) minmax(0, 4.2fr) minmax(340px, 3.8fr);
    grid-template-areas: "crumb crumb crumb" "media head buy" "media specs buy" "var var buy" "ev ev buy";
    grid-template-rows: auto auto auto auto 1fr;
  }
  body.pdp.product main .wrap > .breadcrumb { grid-area: crumb; }
  body.pdp.product .pdp-top { display: contents; }
  body.pdp.product .pdp-head { margin-bottom: 16px; }
  body.pdp.product .pdp-specs { margin-bottom: 28px; }
  body.pdp.product .buy-panel { position: static; margin-bottom: 36px; }
  body.pdp.product .buy-panel .bp-info { min-width: 5.5em; }
  body.pdp.product main .wrap > .variants { grid-area: var; margin: 0 0 28px; }
  body.pdp.product main .wrap > .pdp-evidence { grid-area: ev; display: block; min-width: 0; }
  body.pdp.product .pdp-evidence .pdp-jump { position: static; }
  body.pdp.product .pdp-evidence .pdp-jump ul { flex-direction: row; gap: 8px; }
  body.pdp.product .pdp-evidence .pdp-jump a { padding: 7px 12px; border: 1px solid var(--hairline); border-radius: var(--r-chip); background: var(--surface); }
}
@media (min-width: 1024px) { body.pdp.product .buy-panel a.bp-go { flex: 0 1 auto; white-space: normal; text-align: center; } }
