/* ============================================================================
   App Wheels — design tokens & components (see design_handoff_app_wheels/README.md)
   ========================================================================== */
:root {
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --border: #E7E2DA;
  --border-soft: #F1EDE6;
  --border-input: #DDD6CC;
  --border-dash: #C9BFB0;
  --text: #1C1917;
  --muted: #6E675B;
  --faint: #8B8578;
  --accent: #E4611A;
  --accent-dark: #C9530F;
  --accent-tint: #FDF1E8;
  --success: #2E7D46;
  --success-bg: #E9F5EC;
  --danger: #B3524A;
  --star: #C9A227;
  --photo: repeating-linear-gradient(45deg, #F0ECE5 0 12px, #EAE5DC 12px 24px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: #A3440C; text-decoration: underline; }
input, select, button, textarea { font-family: "Archivo", system-ui, sans-serif; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
h1, h2, h3 { margin: 0; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- layout containers -------------------------------------------------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 100%; }
.container--narrow { max-width: 1040px; }
main { flex: 1; }
.page { padding-top: 28px; padding-bottom: 64px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---- header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.site-header__inner { height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 9px; flex: none; text-decoration: none; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand__mark { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.brand__mark i { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--text); display: block; }
.brand__word { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.header-search { flex: 1; max-width: 440px; margin: 0; }
.header-search input {
  width: 100%; height: 38px; padding: 0 14px; border: 1px solid var(--border-input);
  border-radius: 8px; font-size: 13.5px; background: var(--bg); color: var(--text);
}
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { font-size: 13.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.nav-count { font-size: 10.5px; font-weight: 700; background: var(--accent-tint); color: var(--accent-dark); border-radius: 99px; padding: 2px 7px; }

/* ---- footer ------------------------------------------------------------- */
.site-footer { background: var(--text); color: #A8A29A; margin-top: auto; }
.site-footer__inner { padding: 32px 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-footer .brand__word { color: #fff; font-size: 14px; }
.site-footer__tag { font-size: 12px; margin-left: 8px; color: #A8A29A; }
.site-footer__legal { font-size: 11.5px; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; cursor: pointer; border: none; border-radius: 8px;
  text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent-dark); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--border-input); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-ghost--danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #256B3B; color: #fff; }
.btn-dashed { background: transparent; border: 1px dashed var(--border-dash); color: var(--faint); font-weight: 600; }
.btn-dashed:hover { border-color: var(--accent); color: var(--accent); }
.btn--sign { height: 36px; padding: 0 16px; font-size: 13px; }
.btn--h30 { height: 30px; padding: 0 12px; font-size: 12px; }
.btn--h34 { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn--h38 { height: 38px; padding: 0 16px; font-size: 13px; }
.btn--h40 { height: 40px; padding: 0 18px; font-size: 13.5px; }
.btn--h46 { height: 46px; padding: 0 20px; font-size: 15px; }
.btn--h48 { height: 48px; padding: 0 24px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--owned { background: var(--accent-tint); color: var(--accent-dark); border: 1px solid var(--accent); }
.btn--owned:hover { border-color: var(--accent); }
.toggle-form { flex: 1; display: flex; }
.toggle-form .btn { width: 100%; }

/* ---- chips (filters, options) ------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 13px;
  border: 1px solid var(--border-input); border-radius: 99px; background: #fff;
  color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.chip.is-active { background: var(--text); color: #fff; border-color: var(--text); }
.chip.is-active:hover { color: #fff; }
.chip--lg { height: 36px; padding: 0 16px; font-size: 13px; }
.chip--radio { height: 38px; padding: 0 18px; }
.chip--radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:has(input:checked) { background: var(--text); color: #fff; border-color: var(--text); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group--tight { gap: 6px; }

/* ---- badges ------------------------------------------------------------- */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 99px; white-space: nowrap;
}
.badge--mainline { background: #F1EDE6; color: #6E675B; }
.badge--th { background: #FDF3DC; color: #8F6400; }
.badge--sth { background: #E4611A; color: #FFFFFF; }
.badge--premium { background: #EDEFF6; color: #3E4E78; }
.badge--lg { font-size: 10.5px; padding: 3px 9px; }
.star { color: var(--star); font-weight: 400; }

/* ---- cards & panels ----------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.panel__head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 700; }
.panel__head--sm { padding: 14px 20px; font-size: 13px; }
.section-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; }
.field-label { font-size: 13px; font-weight: 700; }

/* ---- photo placeholder -------------------------------------------------- */
.photo-ph {
  background: var(--photo); display: flex; align-items: center; justify-content: center;
  color: var(--faint);
}
.photo-ph .mono { font-size: 11px; color: var(--faint); }

/* ---- casting card / grid ------------------------------------------------ */
.casting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.casting-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.casting-card:hover { border-color: var(--accent); box-shadow: 0 4px 18px rgba(228,97,26,.10); text-decoration: none; color: inherit; }
.casting-card__photo { height: 140px; }
.casting-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.casting-card__title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.casting-card__name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.casting-card__meta { font-size: 12px; color: var(--faint); }
.casting-card__price { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2px; }
.casting-card__price b { font-size: 14px; font-weight: 700; }
.casting-card__price span { font-size: 11.5px; color: var(--faint); }

/* ---- page heads --------------------------------------------------------- */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h1.title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
h2.subtitle { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.breadcrumb { display: flex; gap: 6px; font-size: 12.5px; color: var(--faint); margin-bottom: 20px; align-items: center; }
.breadcrumb a { color: var(--faint); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ---- inputs ------------------------------------------------------------- */
.input { height: 42px; padding: 0 14px; border: 1px solid var(--border-input); border-radius: 10px; font-size: 13.5px; background: #fff; color: var(--text); width: 100%; }
.input--price { width: 140px; height: 44px; font-size: 16px; font-weight: 700; }

/* ---- empty state -------------------------------------------------------- */
.empty { padding: 48px; text-align: center; border: 1px dashed var(--border-dash); border-radius: 12px; color: var(--faint); font-size: 14px; }

/* ---- stat cards --------------------------------------------------------- */
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 20px; display: flex; flex-direction: column; gap: 2px; }
.stat-card__label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
.stat-card__value { font-size: 20px; font-weight: 800; }
.stat-card__value--accent { color: var(--accent-dark); }

/* ---- catalog layout ----------------------------------------------------- */
.catalog-grid { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.filters { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 88px; }
.filter-group { display: flex; flex-direction: column; gap: 10px; }
.results { display: flex; flex-direction: column; gap: 16px; }

/* ---- detail layout ------------------------------------------------------ */
.detail-grid { display: grid; grid-template-columns: 1fr 400px; gap: 36px; align-items: start; }
.detail-media { display: flex; flex-direction: column; gap: 12px; }
.detail-main-photo { height: 380px; border-radius: 14px; border: 1px solid var(--border); }
.detail-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.detail-thumb { height: 78px; border-radius: 10px; border: 1px solid var(--border); }
.detail-thumb.is-active { border: 2px solid var(--accent); }
.spec-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.spec-row span:first-child { color: var(--faint); font-weight: 500; }
.spec-row span:last-child { font-weight: 500; }
.variation-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); }
.variation-row__thumb { width: 52px; height: 36px; border-radius: 6px; flex: none; }
.detail-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }

/* market price card */
.market { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.market__cols { display: flex; align-items: flex-end; gap: 4px; }
.market__col { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.market__col--high { text-align: right; }
.market__label { font-size: 11px; color: var(--faint); }
.market__val { font-size: 17px; font-weight: 700; color: var(--faint); }
.market__avg { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--accent-tint); border-radius: 10px; }
.market__avg .market__label { color: var(--accent-dark); font-weight: 700; }
.market__avg-val { font-size: 24px; font-weight: 800; color: var(--accent-dark); }
.trend-pos { color: var(--success); font-weight: 700; }
.trend-neg { color: var(--danger); font-weight: 700; }
.trend-flat { color: var(--faint); font-weight: 700; }

/* for-sale listings */
.listing-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--border-soft); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--faint); flex: none; }

/* ---- generic two-col form layout (sell / checkout) --------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.form-col { display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.sticky-side { position: sticky; top: 88px; }

/* protection / info block */
.info-block { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--accent-tint); border-radius: 12px; }
.info-block__icon { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }

/* summary rows */
.sum-row { display: flex; justify-content: space-between; font-size: 13px; }
.sum-row span:first-child { color: var(--muted); }
.sum-row span:last-child { font-weight: 600; }
.sum-divider { height: 1px; background: var(--border-soft); margin: 4px 0; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; }
.sum-total .lbl { font-size: 13.5px; font-weight: 700; }
.sum-total .val { font-size: 20px; font-weight: 800; color: var(--accent-dark); }

/* photo upload slots */
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.upload-slot { height: 96px; border: 1.5px dashed var(--border-dash); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; background: #fff; transition: border-color .15s; }
.upload-slot:hover { border-color: var(--accent); }
.upload-slot__plus { font-size: 20px; color: var(--border-dash); }
.upload-slot__label { font-size: 11px; color: var(--faint); }

/* ---- success card (sell/checkout confirmation) ------------------------- */
.success-card { max-width: 480px; margin: 48px auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.success-check { width: 56px; height: 56px; border-radius: 50%; background: var(--success-bg); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--success); font-weight: 700; }

/* ---- order tracking ----------------------------------------------------- */
.order-grid { display: grid; grid-template-columns: 1fr 340px; gap: 36px; align-items: start; }
.timeline { padding: 26px 26px 14px; }
.tl-step { display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; box-sizing: border-box; }
.tl-line { width: 2px; flex: 1; min-height: 22px; margin: 4px 0; }
.tl-body { display: flex; flex-direction: column; gap: 3px; padding-bottom: 22px; }
.tl-body__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tl-title { font-size: 14.5px; font-weight: 700; }
.tl-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.tl-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tracking-panel { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 9px 12px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border-soft); }
.dispute-panel { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding: 16px 18px; background: #FBF0EF; border: 1px solid #E8CBC7; border-radius: 12px; }
.dispute-slot { width: 72px; height: 52px; border: 1.5px dashed var(--border-dash); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--border-dash); cursor: pointer; background: #fff; }
.dispute-slot:hover { border-color: var(--danger); }
.status-pill { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; padding: 5px 12px; border-radius: 99px; }

/* ---- home --------------------------------------------------------------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); }
.hero__inner { padding: 72px 24px 64px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.hero__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.hero__h1 { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; max-width: 640px; }
.hero__p { font-size: 16px; color: var(--muted); max-width: 520px; line-height: 1.5; }
.hero__search { display: flex; gap: 10px; width: 100%; max-width: 560px; margin-top: 8px; }
.hero__search input { flex: 1; height: 48px; padding: 0 18px; border: 1px solid var(--border-input); border-radius: 10px; font-size: 15px; background: var(--bg); color: var(--text); }
.hero__stats { display: flex; gap: 36px; margin-top: 20px; }
.hero__stat { display: flex; flex-direction: column; gap: 2px; }
.hero__stat b { font-size: 22px; font-weight: 800; }
.hero__stat span { font-size: 12px; color: var(--faint); }
.hero__divider { width: 1px; background: var(--border); }

.price-history-table { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr auto; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); font-size: 13px; align-items: center; }
.price-history-table.head { padding: 10px 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--faint); }
.price-history-table .r { text-align: right; }

@media (max-width: 900px) {
  .catalog-grid, .detail-grid, .form-grid, .order-grid { grid-template-columns: 1fr; }
  .filters, .detail-side, .sticky-side { position: static; }
}
