/*
 * Page-specific styles for /products.
 *
 * Shared chrome (page-head, head-meta, crumbs, section-title, filterbar
 * + .ftab, outer .compare section) is in /style.css. What's here:
 *   * page-head h1 sizing variant + lede layout
 *   * .cat-band heading row above each category section
 *   * .pgrid wrapper + .product-grid (12-col) + .product-card with span
 *     variants. Card class is `.product-card` (not `.pcard`) because
 *     the homepage already styles `.pcard` for its own product cards.
 *   * .product-card tone-keyed visuals (vs / frms / drc / bam etc.)
 *   * .compare-scroll + .compare-table + .compare-row (different
 *     class set from bundles' `.cscroll/.ctable/.crow`)
 *   * .merch + .mgrid + .mvis + .mtxt
 */

/* ---------- page header variant ---------- */

.products-head h1 {
  font-size: clamp(56px, 8.4vw, 140px);
}
.products-head .lede {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  margin-top: 48px;
  align-items: end;
}
@media (max-width: 900px) {
  .products-head .lede { grid-template-columns: 1fr; gap: 24px; }
}
.products-head .lede p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-dim);
  max-width: 48ch;
  margin: 0;
  text-wrap: pretty;
}
.products-head .lede em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--fg);
}

/* ---------- category band ---------- */

.cat-band {
  padding: 80px 0 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}
.cat-band .cat-head {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 8px 0 0;
  text-wrap: balance;
}
.cat-band .cat-head em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.cat-band .right {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  text-align: right;
}

/* ---------- product grid ---------- */

.pgrid {
  padding: 0 0 96px;
  border-bottom: 0.5px solid var(--line);
}
.pgrid[hidden] { display: none; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 32px;
  /* Each card sizes to its own content (5/4 visual + body) instead of
     stretching to the tallest card in the row — a narrow s4 card next to
     a wide s8 card would otherwise gain empty space below its body. */
  align-items: start;
}
.product-card {
  position: relative;
  border: 0.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.product-card .visual-link {
  display: block;
  color: inherit;
}
.product-card .visual {
  /* padding-bottom ratio hack (not `aspect-ratio`) so the 5:4 box keeps its
     height on older mobile WebViews where an aspect-ratio-only box whose sole
     child is position:absolute + container-type:inline-size collapses to
     near-zero (shrinking the product shot to a thumbnail). 4/5 = 80%.
     `.product-card.short .visual` below already used this technique. */
  position: relative;
  overflow: hidden;
  height: 0;
  padding-bottom: 80%;
}
.product-card.short .visual {
  aspect-ratio: auto;
  height: 0;
  padding-bottom: calc((4 / 5) * (2 / 3) * 100%);
}

/* .ph glow background + .ph-img product-image rendering live in
   /style.css alongside the .pcard rules, so the homepage and the
   products page share the same treatment. */

/* badges + platform pills overlaid on the visual */
.product-card .badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.product-card .badges .left {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.product-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.product-card .badge.new {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.product-card .badge.free {
  background: rgba(244, 241, 234, 0.95);
  color: var(--bg);
  border-color: transparent;
}
.product-card .platforms {
  display: flex;
  gap: 4px;
}
.product-card .pf {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
:root[data-theme="light"] .product-card .pf { color: #fff; }
/* body */
.product-card .body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 0.5px solid var(--line);
  flex: 1;
}
.product-card .body .top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.product-card .body h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1;
}
.product-card .body h3 a {
  color: inherit;
}
.product-card .body .kind {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.product-card .body p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 13.5px;
  line-height: 1.5;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .body .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 0.5px dashed var(--line);
}
/* Match the expansion-pack card price: accent, mono, 14px (was white 18px
   display). */
.product-card .body .price {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.product-card .body .price .from {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  letter-spacing: 0.06em;
  margin-right: 6px;
}
.product-card .body .price .from + .from { margin-left: 8px; }
.product-card .body .price .free,
.product-card .body .price .on-stores { color: var(--accent); }
/* On-sale cluster (refs #415): pill + promo (bigger) + struck original (~half). */
.product-card .body .price:has(.sale-tag) { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.product-card .body .price .sale-tag { align-self: center; }
.product-card .body .price .now { font-size: 14px; font-weight: 600; }
.product-card .body .price .was {
  font-size: 12px;
  color: var(--fg-faint);
  text-decoration: line-through;
}
/* Promoted (current) price number in the accent colour when on sale (#415).
   The .from / .was labels keep their own explicit colours, so only the promo
   number is accented. */
.product-card .body .price:has(.was) .now { color: var(--accent); }
/* Right-side CTA cluster: inline "Add" + the open-details arrow. */
.product-card .card-ctas {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.product-card .add-cta {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s ease;
}
.product-card .add-cta:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.product-card .arrow-cta {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--fg-dim);
  transition: all 0.25s ease;
  text-decoration: none;
}
.product-card:hover .arrow-cta {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* span variants — 12-col grid */
.product-card.s4  { grid-column: span 4; }
.product-card.s6  { grid-column: span 6; }
.product-card.s8  { grid-column: span 8; }
.product-card.s12 { grid-column: span 12; }
@media (max-width: 1100px) {
  .product-card.s4 { grid-column: span 6; }
  .product-card.s8 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .product-card.s4,
  .product-card.s6,
  .product-card.s8 { grid-column: span 12; }
}

/* ---------- merch ---------- */

.merch {
  padding: 96px 0;
  border-bottom: 0.5px solid var(--line);
}
.merch .merch-head { margin-bottom: 32px; }
.merch .merch-headline {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 8px 0 0;
  text-wrap: balance;
}
.merch .merch-headline em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.mgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 900px) {
  .mgrid { grid-template-columns: 1fr; gap: 20px; }
}
.mvis {
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}
.mvis .lbl {
  position: absolute;
  left: 18px;
  bottom: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.mvis .center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mvis .mart-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mtxt h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(30px, 3.8vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 8px 0 16px;
  text-wrap: balance;
}
.mtxt h3 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.mtxt p {
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.6;
  max-width: 48ch;
  text-wrap: pretty;
}
.mtxt .specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 24px;
  border-top: 0.5px solid var(--line);
}
.mtxt .specs > div {
  padding: 14px 0;
  border-bottom: 0.5px solid var(--line);
  font-size: 13px;
}
.mtxt .specs .spec-k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.mtxt .actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.mtxt .btn {
  cursor: pointer;
}
.mtxt .btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.mtxt .btn.primary:hover {
  background: color-mix(in oklab, var(--accent) 88%, white);
}
