/* Configuratore Orologi
 *
 * Il sistema viene dall'oggetto: scala graduata, pozzetti circolari, cifre
 * tabellari, i toni di una platina di movimento sotto luce piena.
 * Vedi DESIGN.md per il perché di ogni scelta.
 */

:root {
  --ground: oklch(96.4% 0.004 210);
  --ground-2: oklch(93.4% 0.005 210);
  --ground-3: oklch(89.6% 0.006 210);
  --ink: oklch(26% 0.014 250);
  --ink-2: oklch(47% 0.011 250);
  --ink-3: oklch(63% 0.009 250);
  --rule: oklch(87.5% 0.006 210);
  --rule-2: oklch(79% 0.008 210);
  --accent: oklch(42% 0.09 160);

  --sans: 'Segoe UI Variable Display', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial,
    sans-serif;
  --tech: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --foot-h: 236px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: color-mix(in oklch, var(--accent) 22%, transparent);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gate[hidden],
.cfg[hidden],
.empty[hidden],
.continue[hidden] {
  display: none;
}

/* ═══ Indice dei modelli ═══════════════════════════════════════════════════ */

.gate {
  min-height: 100%;
  padding: clamp(44px, 6vw, 88px) clamp(20px, 5vw, 72px) 112px;
  max-width: 1580px;
  margin-inline: auto;
}

.gate__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: end;
  gap: clamp(36px, 7vw, 112px);
  padding-bottom: clamp(40px, 6vw, 76px);
  border-bottom: 1px solid var(--rule);
}

.gate__intro {
  max-width: 720px;
}

.gate__count {
  margin: 0 0 16px;
  color: var(--ink-3);
  font-family: var(--tech);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.gate__title {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  font-weight: 300;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.gate__lede {
  margin: 24px 0 0;
  color: var(--ink-2);
  max-width: 56ch;
  font-size: clamp(0.9375rem, 1.15vw, 1.0625rem);
}

.continue {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 17px 18px;
  border: 1px solid var(--rule-2);
  background: var(--ground-2);
  color: var(--ink);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}

.continue:hover {
  border-color: var(--ink-3);
  background: var(--ground-3);
}

.continue__eyebrow {
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.continue__label {
  font-size: 1rem;
}

.continue svg {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

.collection__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 4vw, 48px) 0 22px;
}

.collection__head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.collection__head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

/* Lastre, non schede: nessuna scatola attorno ai modelli.
 * auto-fill, non auto-fit: le colonne vuote restano, così una maison con un
 * solo modello lo mostra della stessa misura delle altre invece di stirarlo. */
.plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(44px, 5vw, 76px) clamp(20px, 2.8vw, 44px);
}

.plate {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 0;
  min-width: 0;
  animation: rise 0.5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* Sfalsamento alternato: rompe la griglia di schede tutte uguali. */
.plate__art {
  position: relative;
  aspect-ratio: 4 / 5;
  display: block;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), var(--rule) 50%, transparent calc(50% + 0.5px)),
    radial-gradient(68% 58% at 50% 40%, oklch(98.2% 0.003 210) 0%, var(--ground-2) 100%);
  overflow: hidden;
}

.plate__art::after {
  content: '';
  position: absolute;
  inset: 14px;
  border-top: 1px solid color-mix(in oklch, var(--rule-2) 55%, transparent);
  border-bottom: 1px solid color-mix(in oklch, var(--rule-2) 55%, transparent);
  pointer-events: none;
}

.plate__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3% 0;
  transition: transform 0.7s var(--ease);
}

.plate[data-model='gmt'] img[data-slot='bracelet'] {
  z-index: 0;
}

.plate[data-model='gmt'] img[data-slot='dial'] {
  z-index: 1;
}

.plate[data-model='gmt'] img[data-slot='case'] {
  z-index: 2;
}

.plate[data-model='gmt'] img[data-slot='bezel'] {
  z-index: 3;
}

.plate:hover .plate__art img,
.plate:focus-visible .plate__art img {
  transform: scale(1.05);
}

.plate__no {
  font-family: var(--tech);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  padding: 13px 0 0;
  border-top: 1px solid var(--rule);
  margin-top: 14px;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.plate:hover .plate__no {
  color: var(--accent);
  border-top-color: var(--rule-2);
}

.plate__name {
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-top: 6px;
}

.plate__blurb {
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.65;
  margin-top: 6px;
  max-width: 34ch;
}

.plate__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-height: 44px;
  margin-top: 12px;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
}

