/* ═══════════════════════════════════════════════════════════
   Category listings and product pages.

   Each category keeps its own LAYOUT, not its own colour. The accent,
   theme and radii stay locked to the brand; what changes per category
   is the structure, the density, and which spec leads.

     data-layout="perf"      کارت گرافیک   photo cards with a live FPS meter
     data-layout="platform"  پردازنده      socket bands, a core map per chip
     data-layout="dense"     رم            sortable datasheet table
     data-layout="gallery"   کیس           photo + clearance blueprint tiles
     data-layout="tiers"     سیستم آماده   stacked configuration bands

   The shared frame (hero, 3D stage, filters, compare) is in lab.css.
   ═══════════════════════════════════════════════════════════ */

/* ─── Shared category header (prebuilt page) ─────────────── */
.cathead {
  padding-block: clamp(30px, 4.5vw, 56px) clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(66% 130% at 88% 0%, var(--green-soft), transparent 60%),
    var(--ink);
}
.cathead__inner { display: grid; gap: 12px; }
.cathead h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -.03em;
}
.cathead p { color: var(--text-mid); max-width: 58ch; }

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.crumb a { transition: color .2s; }
.crumb a:hover { color: var(--green); }
.crumb i { font-size: .95rem; }

.cathead__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 4px;
  font-size: .84rem;
  color: var(--text-mute);
}
.cathead__meta b { color: var(--text); font-weight: 700; }

.catbody { padding-block: clamp(22px, 3vw, 36px) var(--gap-section); }

.iconbtn--sm { width: 40px; height: 40px; font-size: 1.1rem; }
@media (hover: none) { .iconbtn--sm { width: 44px; height: 44px; } }

/* ─── Shared listing parts ───────────────────────────────── */
.stock { display: inline-flex; align-items: center; gap: 5px; }
.stock--out i { font-size: .9em; }

/* Meter: one live metric per item, redrawn when the lens changes. */
.meter { display: grid; gap: 7px; }
.meter__head { display: flex; align-items: baseline; gap: 8px; }
.meter__label { font-size: .76rem; color: var(--text-mute); margin-inline-end: auto; }
.meter__label .mono { color: var(--text-mid); font-size: .74rem; }
.meter__label [data-meter-ctx]::before { content: "· "; color: var(--text-mute); }
.meter__est {
  font-size: .64rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  color: var(--text-mute);
}
.meter__val { font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; direction: ltr; line-height: 1; }
.meter__val small { font-size: .7rem; font-weight: 500; color: var(--text-mute); margin-inline-start: 3px; }
.meter__track {
  position: relative;
  height: 6px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--ink) calc(10% - 1px) 10%),
    var(--line);
  overflow: hidden;
}
.meter__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--green-line), var(--green));
  transform-origin: 100% 50%;
  transform: scaleX(var(--v, 0));
}
[dir="rtl"] .meter__fill { background: linear-gradient(270deg, var(--green-line), var(--green)); }
[dir="ltr"] .meter__fill { transform-origin: 0 50%; }
.meter__sub { font-size: .74rem; color: var(--text-mute); }

/* Spec glyphs: icon + mono value, the card's datasheet strip. */
.glyphs {
  list-style: none;
  margin: 0;
  padding: 10px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  border-top: 1px solid var(--line);
}
.glyphs li { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: .8rem; }
.glyphs i { color: var(--text-mute); font-size: 1rem; flex-shrink: 0; }
.glyphs .mono { direction: ltr; white-space: nowrap; }
.glyphs small { font-size: .7rem; color: var(--text-mute); white-space: nowrap; }

/* Fit badge: does this part work with what the buyer already owns. */
.fit {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: .76rem;
  line-height: 1.6;
  border: 1px solid var(--line-2);
  color: var(--text-mid);
}
.fit i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.fit[data-state="ok"] { border-color: var(--green-line); background: var(--green-soft); color: var(--text); }
.fit[data-state="ok"] i { color: var(--green); }
.fit[data-state="no"] { border-style: dashed; }
.fit .mono { direction: ltr; unicode-bidi: isolate; }

