/* ==========================================================================
   The tint zone picker (zone-picker.js): a plan view of a car to touch beside a list of checkboxes and three presets.
   It reads the brand tokens of whatever page hosts it (style.css on the site, the configurator's own under .cfg) and
   falls back to their values, so it looks the same in both.
   - phone (390 px): one column, the car first (about 260 px wide, its touch targets 52 px or more), then the presets
     and the list, every row 48 px tall;
   - wide host (560 px or more): the car on the left, the controls on the right.
   Selection is never colour alone: a chosen zone is gold, hatched and drawn with a heavier outline, a chosen row has a
   check and a gold border, a pressed preset has a check.
   ========================================================================== */
.zp{
  --zp-gold:var(--gold,#b89550);
  --zp-gold-soft:var(--gold-soft,#d4b876);
  --zp-gold-ink:var(--gold-ink,#17120a);
  --zp-ink:var(--off-white,#f4f3f0);
  --zp-dim:var(--text-dim,#a9acb3);
  --zp-line:var(--line,rgba(244,243,240,.1));
  --zp-line-strong:var(--line-strong,rgba(244,243,240,.2));
  --zp-panel:var(--charcoal-2,#191b20);
  --zp-black:var(--black,#07080a);
  --zp-danger:var(--danger,#f0a08c);
  --zp-ring:0 0 0 2px var(--zp-black),0 0 0 4px var(--zp-gold-soft);
  --zp-ms:var(--dur-1,160ms);
  --zp-ease:var(--ease-out-quart,cubic-bezier(.25,1,.5,1));
  container-type:inline-size;
  width:100%;
  color:var(--zp-ink);
  font-family:var(--font,inherit);
  line-height:1.4;
}
.zp *,.zp *::before,.zp *::after{box-sizing:border-box;}
.zp-body{display:grid;gap:20px;justify-items:center;}
.zp-controls{display:grid;gap:16px;width:100%;max-width:560px;min-width:0;}
.zp p{margin:0;}

/* ---- The drawing */
.zp-car{display:block;width:min(100%,260px);height:auto;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;}
.zp-shape{fill:var(--zp-panel);stroke:var(--zp-line-strong);stroke-width:1.5;}
.zp-roof{fill:rgba(244,243,240,.04);stroke:var(--zp-line);stroke-width:1;}
.zp-wheel{fill:#0d0e11;stroke:var(--zp-line);stroke-width:1;}
.zp-lamp{fill:none;stroke:var(--zp-dim);stroke-width:2;stroke-linecap:round;opacity:.6;}
.zp-cap{fill:var(--zp-dim);font-size:9px;letter-spacing:.08em;text-transform:uppercase;font-family:var(--font,inherit);}
.zp-zone{cursor:pointer;}
.zp-glass{fill:rgba(244,243,240,.06);stroke:var(--zp-line-strong);stroke-width:1.5;stroke-linejoin:round;
  transition:fill var(--zp-ms) var(--zp-ease),stroke var(--zp-ms) var(--zp-ease),stroke-width var(--zp-ms) var(--zp-ease);}
.zp-mark{opacity:0;pointer-events:none;transition:opacity var(--zp-ms) var(--zp-ease);}
.zp-hit{fill:transparent;stroke:none;pointer-events:all;}
.zp-zone.is-on .zp-glass{fill:rgba(184,149,80,.5);stroke:var(--zp-gold-soft);stroke-width:2.5;}
.zp-zone.is-on .zp-mark{opacity:1;}
.zp-zone.is-hover .zp-glass{stroke:var(--zp-gold-soft);}
.zp-zone.is-focus .zp-glass{stroke:var(--zp-ink);stroke-width:3.5;}
@media (hover:hover){.zp-zone:hover .zp-glass{stroke:var(--zp-gold-soft);}}

/* ---- The controls */
.zp-hint{font-size:.875rem;color:var(--zp-dim);}
.zp-sub{display:block;margin-bottom:8px;font-size:.8125rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--zp-dim);}
.zp-preset-row{display:flex;flex-wrap:wrap;gap:8px;}
.zp-preset{min-height:44px;padding:10px 16px;border:1px solid var(--zp-line-strong);border-radius:999px;background:transparent;color:var(--zp-ink);
  font:inherit;font-size:.9375rem;line-height:1.2;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background var(--zp-ms) var(--zp-ease),border-color var(--zp-ms) var(--zp-ease),color var(--zp-ms) var(--zp-ease);}
.zp-preset[aria-pressed="true"]{background:var(--zp-gold);border-color:var(--zp-gold);color:var(--zp-gold-ink);font-weight:650;}
.zp-preset[aria-pressed="true"]::before{content:"\2713\00a0";content:"\2713\00a0" / "";}
.zp-preset:focus-visible{box-shadow:var(--zp-ring);border-radius:999px;}
@media (hover:hover){.zp-preset:hover{border-color:var(--zp-gold-soft);}.zp-preset[aria-pressed="true"]:hover{border-color:var(--zp-gold-soft);}}

.zp-fields{margin:0;padding:0;border:0;min-width:0;}
.zp-legend{padding:0;margin:0 0 10px;font-size:1rem;font-weight:650;}
.zp-list{display:grid;gap:8px;}
.zp-opt{display:flex;align-items:center;gap:12px;min-height:48px;padding:10px 14px;border:1px solid var(--zp-line-strong);border-radius:12px;background:var(--zp-panel);
  cursor:pointer;-webkit-tap-highlight-color:transparent;transition:border-color var(--zp-ms) var(--zp-ease),background var(--zp-ms) var(--zp-ease);}
.zp-opt:has(.zp-cb:checked){border-color:var(--zp-gold);background:rgba(184,149,80,.13);}
.zp-opt:has(.zp-cb:focus-visible){border-color:var(--zp-gold-soft);box-shadow:var(--zp-ring);}
.zp-name{font-size:.9375rem;}
.zp-cb{-webkit-appearance:none;appearance:none;flex:none;display:grid;place-content:center;width:22px;height:22px;margin:0;border:2px solid var(--zp-dim);border-radius:6px;background:transparent;cursor:pointer;
  transition:background var(--zp-ms) var(--zp-ease),border-color var(--zp-ms) var(--zp-ease);}
.zp-cb::after{content:"";width:6px;height:11px;margin-top:-2px;border:solid var(--zp-gold-ink);border-width:0 2.5px 2.5px 0;transform:rotate(45deg);opacity:0;}
.zp-cb:checked{background:var(--zp-gold);border-color:var(--zp-gold);}
.zp-cb:checked::after{opacity:1;}
.zp-cb:focus-visible{box-shadow:var(--zp-ring);border-radius:6px;}
@media (hover:hover){.zp-opt:hover{border-color:var(--zp-gold-soft);}}

.zp-live{display:flex;flex-wrap:wrap;gap:2px 12px;min-height:1.4em;font-size:.9375rem;color:var(--zp-dim);}
.zp-total{font-weight:650;color:var(--zp-gold-soft);}
.zp-total:empty{display:none;}
.zp-error{font-size:.9375rem;font-weight:600;color:var(--zp-danger);}
.zp-error[hidden]{display:none;}
.zp.has-error .zp-opt{border-color:var(--zp-danger);}

@container (min-width:560px){
  .zp-body{grid-template-columns:minmax(200px,260px) minmax(0,1fr);gap:32px;align-items:start;justify-items:stretch;}
  .zp-car{justify-self:center;}
}

/* Reduced motion: nothing eases, the state simply changes. */
@media (prefers-reduced-motion:reduce){
  .zp *,.zp *::before,.zp *::after{transition:none !important;animation:none !important;}
}