.plate__cta::after {
  content: '→';
  color: var(--accent);
  transition: transform 0.24s var(--ease);
}

.plate:hover .plate__cta::after,
.plate:focus-visible .plate__cta::after {
  transform: translateX(4px);
}

.plate:focus-visible {
  outline-offset: 8px;
}

/* ═══ Configuratore ════════════════════════════════════════════════════════ */

.cfg {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  background: radial-gradient(110% 80% at 50% 0%, oklch(98.2% 0.003 210) 0%, var(--ground) 60%, var(--ground-2) 100%);
}

.cfg__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 20px;
  padding: 22px clamp(18px, 3vw, 34px) 0;
  transition: opacity 0.4s var(--ease);
}

.back {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  font-size: 0.8125rem;
  color: var(--ink-3);
  justify-self: start;
  transition: color 0.22s var(--ease);
}

.back:hover {
  color: var(--ink);
}

.back svg {
  transition: transform 0.28s var(--ease);
}

.back:hover svg {
  transform: translateX(-3px);
}

.cfg__id {
  text-align: center;
}

.cfg__model {
  margin: 0;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.cfg__ref {
  margin: 5px 0 0;
  font-family: var(--tech);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.cfg__ref-key {
  color: var(--ink-3);
  opacity: 0.66;
}

.cfg__price {
  margin: 2px 0 0;
  font-family: var(--tech);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: opacity 0.18s var(--ease);
}

.cfg__tools {
  position: relative;
  display: flex;
  gap: 7px;
  justify-self: end;
}

.actions-toggle,
.summary-toggle,
.complete {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--rule-2);
  background: color-mix(in oklch, var(--ground) 88%, transparent);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
}

.actions-toggle {
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
}

.actions-toggle:hover,
.summary-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.actions-panel {
  display: flex;
  gap: 7px;
}

.actions-panel[hidden],
.spec[hidden] {
  display: none;
}

.tool {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.75rem;
  white-space: nowrap;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
}

.tool:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.tool--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ground);
}

.tool--solid:hover {
  color: var(--ground);
  border-color: var(--accent);
  filter: brightness(1.16);
}

/* ── Scena ─────────────────────────────────────────────────────────────── */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 10px 24px 0;
  overflow: hidden;
}

body.is-detail-view .stage::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(52vh, 520px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in oklch, var(--rule-2) 72%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 18px color-mix(in oklch, var(--ground-2) 34%, transparent),
    0 0 0 19px color-mix(in oklch, var(--rule) 64%, transparent);
  opacity: 0.72;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transition: opacity 0.32s var(--ease), transform 0.55s var(--ease);
}

.viewport {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: zoom-in;
  display: grid;
  place-items: center;
  height: 100%;
  width: 100%;
  position: relative;
}

.viewport.is-detail {
  cursor: grab;
  touch-action: none;
}

.viewport.is-detail::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 4;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  background: color-mix(in oklch, var(--ground) 90%, transparent);
  color: var(--ink-3);
  font-size: 0.6875rem;
  line-height: 1;
  pointer-events: none;
  transform: translateX(-50%);
}

.viewport.is-detail.is-panning {
  cursor: grabbing;
}

/* Attesa dichiarata invece di un rettangolo vuoto: conta con asset pesanti. */
.viewport.is-loading .watch-scene {
  opacity: 0;
}

.viewport.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 1px;
  margin-left: -28px;
  background: var(--rule-2);
  animation: attesa 1.2s ease-in-out infinite;
}

