/* Prov: F220 i 3D. Stil efter webbshoppen (Poppins, vitt, navy, orange huvudknapp). */
:root { --navy: #1d2b44; --orange: #e4792b; --ink: #1b1f26; --mute: #5f6670; --line: #e3e6ea; --bg: #f4f5f7; --r: 14px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.5 Poppins, system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }

.top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 600; text-decoration: none; color: var(--navy); letter-spacing: -.01em; }
.tag { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.models { display: inline-flex; gap: 4px; background: var(--bg); border-radius: 999px; padding: 3px; }
.models a { text-decoration: none; font-size: 13px; font-weight: 500; color: var(--mute); padding: 4px 12px; border-radius: 999px; }
.models a[aria-current="page"] { background: var(--navy); color: #fff; }
.top-p { margin-left: auto; display: flex; align-items: baseline; gap: 6px; }
.top-p b { font-size: 18px; } .top-p small { color: var(--mute); }

.cfg { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; padding: 20px; max-width: 1500px; margin: 0 auto; align-items: start; }

/* Vyn: bilden/3D:n överst, rutorna under (som shoppens views-rad) */
.view { position: sticky; top: 68px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.canvas { position: relative; height: min(62vh, 680px); min-height: 320px; border-radius: 10px; overflow: hidden; background: linear-gradient(#f6f7f9, #e9ecf0); }
.canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: 0; }
.canvas.foto canvas { display: none; }
#photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #f4f5f7; }
.stage-tag { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.92); color: var(--navy); font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.views { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.views button { flex: 0 0 auto; width: 84px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; display: flex; flex-direction: column; gap: 4px; align-items: stretch; font-size: 11px; color: var(--mute); line-height: 1.2; }
.views button img, .views button .ic { width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover; background: var(--bg); display: grid; place-items: center; }
.views button .ic svg { width: 32px; height: 32px; stroke: var(--navy); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.views button span { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.views button[aria-pressed="true"] { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; color: var(--navy); }
.views button.v3d { background: linear-gradient(#fff, #f3f5f8); }
.canvas:fullscreen, .view:fullscreen .canvas { height: 100vh; border-radius: 0; }
.view:fullscreen { padding: 0; border: 0; border-radius: 0; }
.view:fullscreen .view-tabs, .view:fullscreen .view-hint { position: absolute; z-index: 2; left: 16px; }
.view:fullscreen .view-tabs { top: 16px; }
.view:fullscreen .view-hint { display: none; }
.view:fullscreen .view-ctl { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2; background: rgba(255,255,255,.9); border-radius: 12px; padding: 10px 14px; }
.loading { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--mute); font-size: 14px; }
.lbl { position: absolute; transform: translate(-50%, -50%); background: rgba(29,43,68,.92); color: #fff; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.view-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 12px; }
.sl { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.sl span { color: var(--mute); font-size: 13px; }
.sl input { flex: 1; accent-color: var(--navy); }
.sl b { font-weight: 500; font-size: 13px; min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chips > span { color: var(--mute); font-size: 13px; margin-right: 4px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 10px 5px 6px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.chips button::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0,0,0,.12); }
.chips button[aria-pressed="true"] { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.view-btns { margin-left: auto; display: flex; gap: 8px; }
.kbtn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; }
.kbtn:hover { border-color: var(--navy); }
.view-hint { margin: 10px 0 0; font-size: 12px; color: var(--mute); }

/* Panelen */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 70vh; }
.ph { padding: 18px 20px 14px; }
.p-kind { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.ph h1 { margin: 2px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.sub { margin: 0; color: var(--mute); font-size: 14px; }
/* Stegen som i shoppen: lika breda delar med ett streck överst */
.tabs { list-style: none; margin: 0; padding: 0 20px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tabs button { width: 100%; min-height: 44px; display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; text-align: left; font-weight: 600; font-size: 13px; color: var(--mute); }
.tabs button::before { content: ""; display: block; height: 4px; border-radius: 2px; background: #e3e5e8; }
.tabs button b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tabs button[aria-current] { color: var(--navy); } .tabs button[aria-current]::before { background: var(--orange); }
.tabs button.ok { color: var(--navy); } .tabs button.ok::before { background: var(--navy); }
.tabs button.ok b::before { content: ""; display: inline-block; width: 9px; height: 5px; margin: 0 6px 0 1px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(-45deg); }
.step { padding: 18px 20px 24px; flex: 1; outline: 0; }
.step-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.03em; }
.q { padding: 16px 0; border-bottom: 1px solid #ecece8; }
#qs > .q:last-child { border-bottom: 0; }
.q-lab { font-size: 13px; color: var(--mute); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.q-lab b { color: var(--ink); font-weight: 600; font-size: 15px; }
.q-lab .cur { color: var(--navy); font-weight: 600; }
/* Sammanfattningen i sista steget */
.sum { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; }
.sum .sg { padding: 12px 0; border-bottom: 1px solid #ecece8; } .sum .sg:last-child { border-bottom: 0; }
.sum .sg-h { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.sum .edit { border: 0; background: none; color: var(--navy); font-size: 13px; text-decoration: underline; padding: 0; }
.sum dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; font-size: 14px; }
.sum dt { color: var(--mute); } .sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; font-size: 15px; } .sum-total strong { font-size: 24px; letter-spacing: -.02em; }
.how { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #3f4652; margin-top: 14px; }
.how b { display: block; color: var(--ink); }
/* Raden längst ner: Tillbaka · pris · Nästa (som shoppen) */
.bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fff; border-radius: 0 0 var(--r) var(--r); }
.bar .back { border: 0; background: none; color: var(--navy); font-weight: 500; padding: 8px 0; visibility: hidden; }
.bar .back.on { visibility: visible; }
.bar-p { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.bar-p strong { font-size: 20px; letter-spacing: -.02em; } .bar-p small { color: var(--mute); font-size: 12px; }
.bar .next { padding: 11px 22px; min-width: 120px; }
.row { display: flex; gap: 10px; }
.num { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; flex: 1; }
.num input { border: 0; width: 100%; padding: 10px 0; outline: 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.num span { color: var(--mute); font-size: 13px; }
.num:focus-within { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 16px; flex: 1; }
.help { font-size: 12px; color: var(--mute); margin: 6px 0 0; }
.err { color: #b3261e; font-size: 13px; margin: 6px 0 0; }

.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.opt { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; text-align: left; display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.25; }
.opt img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--bg); }
.opt .sw { width: 100%; aspect-ratio: 1; border-radius: 6px; background: var(--c); border: 1px solid rgba(0,0,0,.1); }
.opt[aria-pressed="true"] { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.opt small { color: var(--mute); display: block; }
.opts.wide { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.opts.pill { display: flex; flex-wrap: wrap; }
.opts.pill .opt { flex-direction: row; align-items: center; padding: 8px 14px; border-radius: 999px; font-size: 13px; }

.vtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.vtabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.vtabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.vsok { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; margin-bottom: 10px; }
.vsok input { border: 0; outline: 0; width: 100%; padding: 8px 0; font-size: 14px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; max-height: 330px; overflow: auto; padding: 2px; }
.vgrid .opt { padding: 4px; gap: 4px; font-size: 11px; }
.vgrid .opt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vnu { font-size: 13px; margin: 8px 0 0; display: flex; align-items: center; gap: 8px; }
.vnu img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }

.btn { display: block; text-align: center; text-decoration: none; border: 0; border-radius: 999px; padding: 13px 18px; font-weight: 600; }
.btn.orange { background: var(--orange); color: #fff; }
.pf-note { margin: 10px 0 0; font-size: 12px; color: var(--mute); }

@media (max-width: 900px) {
  .cfg { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .view, .panel { min-width: 0; }
  .view { position: static; padding: 10px; }
  .canvas { height: 52vh; min-height: 300px; }
  .view-ctl { gap: 8px 14px; }
  .sl { min-width: 0; flex: 1 1 100%; }
  .view-btns { margin-left: 0; }
  .top { padding: 10px 14px; gap: 10px; }
  .tag { display: none; }
  .brand { font-size: 14px; line-height: 1.2; }
  .top-p b { font-size: 16px; } .top-p small { display: none; }
  .ph h1 { font-size: 22px; }
  .vgrid { max-height: 260px; }
  /* Ett finger i sidled vrider modellen, uppåt/neråt rullar sidan; två fingrar zoomar. */
  .canvas canvas { touch-action: pan-y; }
  .panel { min-height: 0; }
  .tabs { padding: 0 14px; gap: 4px; } .tabs button { font-size: 12px; }
  .ph, .step { padding-left: 14px; padding-right: 14px; }
  .bar { padding: 10px 14px; box-shadow: 0 -6px 16px rgba(0,0,0,.06); }
  .bar .next { min-width: 0; padding: 11px 16px; }
  .views button { width: 72px; }
}
@media (prefers-reduced-motion: reduce) { .canvas canvas { transition: none; } }
