:root {
  --navy: #04134A;
  --blue: #181BF5;
  --blue-mid: #5a5cf7;
  --blue-soft: #eaebff;
  --bg: #eef1f8;
  --card: #ffffff;
  --ink: #1c2340;
  --muted: #6a7290;
  --line: #dfe3ef;
  --danger: #c02b3b;
  --danger-soft: #fdeef0;
  --warn: #a86f00;
  --warn-soft: #fff7e0;
  --ok: #127a4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(4, 19, 74, .06), 0 6px 20px rgba(4, 19, 74, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 96px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* Header */
.topbar {
  display: flex; align-items: center; gap: 14px;
  background: #fff; padding: 10px 24px; border-bottom: 1px solid var(--line);
}
.logo { height: 40px; display: block; }
.topbar-title { font-weight: 600; color: var(--navy); border-left: 1px solid var(--line); padding-left: 14px; }
.cart-btn {
  margin-left: auto; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; white-space: nowrap;
}
.cart-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.cart-btn:disabled { color: var(--muted); cursor: default; }

/* Category filters */
.filters {
  display: flex; gap: 6px; overflow-x: auto; padding: 12px 24px;
  background: var(--navy); scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: 0 0 auto; background: transparent; border: 0; color: rgba(255,255,255,.7);
  font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.filters button:hover { color: #fff; }
.filters button.current { color: var(--navy); background: #fff; font-weight: 600; }
.filters button:focus-visible { outline: 2px solid #fff; }

/* Stage */
.stage { max-width: 1080px; margin: 0 auto; padding: 28px 24px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 26px; color: var(--navy); }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.category { margin-bottom: 36px; }
.category h2 { margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.cat-blurb { margin: 0 0 12px; color: var(--muted); max-width: 760px; }
.callout, .banner {
  background: var(--warn-soft); border-left: 4px solid #e0a100; border-radius: 8px;
  padding: 10px 14px; font-size: 14px; margin: 0 0 14px;
}
.category .tiles { margin-top: 14px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; color: var(--navy); }

/* Product tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 2px solid transparent; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s;
}
.tile.selected { border-color: var(--blue); }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--blue-soft); }
.tile-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-body h3 { margin: 0; font-size: 15px; color: var(--navy); }
.tile-body p { margin: 0; font-size: 13px; color: var(--muted); }
.tile-body .spacer { flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags:empty { display: none; }
.tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: var(--blue-soft); color: var(--blue); padding: 3px 8px; border-radius: 999px;
}
.tag-alt { background: var(--warn-soft); color: var(--warn); }
.sku { font-size: 12px; color: var(--muted); }
.note { font-size: 12px; color: var(--warn); }
.specs { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink); }
.specs li { margin-bottom: 3px; }
details summary { font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }
details .specs { margin-top: 6px; }
.bestfor { font-size: 12px; color: var(--muted); }
.bestfor b { color: var(--navy); }
.price { font-weight: 700; font-size: 17px; color: var(--blue); margin-top: 6px; }
.price small, table.lines small { font-weight: 500; font-size: 12px; color: var(--muted); }

.qty { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.qty button {
  width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; font-size: 18px; cursor: pointer; color: var(--navy);
}
.qty button:hover { border-color: var(--blue); color: var(--blue); }
.qty input {
  width: 64px; text-align: center; font: inherit; font-weight: 600; padding: 7px;
  border: 1.5px solid var(--line); border-radius: 10px;
}
.qty input:focus { outline: none; border-color: var(--blue); }
.qty-sm { margin-top: 0; justify-content: flex-end; }
.qty-sm button { width: 30px; height: 30px; font-size: 16px; }
.qty-sm input { width: 52px; padding: 5px; }
.btn-add-cart { margin-top: 8px; width: 100%; padding: 9px 16px; }

/* Fields */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 2; }
.field.half { grid-column: span 1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field label .req { color: var(--blue); }
.field input, .field textarea {
  font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); background: var(--danger-soft); }
.field .err { color: var(--danger); font-size: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.step-err { color: var(--danger); background: var(--danger-soft); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }

/* Buttons + bottom bar */
.btn {
  white-space: nowrap;
  font: inherit; font-weight: 600; padding: 12px 22px; border-radius: 10px; border: 0; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1114c9; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-remove { display: block; background: none; border: 0; color: var(--danger); font: inherit; font-size: 12px; cursor: pointer; padding: 4px 0 0; }

.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px 24px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.navbar .btn-primary { margin-left: auto; }
.total-pill {
  background: var(--blue-soft); color: var(--navy); border-radius: 999px; padding: 8px 16px; font-size: 14px;
  text-align: center;
}
.total-pill b { color: var(--blue); }

/* Order review */
table.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lines th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 6px 4px; }
table.lines td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.lines .num { text-align: right; white-space: nowrap; }
.grand { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.grand div { flex: 1 1 200px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px 20px; }
.grand span { display: block; font-size: 13px; opacity: .75; }
.grand b { font-size: 26px; }
.fineprint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* Success */
.success { text-align: center; padding: 48px 24px; }
.success .check {
  width: 76px; height: 76px; border-radius: 50%; background: var(--ok); color: #fff;
  display: grid; place-items: center; margin: 0 auto 18px; font-size: 40px;
}
.success h1 { color: var(--navy); margin: 0 0 8px; }
.success p { color: var(--muted); }
.ref { display: inline-block; margin: 10px 0 24px; background: var(--blue-soft); color: var(--navy); font-weight: 700; padding: 8px 16px; border-radius: 999px; }

/* Turnstile bot check: invisible unless Cloudflare asks for an interaction */
.captcha-box {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 20;
  display: none; padding: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
.captcha-box.show { display: block; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .logo { height: 36px; }
  .filters { padding: 10px 16px; }
  .stage { padding: 20px 16px; }
  .grid { grid-template-columns: 1fr; }
  .field.half { grid-column: span 2; }
  .navbar { padding: 12px 16px; }
  .btn { padding: 11px 16px; }
  .hide-sm { display: none; }
  .total-pill { font-size: 13px; padding: 6px 12px; }
}

/* Details summary on the review page */
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.btn-link { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 14px; overflow-wrap: anywhere; }
.ov-sub { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
@media (max-width: 640px) { .summary { grid-template-columns: 1fr; } }

/* Splash page in front of the store */
.splash {
  position: fixed; inset: 0; z-index: 50; background: #02040f;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
body.splash-open { overflow: hidden; }
/* The artwork keeps its 16:9 shape and fills as much of the screen as it can. */
.splash-art { position: relative; width: min(100vw, calc(100vh * 1672 / 941)); aspect-ratio: 1672 / 941; }
.splash-art img { display: block; width: 100%; height: 100%; }
/* Enter sits under the tagline, centred on the logo. */
.splash-enter {
  position: absolute; left: 23.9%; top: 60%; transform: translateX(-50%);
  font-size: clamp(14px, 1.5vw, 22px); padding: .7em 2.2em; border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 8px 30px rgba(24, 27, 245, .6);
}
.splash-enter:hover { background: #2f32ff; }
.splash-enter:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* Narrow or portrait screens: the artwork is too small to hold the button, so put it underneath. */
@media (max-width: 700px), (max-aspect-ratio: 1/1) {
  .splash { flex-direction: column; }
  .splash-art { width: 100vw; aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 28px; }
  .splash-art img { height: auto; }
  .splash-enter { position: static; transform: none; font-size: 18px; }
}

/* Bottom bar: total with its "not included" note to the right */
.total-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.total-note { font-size: 13px; color: var(--muted); }
/* Phones: the total and its note get their own line above the buttons. */
@media (max-width: 640px) {
  body { padding-bottom: 136px; }
  .navbar { flex-wrap: wrap; row-gap: 10px; }
  .total-wrap { order: -1; width: 100%; justify-content: center; flex-wrap: wrap; gap: 4px 10px; }
  .total-note { font-size: 12px; }
  .captcha-box { bottom: 132px; }
}