@keyframes attesa {
  0%,
  100% {
    transform: scaleX(0.25);
    opacity: 0.5;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

body.is-zoomed .viewport:not(.is-detail) {
  cursor: zoom-out;
}

.watch-scene {
  position: relative;
  display: block;
  height: min(100%, 730px);
  aspect-ratio: 1000 / 1500;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --settle-y: 0deg;
  --pan-x: 0%;
  --pan-y: 0%;
  opacity: 1;
  transform:
    translate3d(var(--pan-x), var(--pan-y), 0)
    perspective(1100px)
    rotateX(var(--tilt-x))
    rotateY(calc(var(--tilt-y) + var(--settle-y)));
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease), opacity 0.4s var(--ease);
}

.watch {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  /* Il centro cassa sta a 700/1500: lo zoom parte da lì, non dal centro tela. */
  transform-origin: 50% 46.7%;
  transform: scale(var(--zoom, 1));
  transition: transform 0.62s var(--ease), opacity 0.4s var(--ease);
  filter: drop-shadow(0 22px 30px oklch(26% 0.014 250 / 0.14));
}

.watch--previous {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.watch-scene.is-comparing .watch:not(.watch--previous) {
  opacity: 0;
}

.watch-scene.is-comparing .watch--previous {
  opacity: 1;
}

.layer {
  position: absolute;
  inset: 0;
}

/* Il GMT v2 incorpora vetro e lancette nella cassa: la cassa deve restare
   sopra il quadrante, mentre lunetta e bracciale mantengono la profondità fisica. */
.cfg[data-model='gmt'] .layer[data-slot='bracelet'] {
  z-index: 0;
}

.cfg[data-model='gmt'] .layer[data-slot='dial'] {
  z-index: 1;
}

.cfg[data-model='gmt'] .layer[data-slot='case'] {
  z-index: 2;
}

.cfg[data-model='gmt'] .layer[data-slot='bezel'] {
  z-index: 3;
}

.layer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.42s var(--ease);
}

.layer img.is-on {
  opacity: 1;
}

/* ── Viste ─────────────────────────────────────────────────────────────── */

.views {
  position: absolute;
  right: clamp(14px, 2vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.views[hidden] {
  display: none;
}

.view {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 10px 0 10px 24px;
  font-size: 0.8125rem;
  color: var(--ink-3);
  position: relative;
  transition: color 0.22s var(--ease);
}

.view::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%) scaleX(0.4);
  transform-origin: left;
  transition: transform 0.32s var(--ease);
}

.view:hover {
  color: var(--ink-2);
}

.view[aria-selected='true'] {
  color: var(--accent);
}

.view[aria-selected='true']::before {
  transform: translateY(-50%) scaleX(1);
}

/* ── Scheda tecnica ────────────────────────────────────────────────────── */

.spec {
  position: absolute;
  left: clamp(14px, 2vw, 30px);
  bottom: 16px;
  z-index: 2;
  margin: 0;
  width: 216px;
  border-top: 1px solid var(--rule);
  transition: opacity 0.4s var(--ease);
}

.summary-toggle {
  display: none;
}

.spec__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}

.spec dt {
  font-size: 0.6875rem;
  color: var(--ink-3);
  flex: none;
}

.spec dd {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink);
  text-align: right;
}

.spec__row--total {
  border-bottom: 0;
  padding-top: 10px;
}

.spec__row--total dt {
  color: var(--ink-2);
}

