/* Buscamper Configurator */
:root {
  --navy: #113272;
  --navy-600: #0c2556;
  --accent: #ffd200;
  --accent-ink: #1a1a1a;
  --ink: #1d2433;
  --muted: #5d6677;
  --line: #e2e6ee;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ok: #1f7a4d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --bar-h: 76px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.15; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Topbar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar__inner { max-width: 1440px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 36px; width: auto; }
.brand__text { font-weight: 800; font-size: 1.25rem; color: var(--navy); letter-spacing: -.01em; }
.topbar__nav a { text-decoration: none; font-weight: 600; font-size: .95rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-600); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { filter: brightness(.95); }
.btn--ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn--link { background: none; color: var(--muted); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible, .tab:focus-visible, .choice:focus-within, .swatch:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Home */
.home { max-width: 1280px; margin: 0 auto; padding: 32px 20px 64px; }
.home__intro h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; }
.home__intro p { color: var(--muted); max-width: 60ch; margin: 0 0 24px; }
.home__group h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.model-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: inherit; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.model-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(17, 50, 114, .12); }
.model-card__img { aspect-ratio: 16 / 7; background: #fff; display: flex; align-items: center; justify-content: center; padding: 12px; border-bottom: 1px solid var(--line); }
.model-card__img img { max-height: 100%; object-fit: contain; }
.model-card__body { padding: 14px 16px 16px; }
.model-card__body h3 { margin: 0 0 4px; font-size: 1.1rem; }
.model-card__specs { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.model-card__price { margin: 0; font-size: .95rem; }
.model-card__price strong { color: var(--navy); }

/* Configurator layout */
.cfg { max-width: 1440px; margin: 0 auto; padding: 20px 20px calc(var(--bar-h) + 24px); display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
.stage { position: sticky; top: 72px; max-height: calc(100vh - 72px - var(--bar-h) - 12px); overflow: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px 16px; }
.stage__head { text-align: center; }
.stage__brand { margin: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.stage__head h1 { margin: 2px 0 12px; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.stage__tabs { display: flex; justify-content: center; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; width: fit-content; margin: 0 auto 12px; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.tab.is-active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.stage__views { min-height: 240px; }
.view { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.view img { max-height: min(56vh, 560px); width: auto; object-fit: contain; }
.view figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; text-align: center; }
.view--split { flex-direction: row; gap: 16px; align-items: stretch; }
.view--split > div { flex: 1; display: flex; flex-direction: column; align-items: center; }
.view--split img { max-height: 44vh; border-radius: 8px; }
.view__empty { color: var(--muted); padding: 60px 0; }
.specs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 0; }
.specs div { background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: .85rem; display: flex; gap: 6px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }

/* Panel */
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.steps { position: sticky; top: 56px; margin-top: -8px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; background: var(--bg); scrollbar-width: none; }
.steps a { flex: none; text-decoration: none; font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.notice { background: #fff8d6; border: 1px solid #f3dd7a; border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; margin: 0; padding: 16px 18px 18px; min-width: 0; }
.card__title { font-size: 1.1rem; font-weight: 700; color: var(--navy); padding: 0; margin: 0 0 12px; float: left; width: 100%; }
.card__title + * { clear: both; }
.card--info p { color: var(--muted); margin: 0 0 12px; }

.choice-list { display: flex; flex-direction: column; gap: 8px; clear: both; }
.choice { position: relative; display: grid; grid-template-columns: 20px 1fr auto; column-gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .12s, background .12s; }
.choice:hover { border-color: #b9c3d6; }
.choice input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--navy); }
.choice:has(input:checked) { border-color: var(--navy); background: #f2f5fb; }
.choice__name { font-weight: 600; font-size: .95rem; }
.choice__price { font-size: .9rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
.choice__details { grid-column: 2 / 4; margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: .85rem; }
.choice.is-locked { cursor: default; }
.choice-list--compact .choice { padding: 9px 12px; }
.choice-list--compact .choice__name { font-weight: 500; }

.swatch-group { clear: both; margin-bottom: 14px; }
.swatch-group:last-child { margin-bottom: 0; }
.swatch-group__label { margin: 0 0 8px; font-size: .9rem; color: var(--muted); }
.swatch-group__label strong { color: var(--ink); }
.swatch-group__price { margin-left: 6px; color: var(--navy); font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; border-radius: 50%; }
.swatch input { position: absolute; opacity: 0; inset: 0; }
.swatch img, .swatch__fallback { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch img { font-size: 0; background: var(--bg); }
.swatch__fallback { display: flex; align-items: center; justify-content: center; background: var(--bg); font-weight: 700; font-size: .8rem; }
.swatch:has(input:checked) img, .swatch:has(input:checked) .swatch__fallback { box-shadow: 0 0 0 3px var(--navy); }
.swatch:has(input:checked)::after { content: "✓"; position: absolute; right: -2px; top: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }

.search { width: 100%; clear: both; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.category { border-top: 1px solid var(--line); }
.category:first-of-type { border-top: 0; }
.category summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; cursor: pointer; font-weight: 600; }
.category summary::-webkit-details-marker { display: none; }
.category summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.category[open] summary::after { transform: rotate(180deg); }
.category summary > span:first-child { flex: 1; }
.category__count { font-size: .75rem; background: var(--navy); color: #fff; border-radius: 999px; padding: 2px 8px; margin-right: 8px; }
.category .choice-list { padding-bottom: 12px; }

.summary { list-style: none; margin: 0; padding: 0; clear: both; }
.summary li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.summary__group { grid-column: 1 / 3; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.summary__price { font-weight: 600; white-space: nowrap; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; margin: 12px 0 4px; }
.summary__total strong { font-size: 1.35rem; color: var(--navy); }
.summary__note { font-size: .78rem; color: var(--muted); margin: 0; }

/* Bottom bar */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
.bottombar__inner { max-width: 1440px; margin: 0 auto; min-height: var(--bar-h); padding: 10px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.bottombar__total { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.bottombar__total span { color: var(--muted); }
.bottombar__total strong { font-size: 1.4rem; color: var(--navy); }
.bottombar__actions { display: flex; gap: 10px; }

/* Dialog */
.dialog { border: 0; border-radius: 14px; padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(10, 20, 40, .45); }
.dialog h2 { margin-top: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.dialog__code { color: var(--muted); font-size: .9rem; }
.dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.error-page { max-width: 640px; margin: 80px auto; padding: 0 20px; text-align: center; }
.debug { text-align: left; white-space: pre-wrap; background: #fff; padding: 12px; border-radius: 8px; font-size: .8rem; overflow: auto; }
.empty { color: var(--muted); }

/* Uitrusting */
.uitrusting-keuze + .uitrusting-keuze, .choice-list + .std-list, .std-list + .std-list, .uitrusting-keuze + .choice-list { margin-top: 12px; }
.std-list { clear: both; background: var(--bg); border-radius: 10px; padding: 10px 14px; }
.std-list__title { margin: 0 0 6px; font-weight: 700; font-size: .92rem; }
.std-list__title span { font-weight: 500; color: var(--muted); font-size: .8rem; margin-left: 6px; }
.std-list ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.std-list li { font-size: .88rem; padding-left: 20px; position: relative; }
.std-list li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
#chassis-notice { margin: 0 0 10px; }

/* Contactformulier */
.dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog__head .btn { min-height: 38px; flex: none; }
#contact-dialog { width: min(560px, calc(100vw - 32px)); }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 4px; color: var(--muted); font-size: .9rem; }
.field label::before { content: "*"; color: #c0392b; margin-right: 4px; }
.field input { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.field input[aria-invalid=true] { border-color: #c0392b; }
.field__error, .form-error { margin: 4px 0 0; color: #c0392b; font-size: .85rem; }
.field--hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; font-size: .92rem; color: var(--muted); cursor: pointer; }
.check input { margin-top: 3px; }
#btn-send { margin-top: 8px; }

/* Responsive */
@media (max-width: 1100px) {
  .cfg { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 900px) {
  :root { --bar-h: 64px; }
  .cfg { grid-template-columns: 1fr; padding: 12px 12px calc(var(--bar-h) + 24px); gap: 12px; }
  .stage { position: static; padding: 14px 12px; max-height: none; overflow: visible; }
  .specs div { font-size: .78rem; padding: 4px 10px; }
  .view img { max-height: 36vh; }
  .view--split { flex-direction: column; }
  .steps { top: 56px; }
  .bottombar__inner { padding: 8px 12px; gap: 10px; justify-content: space-between; }
  .bottombar__total { flex-direction: column; gap: 0; line-height: 1.1; }
  .bottombar__total span { font-size: .75rem; }
  .bottombar__total strong { font-size: 1.15rem; }
  .bottombar .btn { padding: 0 12px; font-size: .85rem; }
}
@media (max-width: 420px) {
  .bottombar__actions .btn--accent { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
