/* CUNGU SPORT storefront — shared across both markets.
   The only per-market difference is the accent set in :root by
   market.js, so Kenya and South Africa read as one brand. */

:root {
  --gold: #c9a227;
  --gold-hi: #f0d87a;
  --gold-lo: #8a6d14;
  --ink: #0b1220;
  --ink-2: #1a2436;
  --paper: #ffffff;
  --wash: #f6f7f9;
  --line: #e4e7ec;
  --muted: #667085;
  --text: #101828;
  --ok: #067647;
  --warn: #b54708;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.topbar {
  background: var(--ink);
  color: #cbd5e1;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar .wrap { display: flex; gap: 16px; align-items: center; justify-content: space-between; height: 38px; }
.topbar a { color: var(--gold-hi); text-decoration: none; font-weight: 600; }
.market-switch { display: flex; gap: 6px; align-items: center; }
.market-switch span { opacity: .65; }
.market-switch a {
  color: #cbd5e1; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); text-decoration: none;
}
.market-switch a.on { background: var(--gold); color: #1a1405; border-color: transparent; }

header.main {
  background: linear-gradient(100deg, #0b1220 0%, #1a2436 55%, #0b1220 100%);
  border-bottom: 2px solid var(--gold);
  position: sticky; top: 0; z-index: 40;
}
header.main .wrap { display: flex; align-items: center; gap: 20px; height: 76px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 34px; width: auto; }
.logo .fallback {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 800; letter-spacing: .08em; color: var(--gold-hi); font-size: 19px;
}
.logo .tag {
  color: #e2e8f0; font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; border-left: 1px solid rgba(226,232,240,.3);
  padding-left: 12px;
}
.spacer { flex: 1; }
.searchbox { position: relative; flex: 0 1 360px; }
.searchbox input {
  width: 100%; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07); color: #fff; padding: 0 16px 0 40px; font-size: 14px;
}
.searchbox input::placeholder { color: #94a3b8; }
.searchbox input:focus { outline: none; border-color: var(--gold); background: rgba(255,255,255,.12); }
.searchbox svg { position: absolute; left: 14px; top: 11px; opacity: .6; }
.cart-btn {
  position: relative; background: var(--gold); color: #1a1405; border: none;
  height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.cart-btn:hover { background: var(--gold-hi); }
.cart-btn .count {
  position: absolute; top: -6px; right: -6px; background: #b42318; color: #fff;
  min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; padding: 0 5px;
}

/* ---------- hero ---------- */
.hero { background: var(--wash); border-bottom: 1px solid var(--line); padding: 32px 0; }
.hero h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 6px; letter-spacing: -.02em;
}
.hero p { margin: 0; color: var(--muted); max-width: 62ch; font-size: 15px; }
.hero .pill {
  display: inline-block; background: var(--ink); color: var(--gold-hi);
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px; margin-bottom: 10px;
}

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; gap: 32px; padding: 28px 0 64px; }
.side h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 0 0 10px;
}
.cats { list-style: none; margin: 0 0 24px; padding: 0; }
.cats li { margin-bottom: 2px; }
.cats button {
  width: 100%; text-align: left; background: none; border: none; padding: 8px 12px;
  border-radius: 9px; font-size: 14px; color: var(--text); display: flex;
  justify-content: space-between; gap: 8px;
}
.cats button:hover { background: var(--wash); }
.cats button.on { background: var(--ink); color: var(--gold-hi); font-weight: 700; }
.cats .n { opacity: .55; font-size: 12.5px; font-variant-numeric: tabular-nums; }

.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.toolbar .count { color: var(--muted); font-size: 14px; }
.toolbar select {
  height: 36px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 10px; font-size: 14px; background: #fff;
}

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 18px; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card .shot {
  aspect-ratio: 4/3; background: var(--wash); display: grid; place-items: center;
  overflow: hidden; cursor: pointer; position: relative;
}
.card .shot img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card .shot .ph {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 800;
  color: #cbd5e1; font-size: 26px; letter-spacing: .06em;
}
.card .body { padding: 13px 14px 15px; display: flex; flex-direction: column; flex: 1; gap: 3px; }
.card .brand { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card h4 { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.35; cursor: pointer; }
.card h4:hover { color: var(--gold-lo); }
.card .price {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 18px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums;
}
.card .stock { font-size: 12px; color: var(--ok); font-weight: 600; }
.card .stock.out { color: var(--muted); }
.card .add {
  margin-top: 11px; width: 100%; height: 38px; border: 1px solid var(--ink);
  background: #fff; color: var(--ink); border-radius: 9px; font-weight: 700; font-size: 13.5px;
}
.card .add:hover { background: var(--ink); color: var(--gold-hi); }
.card .add.added { background: var(--ok); border-color: var(--ok); color: #fff; }

.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 34px; }
.pager button {
  min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff;
  border-radius: 9px; font-weight: 600; font-size: 14px;
}
.pager button:hover:not(:disabled) { border-color: var(--ink); }
.pager button.on { background: var(--ink); color: var(--gold-hi); border-color: var(--ink); }
.pager button:disabled { opacity: .4; cursor: default; }

.state { padding: 64px 0; text-align: center; color: var(--muted); }
.state h3 { color: var(--text); margin: 0 0 6px; font-size: 17px; }
.state .retry {
  margin-top: 14px; background: var(--ink); color: var(--gold-hi); border: none;
  padding: 10px 20px; border-radius: 9px; font-weight: 700;
}
.skeleton { background: linear-gradient(90deg,#eef0f3 25%,#f7f8fa 50%,#eef0f3 75%); background-size: 400% 100%; animation: sk 1.3s infinite; }
@keyframes sk { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
.sk-card { height: 300px; border-radius: var(--radius); }

/* ---------- drawer + modal ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(11,18,32,.55); backdrop-filter: blur(3px);
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .18s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: #fff; z-index: 100; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: none; }
.drawer header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer header h3 { margin: 0; font-size: 16px; font-family: 'Space Grotesk', sans-serif; }
.drawer .close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); }
.drawer .items { flex: 1; overflow: auto; padding: 8px 20px; }
.drawer footer { border-top: 1px solid var(--line); padding: 18px 20px; }

.line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line .thumb { width: 60px; height: 60px; background: var(--wash); border-radius: 8px; flex: 0 0 60px; overflow: hidden; }
.line .thumb img { width: 100%; height: 100%; object-fit: contain; }
.line .meta { flex: 1; min-width: 0; }
.line .meta b { display: block; font-size: 14px; font-weight: 600; }
.line .meta .sub { font-size: 12px; color: var(--muted); }
.line .qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.line .qty button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-weight: 700; }
.line .qty input { width: 46px; height: 26px; text-align: center; border: 1px solid var(--line); border-radius: 6px; }
.line .rm { background: none; border: none; color: #b42318; font-size: 12px; font-weight: 600; padding: 0; margin-top: 4px; }
.line .lt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.total b { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-variant-numeric: tabular-nums; }
.btn-primary {
  width: 100%; height: 46px; background: var(--gold); color: #1a1405; border: none;
  border-radius: 10px; font-weight: 800; font-size: 15px;
}
.btn-primary:hover { background: var(--gold-hi); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }

.modal {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center;
  justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal .box {
  background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: 90vh;
  overflow: auto; box-shadow: var(--shadow-lg);
}
.modal .box header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal .box header h3 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 17px; }
.modal .box .pad { padding: 22px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail .shot { background: var(--wash); border-radius: 12px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.detail .shot img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.detail .price { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font: inherit; font-size: 14px; background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.18); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.err { background: #fef3f2; border: 1px solid #fecdca; color: #b42318; padding: 10px 12px; border-radius: 9px; font-size: 13.5px; margin-bottom: 14px; }
.done { text-align: center; padding: 18px 0; }
.done .tick { width: 56px; height: 56px; border-radius: 999px; background: #d1fadf; color: var(--ok); display: grid; place-items: center; font-size: 28px; margin: 0 auto 14px; }
.done .ref { font-family: 'Space Grotesk', sans-serif; font-size: 21px; font-weight: 700; letter-spacing: .02em; margin: 6px 0 2px; }

/* ---------- footer ---------- */
footer.site { background: var(--ink); color: #94a3b8; padding: 40px 0 28px; margin-top: 40px; font-size: 13.5px; }
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 26px; }
footer.site h4 { color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
footer.site a { color: #cbd5e1; text-decoration: none; display: block; margin-bottom: 6px; }
footer.site a:hover { color: var(--gold-hi); }
footer.site .legal { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; font-size: 12.5px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 18px; }
  .side { order: 2; }
  .cats { display: flex; flex-wrap: wrap; gap: 6px; }
  .cats li { margin: 0; }
  .cats button { width: auto; border: 1px solid var(--line); }
  .detail { grid-template-columns: 1fr; }
  footer.site .cols { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  header.main .wrap { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
  .searchbox { flex: 1 1 100%; order: 3; }
  .logo .tag { display: none; }
  .two { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}
