/* Configuratore Cashmatic — stile originale, nessun riuso del sito di riferimento.
   Colori: navy #00205b e blu #3c57a1 letti dal CSS pubblico del tema Cashmatic
   (wp-content/themes/cashmatic/style.css) — sono i colori ufficiali del brand,
   non una scelta arbitraria. Font: Figtree, lo stesso caricato da cashmatic.it,
   scaricato una volta e servito in locale (stesso criterio delle immagini:
   niente dipendenza da un dominio esterno a runtime). */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-variable.woff2") format("woff2-variations"), url("../fonts/figtree-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #00205b;
  --ink-soft: #5b6478;
  --line: #dde1e9;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --accent: #3c57a1;
  --accent-ink: #ffffff;
  --warn: #b3261e;
  --warn-bg: #fdecea;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--ink);
  color: #fff;
}
.topbar__brand { font-weight: 700; letter-spacing: .02em; font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem); }
.topbar__note { font-size: clamp(.78rem, .74rem + 0.2vw, .88rem); color: #c9cedb; }

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
}

.loading { padding: 40px; text-align: center; color: var(--ink-soft); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.progress {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0 0 20px;
}
.progress li {
  font-size: .72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink-soft);
}
.progress li.is-current { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.progress li.is-done { background: #dde5f5; color: var(--accent); }

.step h2 { margin-top: 0; font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem); line-height: 1.25; }
.step p.hint { color: var(--ink-soft); font-size: clamp(.9rem, .86rem + 0.2vw, 1rem); margin-top: -6px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: border-color .15s;
}
.card:hover { border-color: #9fb3c8; }
.card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card img { width: 100%; height: 130px; object-fit: contain; margin-bottom: 8px; background: #f6f7f9; border-radius: 6px; }
.card__name { font-weight: 600; font-size: clamp(.95rem, .9rem + 0.25vw, 1.05rem); }
.card__price { color: var(--accent); font-weight: 700; margin-top: 4px; font-size: clamp(.95rem, .9rem + 0.25vw, 1.05rem); }
.card__price.is-partial { color: var(--warn); }

.swatches { display: flex; gap: 10px; margin: 14px 0; }
.swatch {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--line); border-radius: 999px;
  padding: 6px 14px 6px 6px; cursor: pointer; background: #fff;
}
.swatch.is-selected { border-color: var(--accent); }
.swatch__dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #0002; }
.swatch__thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; background: #f4f6fa; }

.field { margin: 14px 0; }
.field label { display: block; font-weight: 600; font-size: clamp(.9rem, .86rem + 0.2vw, 1rem); margin-bottom: 6px; }
.field select, .field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px;
  font-size: clamp(.95rem, .9rem + 0.25vw, 1.05rem); background: #fff; color: var(--ink);
}
.field select:disabled { background: #f0f1f4; color: #9aa1b0; }
.field .lock-note { font-size: .78rem; color: var(--warn); margin-top: 4px; }
.field .side-tag { font-weight: 400; color: var(--ink-soft); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.acc-row {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.acc-row__thumb { width: 40px; height: 40px; object-fit: contain; background: #f4f6fa; border-radius: 6px; margin-right: 10px; flex-shrink: 0; }
.acc-row__name { font-size: .9rem; }
.acc-row__price { color: var(--ink-soft); font-size: .82rem; }
.acc-row__qty { display: flex; align-items: center; gap: 8px; }
.acc-row__qty button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 1rem;
}
.acc-row.is-quote-only .acc-row__price::after { content: " · a preventivo"; }

.price-missing { color: var(--warn); font-weight: 600; }
.badge-missing {
  display: inline-block; font-size: .7rem; padding: 2px 7px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn); margin-left: 6px;
}

.actions { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }
button.btn {
  border: none; border-radius: 8px; padding: 12px 22px; font-size: clamp(.92rem, .88rem + 0.2vw, 1rem); font-weight: 600;
  cursor: pointer; background: var(--accent); color: var(--accent-ink);
}
button.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.btn:disabled { opacity: .5; cursor: not-allowed; }

.summary-panel { position: sticky; top: 20px; }
.summary-panel h3 { margin-top: 0; font-size: 1rem; }
.summary-panel img { width: 100%; border-radius: 8px; background: #f6f7f9; margin-bottom: 10px; min-height: 120px; object-fit: contain; }

/* Composizione: foto principale al centro, accessori scelti intorno per categoria.
   Non è un fotomontaggio pixel-perfetto (le foto non sono livelli allineati) — è un
   raggruppamento visivo che mostra cosa fa parte della configurazione, ciascuno con
   la propria etichetta, senza inventare un incastro fisico che le foto non supportano. */
.hero-composite { margin-bottom: 10px; }
.hero-composite__main { width: 100%; min-height: 140px; object-fit: contain; background: #f6f7f9; border-radius: 8px; display: block; }
.hero-composite__row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.hero-composite__row.is-below { justify-content: center; }
.hero-satellite { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; }
.hero-satellite img { width: 52px; height: 52px; object-fit: contain; background: #f6f7f9; border-radius: 8px; border: 1px solid var(--line); }
.hero-satellite span { font-size: .66rem; color: var(--ink-soft); text-align: center; line-height: 1.15; }
.summary-line { display: flex; justify-content: space-between; font-size: .85rem; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.summary-code { font-family: "Consolas", monospace; font-size: .85rem; background: #f4f6fa; padding: 8px; border-radius: 6px; word-break: break-all; margin-bottom: 10px; }
.summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--ink); }
.summary-note { font-size: .78rem; color: var(--warn); margin-top: 6px; }

.customer-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .customer-form { grid-template-columns: 1fr; } }

.final-summary table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.final-summary th, .final-summary td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.final-summary th { color: var(--ink-soft); font-weight: 600; }
.final-summary td.num { text-align: right; white-space: nowrap; }

.share-box { background: #f4f6fa; border-radius: 8px; padding: 12px; margin-top: 14px; font-size: .85rem; }
.share-box input { width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }

.error-box { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 14px; margin: 14px 0; font-size: .88rem; }