.spec__row--total dd {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* ── Ingrandimento ─────────────────────────────────────────────────────── */

.zoom {
  position: absolute;
  right: clamp(14px, 2vw, 30px);
  bottom: 16px;
  z-index: 2;
  appearance: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule-2);
  background: color-mix(in oklch, var(--ground) 70%, transparent);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.zoom:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.zoom__v {
  transition: opacity 0.22s var(--ease), transform 0.32s var(--ease);
  transform-origin: 50% 50%;
}

.zoom[aria-pressed='true'] .zoom__v {
  opacity: 0;
  transform: scaleY(0.2);
}

body.is-zoomed .cfg__top,
body.is-zoomed .foot,
body.is-zoomed .spec,
body.is-zoomed .views {
  opacity: 0;
  pointer-events: none;
}

body.is-zoomed .watch-scene {
  height: min(100%, 1000px);
}

.compare {
  position: absolute;
  right: 76px;
  bottom: 16px;
  z-index: 3;
  min-width: 88px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: color-mix(in oklch, var(--ground) 88%, transparent);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.compare[hidden] {
  display: none;
}

.compare__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.compare[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Piede: scala graduata e pozzetti ──────────────────────────────────── */

.foot {
  border-top: 1px solid var(--rule);
  background: linear-gradient(to bottom, color-mix(in oklch, var(--ground) 82%, transparent), var(--ground-2));
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  min-height: var(--foot-h);
  transition: opacity 0.4s var(--ease);
}

/* Un minute track: graduazioni minori continue, una maggiore per fase. */
.track {
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(20px, 4.5vw, 68px);
  padding: 19px 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.track::-webkit-scrollbar {
  display: none;
}

.track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background-image:
    linear-gradient(var(--rule), var(--rule)),
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 10px);
  background-size: 100% 1px, 100% 5px;
  background-position: 0 0, 0 1px;
  background-repeat: no-repeat, repeat-x;
  opacity: 0.85;
}

.grad {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
  padding: 12px 2px 0;
  display: grid;
  gap: 1px;
  justify-items: center;
  white-space: nowrap;
  color: var(--ink-3);
  transition: color 0.22s var(--ease);
}

.grad::before {
  content: '';
  position: absolute;
  top: -19px;
  left: 50%;
  width: 1.5px;
  height: 13px;
  background: var(--rule-2);
  transform: translateX(-50%);
  transition: height 0.32s var(--ease), background 0.22s var(--ease);
}

.grad:hover {
  color: var(--ink-2);
}

.grad[aria-selected='true'] {
  color: var(--ink);
}

.grad[aria-selected='true']::before {
  height: 19px;
  width: 2px;
  background: var(--accent);
}

.grad__num {
  font-family: var(--tech);
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.grad__name {
  font-size: 0.8125rem;
}

.prompt {
  margin: 20px 0 0;
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 300;
  color: var(--ink);
}

.chooser {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 20px 0;
}

.arrow {
  appearance: none;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--ink-2);
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease), opacity 0.22s var(--ease);
}

.arrow:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink-3);
}

.arrow:disabled {
  opacity: 0.24;
  cursor: default;
}

.swatches {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 8px 12px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  max-width: min(100%, 940px);
}

.swatches::-webkit-scrollbar {
  display: none;
}

/* Pozzetto: il disco sta in un incavo, il selezionato prende una lunetta. */
.swatch {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  flex: none;
  scroll-snap-align: center;
  position: relative;
  width: 72px;
  height: 94px;
  transition: transform 0.26s var(--ease);
}

.swatch:hover:not(:disabled) {
  transform: translateY(-3px);
}

.swatch__disc {
  position: absolute;
  inset: 0 0 auto;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(68% 62% at 50% 34%, var(--ground-2), var(--ground-3));
  box-shadow:
    inset 0 1px 3px oklch(26% 0.014 250 / 0.16),
    inset 0 0 0 1px oklch(26% 0.014 250 / 0.06);
}

.swatch--rect .swatch__disc {
  border-radius: 10px;
}

.swatch__disc img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--z, 1.55) * 100%);
  transform: translate(-50%, calc(-50% + var(--sy, 3.5%)));
  pointer-events: none;
}

.swatch::after {
  content: '';
  position: absolute;
  top: -7px;
  left: -7px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.28s var(--ease), transform 0.36s var(--ease);
  pointer-events: none;
}

.swatch--rect::after {
  border-radius: 15px;
}

.swatch[aria-selected='true']::after {
  opacity: 1;
  transform: scale(1);
}

.swatch:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.swatch:disabled .swatch__disc {
  filter: grayscale(0.42);
}

.swatch__meta {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 92px;
  transform: translateX(-50%);
  font-family: var(--tech);
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ink-3);
  white-space: nowrap;
}

.chosen {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ink-2);
  min-height: 3.8em;
  line-height: 1.25;
}

.chosen p {
  margin: 0;
}

.chosen__price {
  margin-top: 2px !important;
  font-family: var(--tech);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.chosen__availability {
  margin-top: 2px !important;
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.complete {
  display: none;
}

/* ═══ Preventivo ══════════════════════════════════════════════════════════ */

.quote {
  position: fixed;
  z-index: 50;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  max-height: min(72dvh, 640px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom));
  background: var(--ground);
  border: 1px solid var(--rule-2);
  box-shadow: 0 22px 64px oklch(26% 0.014 250 / 0.2);
}

.quote[hidden] {
  display: none;
}

.quote__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.quote__eyebrow {
  margin: 0 0 2px;
  font-size: 0.6875rem;
  color: var(--accent);
}

.quote h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.2;
}

