/**
 * Caso studio "Configuratore 3D Curaboots" (template-parts/caso-configuratore-curaboots.php).
 * Caricato SOLO dalla pagina Configuratore 3D di prodotto. Mobile first: pannello sotto il modello,
 * affiancato da 992px.
 */
.cdx-cfg { display: grid; gap: var(--cd-space-8); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 992px) {
  .cdx-cfg { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--cd-space-12); }
  .cdx-cfg__panel { position: sticky; top: 6rem; }
}

/* ---------- Modello 3D ---------- */
.cdx-cfg__stage { position: relative; }
.cdx-cfg__viewer {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 70vh; /* height:auto annulla i 150px di default */
  background: radial-gradient(circle at 50% 40%, #fff 0%, #f3eef8 70%);
  border-radius: var(--cd-radius-lg); box-shadow: var(--cd-shadow-lg);
  --poster-color: transparent;
}
.cdx-cfg__viewer:focus-visible { outline: 3px solid var(--cd-primary-500); outline-offset: 3px; }
.cdx-cfg__loading { /* al posto dell'anteprima, finché il modello non è pronto */
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .75rem; padding: 1rem; text-align: center; font-weight: 600; color: var(--cd-color-text-soft);
}
.cdx-cfg__spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid #e7dcef; border-top-color: var(--cd-primary-500); animation: cdx-cfg-spin .9s linear infinite;
}
@keyframes cdx-cfg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cdx-cfg__spinner { animation-duration: 3s; } }
.cdx-cfg__ar { position: absolute; right: 1rem; bottom: 1rem; }
.cdx-cfg__note { margin: var(--cd-space-3) 0 0; color: var(--cd-color-text-soft); }

/* ---------- Pannello: linea, colore, aiuto, pulsanti ---------- */
.cdx-cfg__group { margin: 0 0 var(--cd-space-6); padding: 0; border: 0; min-width: 0; }
.cdx-cfg__label { display: block; margin: 0 0 var(--cd-space-3); font-weight: 600; color: var(--cd-color-heading); }
.cdx-cfg__lines { display: flex; flex-wrap: wrap; gap: .5rem; }
.cdx-cfg__line {
  min-height: 44px; padding: .5rem 1.1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--cd-color-border); background: #fff; color: var(--cd-color-heading); font: inherit;
}
.cdx-cfg__line:hover, .cdx-cfg__line:focus-visible { border-color: var(--cd-primary-500); }
.cdx-cfg__line:focus-visible { outline: 3px solid var(--cd-primary-500); outline-offset: 2px; }
.cdx-cfg__line[aria-pressed="true"] { background: var(--cd-gradient-brand); border-color: transparent; color: #fff; }

.cdx-cfg__colors { display: flex; flex-wrap: wrap; gap: .5rem; }
.cdx-cfg__colors legend { flex-basis: 100%; }
.cdx-cfg__swatch { position: relative; cursor: pointer; display: inline-flex; }
.cdx-cfg__swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cdx-cfg__dot {
  width: 44px; height: 44px; border-radius: 50%; background: var(--cd-cfg-dot);
  border: 3px solid #fff; box-shadow: 0 0 0 1px var(--cd-color-border);
}
.cdx-cfg__swatch input:checked + .cdx-cfg__dot { box-shadow: 0 0 0 3px var(--cd-primary-500); }
.cdx-cfg__swatch input:focus-visible + .cdx-cfg__dot { outline: 3px solid var(--cd-violet-600); outline-offset: 3px; }

.cdx-cfg__help { margin: 0 0 var(--cd-space-6); padding-left: 1.1rem; list-style: disc; color: var(--cd-color-text-soft); }
.cdx-cfg__help li { margin-bottom: .35rem; }
.cdx-cfg__cliente {
  margin: 0 0 var(--cd-space-6); padding: var(--cd-space-5);
  background: var(--cd-color-surface); border: 1px solid var(--cd-color-border); border-radius: var(--cd-radius-md);
}
.cdx-cfg__cliente p:last-child { margin: 0; color: var(--cd-color-text-soft); }
.cdx-cfg__actions { display: grid; gap: .75rem; }
.cdx-cfg__actions .cd-btn { width: 100%; justify-content: center; text-align: center; }
html:not(.cdx-cfg-js) .cdx-cfg__group,
html:not(.cdx-cfg-js) .cdx-cfg__help,
html:not(.cdx-cfg-js) .cdx-cfg__reset { display: none; } /* senza JS linea, colore e reset non funzionano */
