/* BaddJet Market: the public listing pages. Marketplace layout: a photo
 * grid, price first, one tap to ask. */

:root {
  --ink: #0f1b2d;
  --ink-2: #4a5568;
  --line: #dde3ea;
  --bg: #ffffff;
  --soft: #f3f5f8;
  /* Ratios measured 2026-10-07, same values as admin.css; text needs 4.5:1.
   * --brand was #e2572b, which gave the white button labels 3.73:1. */
  --brand: #c2461f;       /* fill; white on it 5.01 */
  --brand-text: #c2461f;  /* links and the logo accent: 5.01 on --bg */
  --good: #1a7a42;
  --warn: #8a5a12;        /* white Pending badge on it 5.91 (was #b7791f, 3.64) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e8edf3; --ink-2: #a0aec0; --line: #2d3748; --bg: #0d1117; --soft: #161b22; --brand-text: #f2875f; /* 7.58 on --bg */ color-scheme: dark; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-text); }
img { max-width: 100%; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; min-height: 56px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--brand-text); }
.top__shop { font-weight: 600; text-decoration: none; padding: 12px 0; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.2; margin: 8px 0; }
h2 { font-size: 1.15rem; margin: 32px 0 12px; }
.lede { color: var(--ink-2); margin: 0 0 16px; max-width: 60ch; }

.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: inherit; font: inherit; }
.search button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font: inherit; font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.chips a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.chips a[aria-current] { background: var(--ink); color: var(--bg); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.card a { display: block; color: inherit; text-decoration: none; }
.card__img { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--soft); }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__price { margin: 8px 0 0; font-weight: 800; font-size: 1.05rem; }
.card__title { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin: 2px 0 0; color: var(--ink-2); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card a:hover .card__title { text-decoration: underline; }
.grid--sold .card__img img { filter: grayscale(1); opacity: 0.7; }

.badge { position: absolute; left: 8px; top: 8px; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; color: #fff; }
.item .badge { position: static; display: inline-block; margin: 0; }
.badge--pending { background: var(--warn); }
.badge--sold { background: #4a5568; }

.empty { color: var(--ink-2); padding: 40px 0; text-align: center; }
.also { color: var(--ink-2); margin: -4px 0 12px; font-size: 0.9rem; }
.also a, .foot a { display: inline-block; min-height: 24px; padding: 2px 0; }

/* one listing */
.wrap--item { padding: 0; }
@media (min-width: 860px) { .wrap--item { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; padding: 24px 16px; align-items: start; } }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #000; scrollbar-width: thin; }
.gallery img { flex: none; width: 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: center; }
@media (min-width: 860px) { .gallery { border-radius: 12px; } }
.gallery__hint { margin: 6px 16px 0; color: var(--ink-2); font-size: 0.85rem; }
.item { padding: 16px; }
@media (min-width: 860px) { .item { padding: 0; } }
.item h1 { margin-top: 4px; }
.item__price { font-size: 1.6rem; font-weight: 800; margin: 0 0 16px; }
.cta { display: grid; place-items: center; width: 100%; min-height: 52px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; text-decoration: none; cursor: pointer; }
.cta--quiet { margin-top: 10px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); font-size: 1rem; }
.item form { margin: 0; }
.buy__terms { margin: 8px 0 0; color: var(--ink-2); font-size: 0.85rem; }
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: #fdf2dc; color: #6b4a0f; font-weight: 600; }
.notice--good { background: #e3f4ea; color: #155d33; }
.facts { margin: 20px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 9rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.desc p { margin: 0 0 12px; }
.ref { color: var(--ink-2); font-size: 0.8rem; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 16px; text-align: center; color: var(--ink-2); font-size: 0.85rem; }
