/* Black Friday test shops: one stylesheet, accent chosen by <html data-shop>. Dark by default. */

:root {
  --bg: #151514; --surface: #1f1f1d; --surface-2: #292926; --line: #3a3a36;
  --text: #f2f1ec; --muted: #b9b7ae; --focus: #ffd166;
  --ok: #3fbf63; --err: #ff7a6b;
  --accent: #c8643c; --accent-ink: #fff; --accent-soft: rgba(200, 100, 60, .18);
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
  --max: 1120px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fcfcfb; --surface: #ffffff; --surface-2: #f2f1ec; --line: #dddbd2;
  --text: #1a1a19; --muted: #55534c; --focus: #1d4ed8;
  --ok: #0b7a2f; --err: #b42318;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  color-scheme: light;
}
/* Accents darkened where needed so white button text keeps 4.5:1 contrast. */
[data-shop="kettle"] { --accent: #b4532d; --accent-soft: rgba(180, 83, 45, .18); }
[data-shop="volt"] { --accent: #2f68c4; --accent-soft: rgba(47, 104, 196, .2); }
[data-shop="fynbos"] { --accent: #237a48; --accent-soft: rgba(35, 122, 72, .2); }
[data-shop="kettle"] .hero-bg { object-position: 50% 45%; }
[data-shop="volt"] .hero-bg { object-position: 50% 50%; }
[data-shop="fynbos"] .hero-bg { object-position: 60% 60%; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
}
main { flex: 1; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--surface); padding: 8px 12px; z-index: 20; border-radius: 8px; }
.skip:focus { top: 8px; }

.testbar { background: var(--surface-2); color: var(--muted); font-size: 13px; text-align: center; padding: 6px 16px; border-bottom: 1px solid var(--line); }

/* Navbar */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand svg { flex: none; }
.links { margin-left: auto; display: flex; gap: 4px; }
.links a { text-decoration: none; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
.links a:hover { background: var(--surface-2); color: var(--text); }
.badge { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; }

/* iPhone-style switch: knob right = light mode on */
.switch { flex: none; background: none; border: 0; padding: 4px; cursor: pointer; }
.switch-track { display: block; width: 51px; height: 31px; border-radius: 16px; background: #48484a; position: relative; transition: background .2s; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.3); transition: transform .2s; }
/* Keyed on the theme too: data-theme is set before first paint, aria-checked only after app.js runs,
   so without this a light page loads with the switch off and visibly slides it on. */
:root[data-theme="light"] .switch .switch-track, .switch[aria-checked="true"] .switch-track { background: #34c759; }
:root[data-theme="light"] .switch .switch-knob, .switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-knob { transition: none; } }

/* Hero */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: clamp(380px, 62vh, 600px); display: flex; align-items: flex-end; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-overlay { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,10,9,.35) 0%, rgba(10,10,9,.6) 45%, rgba(10,10,9,.9) 100%), linear-gradient(90deg, rgba(10,10,9,.6), transparent 70%); }
.hero-inner { max-width: var(--max); margin: 0 auto; width: 100%; padding: 64px 16px 48px; color: #fff; }
.hero h1 { font-family: Verdana, Geneva, sans-serif; font-size: clamp(30px, 5vw, 50px); line-height: 1.12; margin: 0 0 12px; max-width: 18ch; letter-spacing: -.5px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; margin: 0 0 12px; color: #ffe2c9; }
.lead { font-size: 18px; max-width: 52ch; margin: 0 0 24px; color: #f1efe8; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.7); }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.1); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 14px; width: 100%; }
input[type="search"], input[type="number"], input:not([type]), input[type="email"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
label { font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0 0; }
legend { font-weight: 600; padding: 0 6px; }
.radio { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.stack { display: grid; gap: 8px; max-width: 480px; }
.stack .btn { margin-top: 12px; justify-self: start; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }

/* Sections and cards */
.section { max-width: var(--max); margin: 0 auto; padding: 48px 16px; }
.section.narrow { max-width: 760px; }
.section h2 { font-size: 26px; margin: 0 0 24px; }
.page-h { font-size: 30px; line-height: 1.2; margin: 0 0 16px; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.card-link { text-decoration: none; }
.card h3 { font-size: 16px; margin: 8px 0 0; line-height: 1.35; }
.card form { margin-top: auto; }
.tile { aspect-ratio: 4 / 3; border-radius: 8px; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); display: grid; place-items: center; }
.tile span { font: 700 34px/1 Verdana, Geneva, sans-serif; color: var(--muted); letter-spacing: 2px; }
.price { font-weight: 700; margin: 0; }
.price.big { font-size: 24px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.add { display: grid; grid-template-columns: 96px auto; gap: 8px 12px; align-items: center; max-width: 320px; margin-top: 16px; }
.add label { grid-column: 1 / -1; }
.crumbs { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; }
.error { color: var(--err); font-weight: 600; border-left: 4px solid var(--err); padding: 8px 12px; background: var(--surface); border-radius: 6px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
table.cart { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.cart th, .cart td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.cart .num { text-align: right; white-space: nowrap; }
.cart tfoot th, .cart tfoot td { font-weight: 700; border-bottom: 0; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 48px; }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 32px 16px; color: var(--muted); font-size: 14px; }
.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; margin-bottom: 8px; }
.copy { margin-bottom: 0; }

@media (max-width: 640px) {
  .product-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .section { padding: 32px 16px; }
  .nav-inner { gap: 10px; }
  /* Wrap a long shop name onto two lines rather than cutting it off ("Kettle & ..."). */
  .brand span { font-size: 15px; white-space: normal; line-height: 1.15; overflow: visible; }
  .links a { padding: 8px 6px; }
}
@media (max-width: 360px) {
  .brand span { display: none; }
}