.quote__close {
  appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.quote__reference {
  margin: 10px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--tech);
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.quote__summary {
  margin: 0;
}

.quote__row {
  display: grid;
  grid-template-columns: minmax(88px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  padding: 6px 0;
  font-size: 0.75rem;
}

.quote__row dt {
  color: var(--ink-3);
}

.quote__row dd {
  margin: 0;
  text-align: right;
  color: var(--ink-2);
}

.quote__row--emphasis {
  margin-top: 5px;
  padding-top: 11px;
  border-top: 1px solid var(--rule);
}

.quote__row--emphasis dd {
  font-family: var(--tech);
  font-size: 0.9375rem;
  color: var(--ink);
}

.quote__actions {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.quote__action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
}

.quote__action[hidden] {
  display: none;
}

.quote__action--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ground);
}

.quote__setup,
.quote__note {
  margin: 12px 0 0;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--ink-3);
}

.quote__fallback {
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--rule);
  background: var(--ground-2);
  color: var(--ink-2);
  font-family: var(--tech);
  font-size: 0.6875rem;
  white-space: pre-wrap;
}

/* ═══ Toast ════════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  z-index: 60;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-size: 0.8125rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  max-width: min(92vw, 560px);
  text-align: center;
  box-shadow: 0 10px 30px oklch(26% 0.014 250 / 0.2);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ═══ Nessun asset ═════════════════════════════════════════════════════════ */

.empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.empty__card {
  max-width: 620px;
  border: 1px solid var(--rule);
  padding: 38px 40px;
  background: color-mix(in oklch, var(--ground) 60%, white);
}

.empty h1 {
  margin: 0 0 14px;
  font-size: 1.375rem;
  font-weight: 300;
}

.empty p {
  color: var(--ink-2);
}

.empty code {
  font-family: var(--tech);
  font-size: 0.8125rem;
  color: var(--ink);
}

.empty pre {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--ground-2);
  border: 1px solid var(--rule);
  overflow-x: auto;
}

