/* self-hosted fonts (site CSP: no Google Fonts) */
@font-face{font-family:"NL Archivo";src:url("fonts/archivo-var.woff2") format("woff2");font-weight:100 900;font-stretch:62% 125%;font-style:normal;font-display:swap}
/* NEXT LEVEL AR showroom — shared styles
   Palette taken from the machines themselves: cabinet navy, door enamel,
   tank black, and the safety yellow of the warning labels / floor tape. */
:root {
  --navy: #1b3a7a;          /* cabinet blue */
  --navy-deep: #12285a;
  --enamel: #eef1f4;        /* door panels */
  --paper: #f7f8fa;
  --tank: #1a1f2b;          /* receiver tank, used for text */
  --steel: #5d6878;         /* secondary text */
  --rule: #d5dae1;
  --tape: #f2c230;          /* safety / floor-marking yellow */
  --tape-ink: #2a2306;
  --ok: #1f7a4a;
  --bad: #b3261e;
  --radius-s: 6px;
  --radius-l: 14px;
  --font: "NL Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cond: "NL Archivo", "Arial Narrow", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--tank);
  font: 400 17px/1.5 var(--font);
}
a { color: var(--navy); }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }
img { max-width: 100%; }

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left));
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; }
.brand b { font: 700 22px/1 var(--font-cond); font-stretch: 78%; letter-spacing: .02em; }
.brand span { font-size: 14px; opacity: .8; }
.bar a.back { color: #fff; font-size: 15px; opacity: .9; }

/* ---------- product layout ---------- */
.product { display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .product { grid-template-columns: minmax(0, 7fr) minmax(340px, 4fr); min-height: calc(100vh - 50px); }
}

/* viewer */
.stage { position: relative; background: radial-gradient(120% 90% at 50% 40%, #fff 0%, var(--enamel) 70%, #e2e7ee 100%); }
model-viewer {
  display: block; width: 100%; height: min(68vh, 620px); min-height: 380px;
  --poster-color: transparent; --progress-bar-color: var(--tape);
  background: transparent;
}
@media (min-width: 960px) { model-viewer { height: calc(100vh - 50px); max-height: none; } }

.ar-launch {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border: 0; border-radius: 999px;
  background: var(--tape); color: var(--tape-ink);
  font: 700 19px/1 var(--font-cond); font-stretch: 78%; letter-spacing: .01em;
  box-shadow: 0 2px 0 #c99d17, 0 8px 22px rgba(18, 40, 90, .25);
  cursor: pointer; white-space: nowrap;
}
.ar-launch svg { width: 22px; height: 22px; }
.ar-launch:active { transform: translateX(-50%) translateY(1px); }

.viewer-tools { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; z-index: 2; }
.chip {
  border: 1px solid var(--rule); background: rgba(255,255,255,.92); color: var(--tank);
  border-radius: 999px; padding: 7px 12px; font: 600 14px/1 var(--font); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--tank); color: #fff; border-color: var(--tank); }
.scale-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(255,255,255,.92); border: 1px solid var(--rule); border-radius: var(--radius-s);
  padding: 6px 10px; font: 600 13px/1.2 var(--font); color: var(--steel);
}

/* dimension overlay inside model-viewer */
.dim-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dim-svg line { stroke: var(--tape); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.dim-svg line.hide, .dim.hide { display: none; }
.dot { display: none; }
.dim { pointer-events: none; border: 0; padding: 0; background: none; }
.dim .tag {
  display: block; padding: 4px 8px; border-radius: var(--radius-s);
  background: var(--tape); color: var(--tape-ink); text-align: center;
  font: 700 15px/1.1 var(--font-cond); font-stretch: 78%; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.dim small { display: block; font: 600 12px/1.1 var(--font); opacity: .8; }
model-viewer.dims-off .dim, model-viewer.dims-off .dim-svg { display: none; }

/* ---------- details column ---------- */
.details { padding: 24px max(16px, env(safe-area-inset-left)) 40px; max-width: 640px; }
@media (min-width: 960px) { .details { padding: 36px 36px 48px; border-left: 1px solid var(--rule); background: #fff; max-width: none; } }
h1 { font: 700 34px/1.05 var(--font-cond); font-stretch: 78%; margin: 0 0 6px; letter-spacing: .005em; }
.sub { color: var(--steel); margin: 0 0 22px; }
h2 { font: 700 22px/1.15 var(--font-cond); font-stretch: 78%; margin: 30px 0 10px; }

/* the measuring-tape dimensions block */
.tape { display: grid; gap: 10px; margin: 0; }
.tape div {
  display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px 12px; border-radius: var(--radius-s);
  background:
    repeating-linear-gradient(90deg, rgba(42,35,6,.55) 0 1px, transparent 1px 10px) bottom left / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, rgba(42,35,6,.75) 0 2px, transparent 2px 50px) bottom left / 100% 13px no-repeat,
    var(--tape);
  color: var(--tape-ink);
}
.tape dt { font: 600 15px/1.2 var(--font); }
.tape dd { margin: 0; font: 700 32px/1 var(--font-cond); font-stretch: 78%; }
.tape dd.mm { font: 600 16px/1 var(--font); text-align: right; }

.note { font-size: 15px; color: var(--steel); margin: 12px 0 0; }
ol.steps { padding-left: 1.3em; margin: 0; }
ol.steps li { margin: 0 0 8px; padding-left: 4px; }
ul.check { list-style: none; padding: 0; margin: 0; }
ul.check li { padding: 8px 0 8px 30px; border-top: 1px solid var(--rule); position: relative; }
ul.check li::before {
  content: ""; position: absolute; left: 2px; top: 13px; width: 16px; height: 16px;
  border: 2px solid var(--navy); border-radius: 3px;
}

.qr-card {
  display: none; grid-template-columns: 132px 1fr; gap: 16px; align-items: center;
  margin: 24px 0 0; padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius-l); background: var(--paper);
}
.qr-card.show { display: grid; }
.qr-card p { margin: 0; }
.qr-card strong { display: block; font: 700 20px/1.15 var(--font-cond); font-stretch: 78%; margin-bottom: 4px; }
#qr { width: 132px; height: 132px; background: #fff; padding: 6px; border-radius: var(--radius-s); }
#qr img, #qr canvas { width: 100% !important; height: auto !important; }

.cta {
  display: inline-block; margin-top: 22px; padding: 13px 20px; border-radius: var(--radius-s);
  background: var(--navy); color: #fff; text-decoration: none; font: 600 17px/1 var(--font);
}
.cta:hover { background: var(--navy-deep); }
.status { margin: 10px 0 0; font-size: 15px; color: var(--bad); }
.status:empty { display: none; }
footer.fine { padding: 18px max(16px, env(safe-area-inset-left)); font-size: 13px; color: var(--steel); border-top: 1px solid var(--rule); }

/* embed mode (?embed=1): viewer + AR button only */
body.embed .bar, body.embed .details, body.embed footer.fine { display: none; }
body.embed .product { display: block; min-height: 0; }
body.embed model-viewer { height: 100vh; max-height: none; min-height: 0; }

/* ---------- catalogue ---------- */
.catalog { padding: 28px max(16px, env(safe-area-inset-left)) 48px; max-width: 1180px; margin: 0 auto; }
.catalog > h1 { font-size: 40px; }
.catalog > p { color: var(--steel); max-width: 60ch; margin: 0 0 26px; }
.catalog h2.group { font-size: 28px; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--rule); }
.catalog h2.group:first-child { margin-top: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.machine { display: block; text-decoration: none; color: inherit; border-radius: var(--radius-l); overflow: hidden; background: #fff; border: 1px solid var(--rule); }
.machine figure { margin: 0; aspect-ratio: 1 / 1; background: radial-gradient(120% 90% at 50% 40%, #fff 0%, var(--enamel) 75%); display: grid; place-items: center; }
.machine figure img { width: 88%; height: 88%; object-fit: contain; }
.machine .meta { padding: 14px 16px 16px; border-top: 4px solid var(--tape); }
.machine h2 { margin: 0 0 4px; font-size: 22px; }
.machine p { margin: 0; color: var(--steel); font-size: 15px; }
.machine:hover h2 { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.tape dt small { font-weight: 400; font-size: 13px; opacity: .85; }
.cta[hidden], [hidden] { display: none !important; }

/* product variants (With slabs / Empty) */
.details .variant-text { margin: -4px 0 14px; font-size: 15px; color: #4c5d6b; }
.details .sizes { margin: 8px 0 16px; font-size: 15px; }
.details .sizes a { color: inherit; }

/* Android AR fallback (Scene Viewer intent) + help note */
.android-ar { margin: 14px 0 6px; }
.android-ar[hidden], .ar-help[hidden] { display: none; }
.ar-intent { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: #fff; color: var(--navy);
  border: 2px solid var(--navy); font: 600 16px/1 var(--font); text-decoration: none; }
.ar-help { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #fff8dc; border: 1px solid #e8d48a; font-size: 15px; }
.brand span, .bar .back { white-space: nowrap; }
