/* ─────────────────────────────────────────────────────────────────────────
   prezzi.css — sezione «Costi indicativi» della pagina Prezzi (1 ott 2026).

   Caricato automaticamente dal tema per lo slug "prezzi"
   (assets/css/pages/<slug>.css, vedi functions.php).

   Struttura e dati vengono dalla bozza «Sezione costi» (schede per tipo di
   preparazione, pulsanti per variante, tabella del costo medio in farmacia,
   tabella «Come si compone il costo»); colori, caratteri, raggi e ombre sono
   quelli del tema: le schede riprendono le schede del vecchio calcolatore, le
   intestazioni delle tabelle quelle del confronto Standard / Plus.

   Senza JavaScript (.costi senza .is-js) non ci sono schede né pulsanti: si
   vedono tutte le preparazioni, una sotto l'altra, ognuna col suo titolo.
   ───────────────────────────────────────────────────────────────────────── */

.costi-section {
  padding: 8px 0 88px;
}

/* ───── Schede: un tipo di preparazione ciascuna ───── */
.costi-tabs {
  display: flex;
  gap: 36px;
  padding: 0 4px;
  border-bottom: 1px solid var(--ink-100);
}
.costi-tab {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-400);
  min-height: 44px;
  padding: 12px 2px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: color 120ms, border-color 120ms;
}
.costi-tab:hover { color: var(--ink-700); }
.costi-tab.is-active {
  color: var(--teal-900);
  border-bottom-color: var(--teal-700);
  font-weight: 600;
}
.costi-tab:focus-visible,
.costi-variante:focus-visible {
  outline: 2px solid var(--teal-700);
  outline-offset: 3px;
}

.costi-pannello { margin-top: 32px; }
.costi-pannello-titolo { margin-bottom: 16px; }

/* ───── Pulsanti delle varianti (es. Bilanciato · THC dominante) ───── */
.costi-varianti {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 32px;
}
.costi-varianti-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-500);
}
.costi-variante {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: white;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink-700);
  cursor: pointer;
  transition: border-color 120ms, background 120ms, color 120ms;
}
.costi-variante:hover { border-color: var(--teal-700); }
.costi-variante.is-active {
  background: var(--teal-50);
  border-color: var(--teal-700);
}
.costi-variante-nome { font-weight: 600; color: var(--ink-900); }
.costi-variante-sotto { font-size: 13px; color: var(--ink-500); }

/* ───── Schede e pulsanti esistono solo col JavaScript ───── */
.costi:not(.is-js) .costi-tabs,
.costi:not(.is-js) .costi-varianti { display: none; }
.costi:not(.is-js) .costi-pannello + .costi-pannello { margin-top: 48px; }
.costi.is-js .costi-pannello-titolo,
.costi.is-js .costi-pannello:not(.is-active),
.costi.is-js .costi-tabella.has-varianti tbody tr:not(.is-active) { display: none; }

/* ───── Tabelle (costo medio e voci del costo) ───── */
.costi-tabella {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  text-align: left;
}
.costi-tabella thead th {
  padding: 14px 28px;
  background: var(--paper-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.costi-tabella tbody th,
.costi-tabella tbody td {
  padding: 26px 28px;
  vertical-align: middle;
  text-align: left;
}
.costi-tabella tbody tr + tr th,
.costi-tabella tbody tr + tr td { border-top: 1px solid var(--ink-100); }
/* Col JavaScript si vede una riga sola: niente filetto sopra di lei. */
.costi.is-js .costi-tabella.has-varianti tbody th,
.costi.is-js .costi-tabella.has-varianti tbody td { border-top: 0; }

.costi-nome {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-900);
}
.costi-formato {
  font-size: 15.5px;
  color: var(--ink-700);
}
.costi-costo { white-space: nowrap; }
.costi-prefisso {
  margin-right: 6px;
  font-size: 14px;
  color: var(--ink-500);
}
.costi-prezzo {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.costi-include {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-500);
}

.costi-nota {
  max-width: 900px;
  margin: 20px auto 0;
  text-align: center;
  font-style: italic;
  line-height: 1.6;
}

/* ───── Come si compone il costo ───── */
.costi-composizione { margin-top: 72px; }
.costi-composizione-testo {
  max-width: 840px;
  margin-top: 8px;
  font-size: 16.5px;
}
.costi-tabella-voci { margin-top: 24px; box-shadow: var(--shadow-1); }
.costi-tabella-voci tbody th,
.costi-tabella-voci tbody td {
  padding: 20px 28px;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-700);
}
.costi-tabella-voci tbody th { font-weight: 600; color: var(--ink-900); }
.costi-disclaimer {
  max-width: 900px;
  margin-top: 16px;
  line-height: 1.6;
}

/* ───── Telefono: schede scorrevoli, righe in colonna ───── */
@media (max-width: 640px) {
  .costi-tabs {
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .costi-tabs::-webkit-scrollbar { display: none; }
  .costi-tab { font-size: 16px; white-space: nowrap; }

  .costi-varianti { justify-content: flex-start; }

  /* Quattro colonne non stanno in 350px: ogni riga diventa un blocco e
     l'intestazione di colonna va sopra il valore. */
  .costi-tabella thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .costi-tabella,
  .costi-tabella tbody,
  .costi-tabella tr,
  .costi-tabella tbody th,
  .costi-tabella tbody td { display: block; width: auto; }
  .costi-tabella tbody th,
  .costi-tabella tbody td { padding: 6px 20px; }
  .costi-tabella tbody tr { padding: 14px 0; }
  .costi-tabella tbody tr + tr th,
  .costi-tabella tbody tr + tr td { border-top: 0; }
  .costi-tabella tbody tr + tr { border-top: 1px solid var(--ink-100); }
  .costi.is-js .costi-tabella.has-varianti tbody tr { border-top: 0; }
  .costi-tabella td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-400);
  }
  .costi-tabella td[data-label=""]::before { content: none; }
  .costi-costo { white-space: normal; }
  .costi-prezzo { font-size: 24px; }
  .costi-composizione { margin-top: 56px; }
}