.empty__hint {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* ═══ Adattamento ══════════════════════════════════════════════════════════ */

@media (max-width: 1120px) {
  .spec {
    display: none;
  }

  .plates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  :root {
    --foot-h: 286px;
  }

  .foot {
    min-height: 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .gate {
    padding: 40px 18px 64px;
  }

  .gate__head {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-bottom: 32px;
  }

  .gate__title {
    max-width: 10ch;
    font-size: clamp(2.75rem, 14vw, 4.5rem);
  }

  .continue {
    width: min(100%, 380px);
  }

  .collection__head {
    padding: 26px 0 18px;
  }

  .collection__head p {
    display: none;
  }

  .plates {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .plate {
    min-height: 210px;
    grid-template-columns: minmax(132px, 42vw) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    column-gap: 18px;
    align-items: start;
  }

  .plate__art {
    grid-column: 1;
    grid-row: 1 / 5;
    aspect-ratio: 3 / 4;
  }

  .plate__no {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    padding-top: 9px;
  }

  .plate__name {
    grid-column: 2;
    grid-row: 2;
    margin-top: 7px;
  }

  .plate__blurb {
    grid-column: 2;
    grid-row: 3;
    font-size: 0.75rem;
    line-height: 1.5;
  }

  .plate__cta {
    grid-column: 2;
    grid-row: 4;
    margin-top: 4px;
  }

  .cfg__top {
    grid-template-columns: 60px 1fr 72px;
    align-items: center;
    gap: 6px;
    padding: max(8px, env(safe-area-inset-top)) 12px 0;
  }

  .cfg {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .back {
    width: 44px;
    height: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    justify-content: center;
  }

  .cfg__id {
    min-width: 0;
  }

  .cfg__model {
    margin-top: 0;
    font-size: 1.125rem;
  }

  .cfg__ref {
    margin-top: 2px;
  }

  .cfg__price {
    margin-top: 0;
    font-size: 0.6875rem;
  }

  .cfg__tools {
    justify-self: end;
  }

  .actions-toggle {
    width: 58px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .actions-toggle svg {
    width: 20px;
    height: 20px;
  }

  .actions-panel {
    position: absolute;
    z-index: 30;
    right: 0;
    top: calc(100% + 8px);
    width: min(250px, calc(100vw - 24px));
    padding: 8px;
    display: grid;
    background: var(--ground);
    border: 1px solid var(--rule-2);
    box-shadow: 0 20px 48px oklch(26% 0.014 250 / 0.16);
  }

  .actions-panel .tool {
    min-height: 44px;
    border: 0;
    border-radius: 0;
    text-align: left;
  }

  .summary-toggle {
    position: absolute;
    z-index: 4;
    left: 12px;
    bottom: 10px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    font-size: 0.75rem;
  }

  .summary-toggle[aria-expanded='true'] svg {
    transform: rotate(180deg);
  }

  .spec {
    display: block;
    left: 12px;
    right: 12px;
    bottom: 62px;
    width: auto;
    max-width: 320px;
    padding: 10px 12px;
    background: color-mix(in oklch, var(--ground) 96%, transparent);
    border: 1px solid var(--rule);
    box-shadow: 0 16px 42px oklch(26% 0.014 250 / 0.12);
  }

  .stage {
    display: flex;
    flex-direction: column;
    padding: 4px 10px 0;
  }

  body.is-detail-view .stage::before,
  .viewport.is-detail::after {
    display: none;
  }

  .views {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 4px;
    margin-bottom: 2px;
  }

  body.is-detail-view .views {
    z-index: 5;
    padding-inline: 8px;
    border: 1px solid color-mix(in oklch, var(--rule-2) 76%, transparent);
    border-radius: 999px;
    background: color-mix(in oklch, var(--ground) 94%, transparent);
    box-shadow: 0 4px 18px oklch(26% 0.014 250 / 0.08);
    backdrop-filter: blur(12px);
  }

  .view {
    min-height: 44px;
    padding: 6px 12px;
  }

  .view::before {
    display: none;
  }

  .view[aria-selected='true'] {
    box-shadow: inset 0 -1px 0 var(--accent);
  }

  .zoom {
    right: 12px;
    bottom: 10px;
  }

  .swatch {
    width: 62px;
    height: 80px;
  }

  .swatch__disc {
    height: 62px;
  }

  .swatch::after {
    top: -5px;
    left: -5px;
    width: 72px;
    height: 72px;
  }

  .swatch__meta {
    width: 80px;
  }

  .swatches {
    justify-content: flex-start;
    gap: 14px;
    width: min(100%, 290px);
    padding: 7px 5px 8px;
  }

  .track {
    justify-content: flex-start;
    gap: 28px;
    padding: 11px 22px 0;
  }

  .track::before {
    height: 4px;
    background-size: 100% 1px, 100% 3px;
  }

  .grad {
    padding-top: 8px;
  }

  .grad::before {
    top: -11px;
    height: 9px;
  }

  .grad[aria-selected='true']::before {
    height: 13px;
  }

  .grad {
    min-width: 44px;
    min-height: 44px;
  }

  .prompt {
    margin-top: 6px;
    font-size: 0.9375rem;
    line-height: 1.25;
  }

  .chooser {
    min-width: 0;
    padding: 4px 12px 0;
    gap: 7px;
  }

  .swatches {
    width: auto;
    min-width: 0;
    max-width: 290px;
    flex: 1;
  }

  .chosen {
    min-height: 2.35em;
    margin-top: 1px;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    column-gap: 8px;
    line-height: 1.15;
  }

  .chosen__availability {
    grid-column: 1 / -1;
  }

  .complete {
    width: min(calc(100% - 32px), 360px);
    margin: 4px auto 0;
    display: block;
    background: var(--ink);
    border-color: var(--ink);
    color: var(--ground);
    border-radius: 2px;
    font-weight: 500;
  }

  .complete:hover {
    background: var(--accent);
    border-color: var(--accent);
  }

}

@media (min-width: 881px) {
  body.is-detail-view .watch {
    transform: scale(1.82);
  }

  body.is-detail-view .spec {
    opacity: 0.72;
  }

  .actions-toggle {
    display: none;
  }

  .actions-panel {
    display: flex;
  }

  .spec {
    display: block;
  }

  .quote {
    left: auto;
    right: 24px;
    top: 96px;
    bottom: auto;
    width: 320px;
    max-height: calc(100dvh - 120px);
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .watch-scene {
    --tilt-x: 0deg !important;
    --tilt-y: 0deg !important;
    --settle-y: 0deg !important;
    --pan-x: 0% !important;
    --pan-y: 0% !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.08s !important;
  }
}