.is-dim { opacity: .5; }

/* Filtered out. A class, not [hidden]: GSAP Flip needs to set an inline
   display on leaving items, and [hidden] is !important. */
.is-filtered { display: none; }

/* Pointer light, brand green only. */
@media (hover: hover) {
  .gcard, .ccard, .ctile {
    background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), var(--green-soft), transparent 42%);
  }
}

/* List empty state. */
.nil--list {
  padding: 56px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
}
.nil__near {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .84rem;
  text-align: start;
}
.nil__near img { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; }

/* Scan line while a new result set is computed. */
.catbody .wrap { position: relative; }
.scanline {
  position: absolute;
  inset-inline: var(--pad);
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0;
  pointer-events: none;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.card-acts { display: flex; align-items: center; gap: 6px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brandtag { font-size: .72rem; color: var(--text-mute); direction: ltr; letter-spacing: .02em; }

/* ─── perf: کارت گرافیک ──────────────────────────────────── */
[data-layout="perf"] .glist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.gcard {
  --heat: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background-color: var(--surface);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}
.gcard:hover, .gcard:focus-within { border-color: var(--green-line); box-shadow: var(--shadow); }
.gcard__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.gcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.gcard:hover .gcard__media img { transform: scale(1.03); }

/* Heat: the one green rises from the heatsink edge, scaled by TDP. */
.gcard__heat {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top,
      color-mix(in srgb, var(--green) calc(var(--heat) * 62%), transparent) 0%,
      color-mix(in srgb, var(--green) calc(var(--heat) * 18%), transparent) 38%,
      transparent 70%);
  mix-blend-mode: screen;
}
[data-theme="light"] .gcard__heat { mix-blend-mode: multiply; }
.gcard__thermo {
  position: absolute;
  inset-inline: 12px;
  inset-block-end: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgba(7, 9, 10, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: .7rem;
  color: #E9EDEA;
  direction: ltr;
  opacity: calc(.7 + var(--heat) * .3);
}
.gcard__thermo i {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden;
  position: relative;
}
.gcard__thermo i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  transform-origin: 0 50%;
  transform: scaleX(var(--heat));
}
.gcard__body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; flex: 1; }
.gcard__name { font-size: 1rem; line-height: 1.5; }
.gcard__name a:hover { color: var(--green); }
.gcard.is-out .gcard__media img { filter: grayscale(1) brightness(.7); }
.gcard.is-out .meter__fill { background: var(--line-2); }

/* ─── platform: پردازنده ─────────────────────────────────── */
[data-layout="platform"] .platband + .platband { margin-top: clamp(26px, 4vw, 44px); }
.platband__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 4px 18px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.platband__socket { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; letter-spacing: -.03em; direction: ltr; line-height: 1; }
.platband__note { font-size: .84rem; color: var(--text-mute); }
.platband__n { font-size: .78rem; color: var(--text-mute); direction: ltr; }
.platband__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ccard {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background-color: var(--surface);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.ccard:hover, .ccard:focus-within { border-color: var(--green-line); box-shadow: var(--shadow); }

/* The die: a core map drawn from the real core counts. */
.ccard__die {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 18px 12px;
  background:
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px),
    var(--surface-2);
  border-inline-end: 1px solid var(--line);
}
.coremap { display: flex; gap: 6px; direction: ltr; }
.ccd {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), var(--cell, 22px));
  gap: 4px;
  padding: 5px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--ink);
}
.core {
  --load: 0;
  display: block;
  width: var(--cell, 22px); height: var(--cell, 22px);
  border-radius: 3px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--green) calc(var(--load) * 100%), var(--surface-2));
  box-shadow: 0 0 calc(var(--load) * 12px) color-mix(in srgb, var(--green) calc(var(--load) * 70%), transparent);
}
.core--e {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 2px;
  background: transparent;
  box-shadow: none;
}
.core--e b {
  border-radius: 1px;
  background: color-mix(in srgb, var(--green) calc(var(--load) * 60%), var(--surface-2));
}
.vcache {
  font-size: .6rem;
  color: var(--text-mute);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  direction: ltr;
  letter-spacing: .04em;
}
.ccard__ghz { font-size: .78rem; color: var(--text-mute); direction: ltr; }
.ccard__ghz b { font-size: 1.1rem; color: var(--text); font-weight: 700; }
.ccard__body { display: flex; flex-direction: column; gap: 11px; padding: 16px 18px 18px; min-width: 0; }
.ccard__name { font-size: 1rem; line-height: 1.5; }
.ccard__name a:hover { color: var(--green); }
.ccard__arch { font-size: .78rem; color: var(--text-mid); direction: ltr; text-align: end; }
[dir="rtl"] .ccard__arch { text-align: right; }

