:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --ink: #16171a;
  --muted: #5d6166;
  --line: #e1ddd4;
  --chip: #efece5;
  --accent: #1f47c9;
  --accent-hover: #183aa8;
  --accent-ink: #ffffff;
  --stripe: #ffc629;
  --head-bg: #16171a;
  --head-ink: #f5f5f3;
  --head-muted: #b4b7bc;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1b1d20;
    --ink: #eceef0;
    --muted: #a0a5ab;
    --line: #2c2f34;
    --chip: #26292e;
    --accent: #3a5ee8;
    --accent-hover: #4d6ef0;
    --head-bg: #0a0b0c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* Header */
.masthead {
  background: var(--head-bg);
  color: var(--head-ink);
  border-bottom: 6px solid var(--stripe);
  padding: 36px 0 30px;
  padding-top: max(36px, env(safe-area-inset-top));
}
.eyebrow {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--stripe);
}
/* Bike menu: big tiles, 2-up on phones, one row on wider screens */
.bike-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 26px;
}
.bike-menu[hidden] { display: none; }
@media (min-width: 700px) {
  .bike-menu { grid-template-columns: repeat(auto-fit, minmax(220px, 280px)); gap: 14px; }
}
.bike {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 13px;
  border: 2px solid rgb(255 255 255 / .16);
  border-radius: var(--radius);
  background: rgb(255 255 255 / .05);
  color: var(--head-ink);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.bike:hover { border-color: rgb(255 255 255 / .4); background: rgb(255 255 255 / .09); }
.bike-top { font-size: .8rem; font-weight: 600; color: var(--head-muted); letter-spacing: .02em; }
.bike-model { font-size: clamp(1.5rem, 6vw, 2.1rem); line-height: 1.05; font-weight: 900; letter-spacing: -.02em; }
.bike-count { margin-top: 4px; font-size: .82rem; font-weight: 700; color: var(--stripe); }
.bike[aria-current="page"] { background: var(--stripe); border-color: var(--stripe); color: #16171a; }
.bike[aria-current="page"] .bike-top { color: #3b3520; }
.bike[aria-current="page"] .bike-count { color: #16171a; }
.bike:focus-visible { outline-color: #fff; }

.masthead h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1.02;
  font-weight: 850;
  letter-spacing: -.025em;
}
.masthead h1 span { color: var(--head-muted); font-weight: 700; white-space: nowrap; }
.lede { max-width: 38em; margin: 14px 0 0; color: var(--head-muted); font-size: 1rem; }
.meta { margin: 16px 0 0; font-size: .88rem; color: var(--head-ink); font-variant-numeric: tabular-nums; }
.meta #count { font-weight: 700; }

/* Bundle callout */
.bundle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  align-items: center;
  margin: 24px 0 26px;
  padding: 18px;
  background: var(--stripe);
  color: #16171a;
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgb(255 198 41 / .28);
}
.bundle-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #16171a;
  color: var(--stripe);
  font-size: 28px;
}
.bundle h2 { margin: 0; font-size: 1.4rem; line-height: 1.15; font-weight: 850; letter-spacing: -.015em; }
.bundle p { margin: 4px 0 0; font-size: 1.02rem; line-height: 1.4; }
.bundle-btn {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  background: #16171a;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.bundle-btn:hover { background: #000; }
.bundle-btn svg { font-size: 1.15em; }
@media (min-width: 700px) {
  .bundle { grid-template-columns: auto 1fr auto; padding: 20px 24px; }
  .bundle h2 { font-size: 1.6rem; }
  .bundle-btn { grid-column: auto; }
}
.bundle :focus-visible, .bundle-btn:focus-visible { outline-color: #16171a; }

/* Grid */
#listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.bike-heading { grid-column: 1 / -1; margin: 18px 0 -4px; font-size: 1.25rem; }
.status { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 48px 0; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.card.highlight { outline: 3px solid var(--stripe); outline-offset: 2px; }
.photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: var(--chip);
  cursor: zoom-in;
  overflow: hidden;
}
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
@media (hover: hover) { .photo:hover img { transform: scale(1.03); } }
.photo:disabled { cursor: default; }
.photo .empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .9rem; }
.count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgb(0 0 0 / .62);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.part { margin: 0; font-size: 1.15rem; line-height: 1.25; font-weight: 750; }
.spec { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.note {
  align-self: flex-start;
  margin: 10px 0 0;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--chip);
  font-size: .82rem;
}
.note:empty { display: none; }
.desc {
  margin: 10px 0 0;
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc:empty { display: none; }
.buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; }
.price { font-size: 1.5rem; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--stripe); outline-offset: 2px; }

.footer { padding-top: 32px; padding-bottom: max(40px, env(safe-area-inset-bottom)); color: var(--muted); font-size: .88rem; text-align: center; }
.footer p { margin: 4px 0; }
.footer a { color: var(--ink); font-weight: 600; }

/* Gallery (always dark, it's a photo viewer) */
#gallery {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #f2f2f2;
  display: none;
  flex-direction: column;
}
#gallery[open] { display: flex; }
#gallery::backdrop { background: #000; }
.g-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 12px 8px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.g-top h2 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.g-counter { margin: 2px 0 0; font-size: .85rem; color: #a8abb0; font-variant-numeric: tabular-nums; }
.g-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.g-stage { position: relative; flex: 1; min-height: 0; }
.g-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.g-track::-webkit-scrollbar { display: none; }
.g-track:focus-visible { outline: none; }
.g-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.g-slide img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.g-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / .5);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
.g-nav:disabled { opacity: 0; pointer-events: none; }
.g-prev { left: 12px; }
.g-next { right: 12px; }
@media (hover: none) { .g-nav { display: none; } }
.g-thumbs { display: flex; gap: 6px; justify-content: center; padding: 10px 12px 0; overflow-x: auto; scrollbar-width: none; }
.g-thumbs button { flex: none; width: 56px; height: 42px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #222; opacity: .55; cursor: pointer; }
.g-thumbs button[aria-current="true"] { border-color: var(--stripe); opacity: 1; }
.g-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-desc {
  max-height: 22vh;
  overflow-y: auto;
  margin: 10px 16px 0;
  color: #d4d6d9;
  font-size: .92rem;
  line-height: 1.5;
  white-space: pre-line;
}
.g-desc:empty { display: none; }
.g-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.g-price { font-size: 1.4rem; font-weight: 850; }
#gallery .btn { background: #3a5ee8; }

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