/* Rush Supply Co. storefront.
   Deliberately a shop, not a console: no raw payloads, no status codes, no
   debug panel. Feedback is a toast, and a purchased digital good arrives as a
   delivered code the way any storefront hands over a licence key. */

:root {
  --ink: #16181d;
  --ink-soft: #5c6470;
  --line: #e6e8ec;
  --bg: #ffffff;
  --panel: #f7f8fa;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --warn: #b4303a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- chrome ------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); z-index: 10;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 650; letter-spacing: -.01em; font-size: 17px;
  color: var(--ink); text-decoration: none;
}

.mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #7aa8ff);
}

.account { display: flex; align-items: center; gap: 14px; }

.wallet {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 14px; color: var(--ink-soft);
}
.wallet .who { font-variant-numeric: tabular-nums; }
.wallet .credits strong { color: var(--ink); font-size: 16px; }

main { max-width: 1040px; margin: 0 auto; padding: 36px 28px 72px; }

/* --- promo -------------------------------------------------------------- */

.promo {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
  padding: 30px 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 42px;
}

.promo-copy { max-width: 56ch; }

.kicker {
  margin: 0 0 6px;
  font-size: 12px; font-weight: 650; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}

.promo h1 {
  margin: 0 0 10px;
  font-size: 30px; line-height: 1.2; letter-spacing: -.02em; font-weight: 640;
}

.lede { margin: 0; color: var(--ink-soft); font-size: 15px; }

.promo-form { display: flex; gap: 8px; }

input {
  font: inherit; font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink);
  min-width: 190px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* --- buttons ------------------------------------------------------------ */

.btn {
  font: inherit; font-size: 14px; font-weight: 560;
  padding: 10px 16px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1a5fd0; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #cfd4db; }
.btn-buy { background: var(--ink); color: #fff; }
.btn-buy:hover { background: #000; }

/* --- catalogue ---------------------------------------------------------- */

.section-title {
  margin: 0 0 16px;
  font-size: 13px; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
}

.grid {
  list-style: none; margin: 0 0 44px; padding: 0;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
  transition: box-shadow .14s ease, transform .14s ease;
}
.card:hover { box-shadow: 0 6px 22px rgba(20,24,35,.08); transform: translateY(-2px); }

.card-feature { border-color: #d8c48a; }

/* Product photography. Files are CC0 -- see static/img/CREDITS.md. They are
   served from our own origin rather than hotlinked: a store that fetches its
   own product shots from someone else's CDN is a bad look, and the challenge
   should not depend on a third party being up. */
.thumb {
  aspect-ratio: 4 / 3;
  background: var(--panel);
  overflow: hidden;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.card:hover .thumb img { transform: scale(1.03); }

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.name { margin: 0; font-size: 15px; font-weight: 580; line-height: 1.35; }

.badge {
  align-self: flex-start; margin: 0;
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: #8a6d1f; background: #fbf1d6;
  padding: 3px 8px; border-radius: 999px;
}

/* Price above, full-width action below. A horizontal row looks tidier with
   2-digit prices and then breaks: at 220px a 4-digit price plus a button wraps
   the unit onto its own line and splits the button label. Stacking is robust to
   any price length and is what most storefronts do anyway. */
.row {
  margin-top: auto;
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.row .btn-buy { width: 100%; }

.price { font-size: 18px; white-space: nowrap; font-weight: 640; font-variant-numeric: tabular-nums; }
.price .unit { font-size: 12px; font-weight: 500; color: var(--ink-soft); }

/* --- orders ------------------------------------------------------------- */

.muted { color: var(--ink-soft); font-size: 14px; margin: 0 0 14px; }

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.order-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}

.order-name { font-weight: 560; font-size: 15px; }

.order-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--ink);
  background: #fff; border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 7px;
  word-break: break-all;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
  background: #eef1f6; padding: 1px 6px; border-radius: 5px;
}

/* --- panels (partner activation, profile card) -------------------------- */

.panel {
  margin: 0 0 34px;
  padding: 22px 24px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.panel .section-title { margin-top: 0; }
.panel .promo-form { margin-top: 4px; }
.panel .promo-form input { flex: 1; }

.muted-inline { color: var(--ink-soft); }

.wallet .partner {
  font-size: 11px; font-weight: 640; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  padding: 3px 8px; border-radius: 999px;
}

/* --- footer + toast ----------------------------------------------------- */

footer {
  border-top: 1px solid var(--line);
  padding: 22px 28px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-soft);
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 10px;
  background: var(--ink); color: #fff;
  font-size: 14px; box-shadow: 0 8px 28px rgba(16,20,30,.22);
  z-index: 50;
}
.toast.bad { background: var(--warn); }

@media (max-width: 620px) {
  .promo { padding: 22px; }
  .promo h1 { font-size: 24px; }
  .promo-form { width: 100%; }
  .promo-form input { flex: 1; min-width: 0; }
  main { padding: 26px 18px 56px; }
  .topbar { padding: 12px 18px; }
}
