/* Layout: lane-wood header band with a marquee name, filter rail + product grid, slide-out cart */
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #1b2233;
  --muted: #5d6475;
  --line: #e2ddd3;
  --maple: #d9a86a;
  --maple-dark: #b9824a;
  --accent: #c8263a;
  --accent-ink: #ffffff;
  --navy: #1f2d5c;
  --good: #1f7a4d;
  --warn: #b46a00;
  --display: "Bowlby One", "Arial Black", Impact, sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151d;
    --surface: #1b2030;
    --ink: #ecebe6;
    --muted: #a2a7b6;
    --line: #2c3245;
    --maple: #c99858;
    --maple-dark: #a87a42;
    --accent: #ef4a5c;
    --navy: #9fb2ef;
    --good: #4cc488;
    --warn: #f0a640;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12151d;
  --surface: #1b2030;
  --ink: #ecebe6;
  --muted: #a2a7b6;
  --line: #2c3245;
  --maple: #c99858;
  --maple-dark: #a87a42;
  --accent: #ef4a5c;
  --navy: #9fb2ef;
  --good: #4cc488;
  --warn: #f0a640;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header: maple lane boards */
.lane {
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(0, 0, 0, .08) 38px 40px),
    linear-gradient(180deg, var(--maple), var(--maple-dark));
  color: #1b1408;
  border-bottom: 6px solid var(--navy);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}

.brand {
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: .02em;
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1b1408;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
}

.cart-count {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  min-width: 24px;
  padding: 0 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: .85rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
  padding-block: 32px 40px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  margin: 0 0 12px;
  text-wrap: balance;
}

.hero p {
  margin: 0;
  max-width: 52ch;
  font-size: 1.1rem;
  font-weight: 500;
}

.arrows {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.arrows span {
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 34px solid var(--navy);
  opacity: .85;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 16px;
}

.dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy);
  opacity: .7;
}

.lane-note {
  text-align: center;
  font-family: var(--mono);
  font-size: .75rem;
  margin-top: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Store layout */
.store {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding-block: 32px 64px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: start;
  position: sticky;
  top: 16px;
}

.filters h2 {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .9rem;
}

.chip[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--bg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field input,
.field select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.range-val {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.results-head h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0;
}

.results-head span {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.art {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: color-mix(in srgb, var(--maple) 18%, var(--surface));
  position: relative;
}

.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  z-index: 1;
}

.credits {
  font-size: .8rem;
}

.credits summary {
  cursor: pointer;
}

.credits ul {
  margin: 8px 0 0;
  padding-left: 18px;
  columns: 2 280px;
}

.credits a {
  color: inherit;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
}

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

.cat {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.specs {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
}

.rating {
  font-size: .85rem;
  color: var(--warn);
}

.rating small {
  color: var(--muted);
}

.stock {
  font-size: .8rem;
  font-weight: 600;
}

.stock.ok {
  color: var(--good);
}

.stock.low {
  color: var(--warn);
}

.stock.out {
  color: var(--accent);
}

.buy {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
}

.price {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.price s {
  color: var(--muted);
  font-size: .85rem;
  margin-left: 4px;
}

.add {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
}

.add:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.empty {
  padding: 48px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

/* Cart drawer */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 20;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100%);
  z-index: 21;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) 20px;
  transform: translateX(100%);
  transition: transform .25s ease;
}

.drawer.open {
  transform: none;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-head h2 {
  font-family: var(--display);
  margin: 0;
  font-size: 1.4rem;
}

.close {
  background: none;
  border: 0;
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1;
}

.lines {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block: 16px;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.line .name {
  font-weight: 600;
}

.line .lp {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}

.remove {
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  font-size: .85rem;
  justify-self: end;
}

.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.totals .grand {
  font-weight: 700;
  font-size: 1.15rem;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 4px;
}

.totals .grand:nth-last-child(1) {
  font-family: var(--mono);
}

.checkout {
  margin-top: 16px;
  background: var(--navy);
  color: var(--bg);
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
}

.checkout:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.note {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 30;
  font-weight: 600;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

footer .wrap {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 24px;
}

/* Contact form */
.contact {
  border-top: 1px solid var(--line);
}

.contact .wrap {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
  padding-block: 48px;
}

.contact h2 {
  font-family: var(--display);
  font-size: 1.8rem;
  margin: 0 0 8px;
  text-wrap: balance;
}

.contact p {
  margin: 0;
  color: var(--muted);
  max-width: 40ch;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 0;
}

.contact-form .field label {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.contact-form .full {
  grid-column: 1 / -1;
}

.contact-form textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 110px;
  resize: vertical;
}

.contact-form .hp {
  position: absolute;
  left: -9999px;
}

.contact-form .opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* Choice groups: real radio inputs styled as tappable cards and pills */
.choices {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choices legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.choice-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: block;
  height: 100%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  transition: border-color .15s, background .15s;
}

.choice-cards .choice span {
  padding: 12px 14px;
}

.choice-cards .choice b {
  display: block;
  font-size: 1rem;
}

.choice-cards .choice small {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.35;
  margin-top: 2px;
}

.choice-pills .choice span {
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 500;
}

.choice input:hover+span {
  border-color: var(--maple-dark);
}

.choice input:checked+span {
  border-color: var(--navy);
  background: color-mix(in srgb, var(--navy) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--navy);
}

.choice input:focus-visible+span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.send {
  background: var(--navy);
  color: var(--bg);
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 700;
}

.send:disabled {
  opacity: .6;
  cursor: wait;
}

.form-status {
  font-weight: 600;
}

.form-status.ok {
  color: var(--good);
}

.form-status.err {
  color: var(--accent);
}

@media (max-width: 820px) {
  .contact .wrap {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .choice-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-lane {
    display: none;
  }

  .store {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer {
    transition: none;
  }
}
