/* --------------------------------------------------------------------------
   Resale Store - dark editorial collection layout
   --------------------------------------------------------------------------
   Layout follows the UP THERE sneakers collection: a wide 4-up product grid
   with generous vertical rhythm, quiet 15px/400 type, and a vendor line above
   the product name. The palette stays dark, so the reference's white page is
   translated into layered near-blacks rather than copied literally.
   -------------------------------------------------------------------------- */

:root {
  --bg: #0b0b0d;
  --surface: #141417;
  --surface-2: #1c1c21;
  --line: #26262d;
  --line-strong: #3a3a44;
  --text: #f4f4f6;
  --muted: #8b8b96;
  --muted-2: #6a6a75;
  --accent: #d6ff3f;
  --radius: 2px;
  --max: 1180px;
  --gutter: 20px;
  --row-gap: 40px;
  --font: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; height: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  max-width: var(--max);
  margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stock, .back {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.back:hover { color: var(--text); }

/* ---------- collection heading ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 24px;
}

.collection-head {
  padding: 44px 0 26px;
  border-bottom: 1px solid var(--line);
}

.collection-head h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.collection-head .lede {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 52ch;
}

/* ---------- filter bar ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.filters .field {
  position: relative;
  display: flex;
  align-items: center;
}

/* The visible pill is a label; the real control sits on top of it, invisible,
   so the native select still drives app.js and stays keyboard accessible. */
.filters .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

/* The chevron is a rotated square. It needs its own left margin because the
   pill's flex gap does not apply between a text node and a pseudo-element. */
.filters .pill::after {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-left: 2px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.55;
}

.filters .field:hover .pill { border-color: var(--text); }

.filters select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font: inherit;
  border: 0;
  background: transparent;
  color: var(--text);
}

.filters select:focus-visible + .pill,
.filters .field:focus-within .pill {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The search grows to fill leftover space but is capped so the three pills and
   the reset link stay on the same row at desktop widths. */
.filters .search {
  flex: 1 1 200px;
  max-width: 320px;
  min-width: 160px;
  appearance: none;
  background: transparent;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 9px 2px;
  font: inherit;
  font-size: 13px;
}

.filters .search::placeholder { color: var(--muted-2); }

.filters .search:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.filters .reset {
  appearance: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 9px 4px;
  margin-left: auto;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.filters .reset:hover { color: var(--text); border-bottom-color: var(--text); }

.result-count {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 18px 0 0;
}

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--row-gap);
  margin-top: 28px;
}

.card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.card .media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  overflow: hidden;
}

.card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}

.card:hover .media img { transform: scale(1.035); }

/* A hairline frame that only appears on hover, mirroring the reference's
   understated product tiles. */
.card .media::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
  pointer-events: none;
}

.card:hover .media::after { border-color: var(--line-strong); }

.card .body {
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card .vendor {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.card:hover h3 { color: var(--text); }

.card .price {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  margin-top: 2px;
}

/* Size/condition chips are demoted to a quiet meta line so the tile reads as
   vendor / name / price, exactly like the reference. */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.badge + .badge::before {
  content: "·";
  margin-right: 6px;
  color: var(--line-strong);
}

.noimg {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 180px;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-2);
}

.empty {
  color: var(--muted);
  padding: 60px 0;
  font-size: 14px;
}

/* ---------- detail ---------- */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 36px;
}

.gallery {
  display: grid;
  gap: 8px;
}

/* Portrait phone photos can be 3:4 or taller; capping the height keeps the
   buy panel reachable without cropping the product. */
.gallery img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 0;
  background: var(--surface-2);
}

.info {
  position: sticky;
  top: 96px;
}

.info .vendor {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.info h1 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.info .price {
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 6px;
}

.info .condition {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 26px;
}

.buy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.buy {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--text);
  color: #0b0b0d;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.buy:hover { filter: brightness(0.88); transform: translateY(-1px); }

.buy-vinted { background: #09b1ba; color: #fff; }
.buy-ebay { background: #e53238; color: #fff; }
.buy-facebook { background: #1877f2; color: #fff; }

.soldout {
  color: var(--muted);
  font-size: 13px;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 22px;
  margin: 0 0 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.facts dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 2px;
}

.facts dd { margin: 0; }

.description {
  color: #cfcfd6;
  font-size: 14px;
  line-height: 1.7;
  white-space: normal;
}

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 80px auto 0;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.site-footer p { margin: 0 0 6px; }
.site-footer .fine { opacity: 0.6; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail { grid-template-columns: 1fr; gap: 28px; }
  .info { position: static; }
}

@media (max-width: 720px) {
  :root { --gutter: 14px; --row-gap: 30px; }
  main { padding: 0 16px 16px; }
  .site-header { padding: 16px; }
  .collection-head { padding: 30px 0 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { gap: 8px; }
  .filters .search { flex-basis: 100%; }
  .card h3 { font-size: 14px; }
  .card .price { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
