/* ═══════════════════════════════════════════════════════════════════════
   products.css — the physical-product surfaces. Built on zarnoush.css.
   Product objects photographed on a warm assay ground; the spec sheet is
   a struck ledger.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── product card ─────────────────────────────────────────────────── */
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; min-width: 0; }
.pcard .art {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 14px;
  background-color: #F3F0E9;
  background-image: radial-gradient(130% 110% at 50% 0%, #F8F4EB, #EEE7D9);
}
.dark .pcard .art { background: radial-gradient(130% 110% at 50% 0%, #17222F, #0C131E); }
.pcard .art img { width: 100%; height: 100%; object-fit: contain; transition: transform .55s var(--ease); }
.pcard:hover .art img { transform: scale(1.05) rotate(-1deg); }
.pcard .art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 120%, rgba(201,151,63,.14), transparent 60%);
}
.pcard .cls {
  position: absolute; top: 11px; inset-inline-end: 11px; z-index: 1;
  font-size: 12px; font-weight: 800; letter-spacing: .01em; padding: 4px 10px; border-radius: 999px;
  background: rgba(15,24,36,.85); color: var(--gold-soft); backdrop-filter: blur(4px);
}
.pcard .body { display: flex; flex: 1; flex-direction: column; padding: 15px 17px 16px; }
.pcard .cat { display: block; margin-bottom: 1rem; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--gold-deep); }
.dark .pcard .cat { color: var(--gold-hi); }
.pcard h3, .pcard h2 { margin: 0; }
.pcard .price {
  margin-top: .8rem; padding-top: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--line);
}
.pcard .price b { font-size: 14.5px; font-weight: 800; letter-spacing: -.02em; }
.pcard .price span { font-size: 12px; color: var(--ink-500); }
.dark .pcard .price span { color: rgba(255,255,255,.55); }

/* ── product class tile ───────────────────────────────────────────── */
.class-tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: clamp(180px, 26vw, 240px); padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--ink-950);
}
.dark .class-tile { border-color: rgba(255,255,255,.08); }
.class-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .8s var(--ease); }
.class-tile:hover img { transform: scale(1.05); }
.class-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,13,21,.15) 0%, rgba(8,13,21,.35) 42%, rgba(8,13,21,.9) 100%);
}
.class-tile > * { position: relative; z-index: 1; color: #fff; }
.class-tile .n { font-weight: 800; letter-spacing: -.02em; font-size: clamp(.95rem, .85rem + .6vw, 1.2rem); text-shadow: 0 1px 8px rgba(8,13,21,.5); }
.class-tile .w { font-size: 12px; color: rgba(255,255,255,.78); margin-top: 4px; }

/* ── single product ──────────────────────────────────────────────── */
.pstage {
  aspect-ratio: 1 / 1; border-radius: var(--r-media); overflow: hidden;
  background-color: #F3F0E9;
  background-image: radial-gradient(130% 110% at 50% 0%, #F8F4EB, #EEE7D9);
  display: grid; place-items: center; padding: 1.75rem; padding: clamp(1.2rem, .8rem + 2vw, 2.4rem);
  box-shadow: var(--lift-media);
}
.dark .pstage { background: radial-gradient(130% 110% at 50% 0%, #17222F, #0C131E); }
.pstage img { width: 100%; height: 100%; object-fit: contain; }
.pthumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.pthumb {
  aspect-ratio: 1 / 1; border-radius: var(--r-control); overflow: hidden; padding: 8px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--paper-deep);
}
.dark .pthumb { border-color: rgba(255,255,255,.08); background: var(--surface); }
.pthumb[aria-current="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,151,63,.22); }
.pthumb img { width: 100%; height: 100%; object-fit: contain; }

/* The packshots are portrait (about 9:16). Uncapped, one photo filled the whole first screen on a phone
   and pushed the price and the buy button below the fold. */
.pgallery-main { display: flex; justify-content: center; }
.pgallery-main img { display: block; width: auto; max-width: 100%; height: auto; max-height: 44vh; object-fit: contain; }
@media (min-width: 1024px) { .pgallery-main img { max-height: 72vh; } }

/* the spec sheet: a struck ledger */
.spec { border-top: 1px solid var(--line-strong); }
.spec div {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.spec dt { color: var(--ink-500); font-weight: 600; }
.dark .spec dt { color: rgba(255,255,255,.55); }
.spec dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.price-panel {
  border: 1px solid rgba(201,151,63,.3); border-radius: var(--r-card); padding: 18px;
  background: linear-gradient(180deg, rgba(201,151,63,.08), rgba(201,151,63,.02));
}
.dark .price-panel { border-color: rgba(219,184,113,.22); background: rgba(201,151,63,.08); }

.weight-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.weight-pick a, .weight-pick span {
  height: 42px; padding: 0 15px; border-radius: var(--r-control); display: inline-flex; align-items: center;
  font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line-strong); color: var(--ink-600); transition: border-color .16s, color .16s;
}
.dark .weight-pick a { color: rgba(255,255,255,.66); }
.weight-pick a:hover { border-color: var(--gold); color: var(--gold-ink); }
.weight-pick span[aria-current="true"] { background: var(--ink-900); border-color: var(--ink-900); color: var(--gold-soft); }
.dark .weight-pick span[aria-current="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink-900); }

/* the "how buying works" step ledger — sequence carries meaning */
.buy-steps { counter-reset: step; }
.buy-steps li {
  position: relative; padding: 1.15rem 0 1.15rem 3.2rem; border-top: 1px solid var(--line); list-style: none;
}
.buy-steps li:first-child { border-top: 0; }
.buy-steps li::before {
  counter-increment: step; content: counter(step, decimal);
  position: absolute; inset-inline-start: 0; top: 1.05rem;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--gold-deep); font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums;
}
.dark .buy-steps li::before { color: var(--gold-hi); }

.filter-chip {
  flex: 0 0 auto; min-height: 42px; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink-600); font-size: 12px; font-weight: 600; transition: background-color .18s, border-color .18s, color .18s;
}
.dark .filter-chip { color: rgba(255,255,255,.66); }
.filter-chip[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: var(--gold-soft); }
.dark .filter-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink-900); }
.search-field {
  width: 100%; min-height: 56px; padding: 14px 50px 14px 18px; border: 1px solid var(--line-strong);
  border-radius: var(--r-control); background: var(--surface); color: var(--ink-900); font: inherit; font-size: 15px; font-weight: 600;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.search-field::placeholder { color: var(--ink-500); font-weight: 400; }
.search-field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,151,63,.14); }
.dark .search-field { background: rgba(255,255,255,.03); color: #fff; }
.empty-panel {
  border: 1px dashed var(--line-strong); border-radius: var(--r-card); background: rgba(201,151,63,.04);
  padding: 2.75rem 1.5rem;
}
/* /market/ on a phone: two product cards per row. Thirty products as one ~480px card each made an 18,000px page. */
@media (max-width: 639px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pgrid .pcard .art { padding: 8px; }
  .pgrid .pcard .p-5 { padding: 12px; }
  .pgrid .pcard .overline { font-size: 12px; letter-spacing: 0; }
  .pgrid .pcard .title { margin: 6px 0; font-size: 14px; line-height: 1.6; }
  .pgrid .pcard p.ui { margin-top: 8px; font-size: 13px; }
}