/* ─── dense: رم ──────────────────────────────────────────── */
/* Horizontal scrolling only. With overflow-y left to compute as auto, a row
   still offset by the scroll reveal (translateY 22px, opacity 0) made the
   wrapper scroll vertically too and drew a stray scrollbar beside the table. */
.rtable-wrap { overflow-x: auto; overflow-y: hidden; }
.rtable {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.rtable th, .rtable td {
  padding: 14px 12px;
  text-align: start;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.rtable thead th {
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  padding-block: 10px;
}
.rtable thead button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  margin-inline: -8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.rtable thead button:hover { color: var(--text); background: var(--surface); }
.rtable thead [aria-sort="ascending"] button, .rtable thead [aria-sort="descending"] button { color: var(--green); }
.rtable thead i { font-size: .9rem; }
.rrow { transition: background-color .2s; }
.rrow:hover { background: var(--surface); }
.rrow__mod { display: flex; align-items: center; gap: 12px; min-width: 250px; font-weight: 400; }
.rrow__mod img { width: 72px; height: 54px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex-shrink: 0; }
.rrow__who { display: grid; gap: 2px; min-width: 0; }
.rrow__who a { font-weight: 700; font-size: .92rem; }
.rrow__who a:hover { color: var(--green); }
.rrow__who small { font-size: .74rem; color: var(--text-mute); }
.rrow__who .fit { margin-top: 6px; }
.rtable td .mono { direction: ltr; white-space: nowrap; display: inline-block; }
.rrow__freq { min-width: 150px; }
.rrow__freq .mono { display: block; }
.wave { display: block; width: 120px; height: 18px; margin-bottom: 4px; overflow: visible; }
.wave path { fill: none; stroke-width: 1.3; stroke-linecap: round; }
.wave__base { stroke: var(--line-2); }
.wave__sig { stroke: var(--green); stroke-dasharray: 18 400; stroke-dashoffset: 18; opacity: 0; }
.rrow:hover .wave__sig, .rrow:focus-within .wave__sig { opacity: 1; }
.rrow__price { white-space: nowrap; }
.rrow__acts { white-space: nowrap; }
.rrow__acts .card-acts { justify-content: flex-end; }
.lat--best { color: var(--green); }
.rrow.is-out .rrow__mod img { filter: grayscale(1) brightness(.7); }

/* ─── gallery: کیس ───────────────────────────────────────── */
[data-layout="gallery"] .tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.ctile {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background-color: var(--surface);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.ctile:hover, .ctile:focus-within { border-color: var(--green-line); box-shadow: var(--shadow); }
.ctile.is-lead {
  grid-column: span 2;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
}
.ctile__media { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.ctile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.ctile:hover .ctile__media img { transform: scale(1.03); }
.ctile.is-lead .ctile__media { grid-row: span 2; aspect-ratio: auto; min-height: 100%; }

.ctile__plan {
  padding: 16px 18px 6px;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 16px);
  background-color: var(--surface-2);
}
.plan { display: block; width: 100%; max-width: 400px; height: auto; margin-inline: auto; overflow: visible; direction: ltr; }
.ctile.is-lead .ctile__plan { display: grid; align-items: center; padding-block: 22px 12px; }
.plan path, .plan rect { fill: none; vector-effect: non-scaling-stroke; }
.plan .bp-shell { stroke: var(--text-mid); stroke-width: 1.2; }
.plan .bp-shell.is-unknown { stroke-dasharray: 4 4; stroke: var(--text-mute); }
.plan .bp-board { stroke: var(--line-2); stroke-width: 1; }
.plan .bp-gpu, .plan .bp-cool { stroke: var(--green); stroke-width: 2.4; }
.plan .bp-dim { stroke: var(--text-mute); stroke-width: .8; }
.plan .bp-ghost { stroke: var(--text); stroke-width: 1.4; stroke-dasharray: 3 3; opacity: 0; }
.plan .bp-ghost.is-no { stroke-dasharray: 1 3; }
.plan text { font-family: var(--mono); font-size: 8.5px; fill: var(--text-mute); }
.plan .bp-num { fill: var(--green); font-weight: 600; }
.plan .bp-title { fill: var(--text-mid); font-size: 7.5px; letter-spacing: .06em; }

.ctile__body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.ctile__name { font-size: 1.02rem; line-height: 1.5; }
.ctile__name a:hover { color: var(--green); }
.ctile__fit {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.ctile__fit > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
.ctile__fit dt { color: var(--text-mute); }
.ctile__fit dd { margin: 0; font-weight: 600; direction: ltr; white-space: nowrap; }
.ctile.is-out .ctile__media img { filter: grayscale(1) brightness(.7); }

/* ─── tiers: سیستم آماده ─────────────────────────────────── */
[data-layout="tiers"] .tier {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color .22s;
}
[data-layout="tiers"] .tier:hover { border-color: var(--green-line); }
[data-layout="tiers"] .tier + .tier { margin-top: 16px; }
[data-layout="tiers"] .tier--top {
  background: linear-gradient(255deg, var(--green-soft), transparent 58%), var(--surface);
  border-color: var(--green-line);
}
[data-layout="tiers"] .tier__media {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 11;
  background: var(--surface-2);
}
[data-layout="tiers"] .tier__media img { width: 100%; height: 100%; object-fit: cover; }
[data-layout="tiers"] .tier__body { display: grid; gap: 14px; }
[data-layout="tiers"] .tier__body h2 { font-size: clamp(1.15rem, 2.2vw, 1.5rem); letter-spacing: -.02em; }
[data-layout="tiers"] .tier__for { color: var(--text-mid); font-size: .92rem; }
[data-layout="tiers"] .tier__parts { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 22px; }
[data-layout="tiers"] .tier__parts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
}
[data-layout="tiers"] .tier__parts dt { color: var(--text-mute); flex-shrink: 0; }
[data-layout="tiers"] .tier__parts dd { margin: 0; font-weight: 600; text-align: end; }
[data-layout="tiers"] .tier__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
[data-layout="tiers"] .tier__draw { font-size: .8rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* ─── Single product ─────────────────────────────────────── */
.pdp { padding-block: clamp(26px, 4vw, 44px) var(--gap-section); }
.pdp__top {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: 18px;
}
.pdp__media {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 4 / 3;
}
.pdp__media img { width: 100%; height: 100%; object-fit: cover; }
.pdp__stage { position: sticky; top: 90px; }

.pdp__info { display: grid; gap: 16px; }
.pdp__info h1 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800; letter-spacing: -.025em; }
.pdp__lede { color: var(--text-mid); }
.pdp__price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-block: 4px; }
.pdp__price strong { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.pdp__price small { font-size: .78rem; font-weight: 500; color: var(--text-mute); }
.pdp__buy { display: flex; gap: 12px; flex-wrap: wrap; }

.pdp__specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
}
.pdp__specs > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.pdp__specs dt { font-size: .74rem; color: var(--text-mute); margin-bottom: 4px; }
.pdp__specs dd { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pdp__specs dd.mono { direction: ltr; text-align: right; }
[dir="ltr"] .pdp__specs dd.mono { text-align: left; }

.pdp__fit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  font-size: .88rem;
  line-height: 1.7;
}
.pdp__fit i { color: var(--green); font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.pdp__fit a { color: var(--green); font-weight: 700; }

.pdp__out {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px dashed var(--line-2);
  font-size: .88rem;
  color: var(--text-mid);
}
.pdp__out b { color: var(--text); }

.pdp__related { margin-top: clamp(40px, 6vw, 72px); }
.pdp__related h2 { font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 18px; }
.pdp__related .grid { grid-template-columns: repeat(4, 1fr); }

/* ─── Homepage: parts strip ──────────────────────────────── */
.parts { padding-block: 0 var(--gap-section); }
.parts__grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.partcard {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .22s, transform .22s var(--ease);
}
.partcard:hover { border-color: var(--green-line); transform: translateY(-3px); }
.partcard__media { aspect-ratio: 16 / 10; background: var(--surface-2); }
.partcard__media img { width: 100%; height: 100%; object-fit: cover; }
.partcard__body { padding: 18px 20px 20px; display: grid; gap: 10px; align-content: start; }
.partcard__body h3 { font-size: 1.05rem; letter-spacing: -.01em; }
.partcard__body p { font-size: .87rem; color: var(--text-mute); }
.partcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; font-size: .84rem; }
.partcard__from { color: var(--text-mute); }
.partcard__from b { color: var(--text); font-weight: 700; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  [data-layout="perf"] .glist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platband__grid { grid-template-columns: 1fr; }
  .pdp__related .grid { grid-template-columns: repeat(2, 1fr); }
  .parts__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  [data-layout="tiers"] .tier { grid-template-columns: 1fr; }
  .pdp__top { grid-template-columns: 1fr; }
  .pdp__stage { position: static; }
  .ctile.is-lead { grid-template-columns: 1fr; }
  .ctile.is-lead .ctile__media { grid-row: auto; aspect-ratio: 4 / 3; }

  /* The datasheet table reflows into one card per module, so its wrapper
     no longer needs to be a scroll container at all. */
  .rtable-wrap { overflow: visible; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody { display: block; }
  .rrow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  /* .rtable in front: the desktop `.rtable td` rule is more specific than
     `.rrow > *` and kept every cell's border and 14px padding. */
  .rtable .rrow > * { border: 0; padding: 0; }
  .rtable .rrow > th { grid-column: 1 / -1; }
  .rrow__mod { min-width: 0; }
  .rrow td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .7rem;
    color: var(--text-mute);
    margin-bottom: 2px;
  }
  .rrow__freq { min-width: 0; }
  .rrow__price { grid-column: 1 / 3; align-self: center; }
  .rrow__acts { grid-column: 3; align-self: center; }
}

@media (max-width: 640px) {
  [data-layout="perf"] .glist,
  [data-layout="gallery"] .tiles,
  .parts__grid,
  .pdp__related .grid { grid-template-columns: 1fr; }
  .ctile.is-lead { grid-column: auto; }
  [data-layout="tiers"] .tier__parts { grid-template-columns: 1fr; }
  .pdp__buy .btn { flex: 1; }
  .ccard { grid-template-columns: 1fr; }
  .ccard__die { border-inline-end: 0; border-bottom: 1px solid var(--line); grid-auto-flow: column; justify-content: space-between; padding-inline: 18px; }
  /* Three figures per line and price beside the buttons: measured at 589 px
     a row when every label stacked in half-width cells. The waveform only
     animates on hover, which a phone does not have. */
  .rrow { gap: 8px 10px; padding-block: 14px; }
  .rrow .wave { display: none; }
  /* Price and buttons share row 4 from opposite ends. The 3D button is
     dropped here: it swaps the model at the top of the page, which on a
     phone scrolls the reader away from the table they are comparing. */
  .rtable .rrow__price { grid-column: 1 / -1; grid-row: 4; align-self: center; }
  .rtable .rrow__acts { grid-column: 1 / -1; grid-row: 4; justify-self: end; }
  .rrow [data-stage] { display: none; }
  .ctile__fit { grid-template-columns: 1fr; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .card-acts { justify-content: space-between; }
  .card-acts .btn { flex: 1; }
}
