/* ============================================================
   prezzomediocarburanti.it — stile.css
   Identità visiva ripresa dal display totem: fondo blu notte,
   schede in vetro, accento azzurro.
   ============================================================ */

:root {
  --fondo-1: #0d1b2a;
  --fondo-2: #152C4E;
  --fondo-3: #0989BB;
  --accento: #7FD4F0;
  --testo: #ffffff;
  --testo-tenue: rgba(255, 255, 255, .78);
  --vetro: rgba(255, 255, 255, .07);
  --bordo: rgba(255, 255, 255, .14);
  --su: #FFAE8F;
  --giu: #7CE7B0;
  --avviso: #8a5a12;
  --larghezza: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Titillium Web', system-ui, -apple-system, sans-serif;
  background: linear-gradient(150deg, var(--fondo-1) 0%, var(--fondo-2) 55%, var(--fondo-3) 160%);
  background-attachment: fixed;
  color: var(--testo);
  line-height: 1.55;
  font-weight: 400;
}

a { color: var(--accento); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: #fff; }

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

.sr, .salta {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.salta:focus {
  position: fixed; top: .6rem; left: .6rem; z-index: 20;
  width: auto; height: auto; clip: auto;
  background: var(--fondo-1); border: 2px solid var(--accento);
  padding: .6rem 1rem; border-radius: .5rem;
}

/* ---------- Barra di navigazione ---------- */
.barra {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 1.5rem;
  max-width: var(--larghezza); margin: 0 auto;
  padding: 1.1rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--bordo);
}
.marchio {
  font-weight: 300; font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: #fff; text-decoration: none; letter-spacing: .01em;
}
.marchio strong { font-weight: 900; }
.marchio span { color: var(--accento); }
.voci { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .98rem; }
.voci a { color: var(--testo-tenue); text-decoration: none; font-weight: 600; }
.voci a:hover { color: var(--accento); }

/* ---------- Impaginazione ---------- */
main {
  max-width: var(--larghezza);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 2rem;
}

.briciole { font-size: .92rem; color: var(--testo-tenue); margin-bottom: 1.2rem; }
.briciole a { text-decoration: none; }

.testata { margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
h1 {
  font-size: clamp(1.9rem, 5.5vw, 3.1rem);
  font-weight: 900; line-height: 1.12; letter-spacing: -.01em;
  margin-bottom: .6rem;
}
h1 .reg { color: var(--accento); display: block; }
h2 {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 700; margin-bottom: .8rem; letter-spacing: .01em;
}

.quando { font-size: 1rem; color: var(--testo-tenue); margin-bottom: .5rem; }
.occhiello { font-size: clamp(1rem, 2.2vw, 1.15rem); font-weight: 300; max-width: 68ch; color: var(--testo-tenue); }
.nota { font-size: .92rem; color: var(--testo-tenue); font-weight: 300; max-width: 72ch; margin-bottom: .8rem; }
.spunti { font-size: 1.05rem; font-weight: 300; max-width: 72ch; margin-top: 1.2rem; }

.blocco { margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.blocco p + p { margin-top: .7rem; }

.avviso {
  display: inline-block; background: var(--avviso); color: #fff;
  padding: .15em .7em; border-radius: .4em; font-weight: 600; font-size: .85em;
  margin-left: .4rem;
}

.bottone {
  display: inline-block; margin-top: .9rem;
  background: var(--vetro); border: 1px solid var(--bordo);
  padding: .65em 1.3em; border-radius: .6em;
  color: #fff; text-decoration: none; font-weight: 600;
}
.bottone:hover { background: rgba(255, 255, 255, .14); border-color: var(--accento); }

/* ---------- Schede prezzo ---------- */
.griglia {
  display: grid; gap: clamp(.9rem, 2vw, 1.4rem);
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 1.2rem;
}
.carta {
  background: var(--vetro); border: 1px solid var(--bordo);
  border-radius: clamp(1rem, 2vw, 1.4rem);
  padding: clamp(1.3rem, 3vw, 1.9rem) clamp(1rem, 2vw, 1.5rem);
  display: flex; flex-direction: column; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  position: relative;
}
.badge-erogazione {
  position: absolute; top: 1rem; right: 1rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255, 255, 255, .12); color: var(--accento);
  padding: .3em .8em; border-radius: .6em;
}
.nome {
  font-size: clamp(.95rem, 1.8vw, 1.1rem); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; opacity: .9;
  margin-bottom: .6rem;
}
.prezzo {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem); font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.unita { font-size: .95rem; font-weight: 300; opacity: .75; margin-top: .35rem; }
.variazione { margin-top: .7rem; font-size: .85rem; font-weight: 600; }
.variazione.su  { color: var(--su); }
.variazione.giu { color: var(--giu); }
.variazione.pari { color: var(--testo-tenue); font-weight: 400; }

/* ---------- Tabelle ---------- */
.strumenti {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.cerca { display: flex; flex-direction: column; gap: .3rem; }
.cerca .etichetta { font-size: .85rem; color: var(--testo-tenue); font-weight: 600; }
.cerca input {
  font: inherit; color: #fff;
  background: var(--vetro); border: 1px solid var(--bordo);
  border-radius: .6em; padding: .55em .9em; min-width: min(260px, 70vw);
}
.cerca input::placeholder { color: rgba(255, 255, 255, .45); }

.tabella-contenitore { overflow-x: auto; border: 1px solid var(--bordo); border-radius: 1rem; background: var(--vetro); }
.tabella { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabella th, .tabella td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.tabella thead th {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accento); font-weight: 700; white-space: nowrap;
  background: rgba(0, 0, 0, .18); cursor: pointer; user-select: none;
}
.tabella thead th small { display: block; font-size: .72em; letter-spacing: .04em; color: var(--testo-tenue); font-weight: 400; }
.tabella thead th[aria-sort="ascending"]::after  { content: ' ▲'; }
.tabella thead th[aria-sort="descending"]::after { content: ' ▼'; }
.tabella tbody th { font-weight: 600; }
.tabella tbody th a { text-decoration: none; }
.tabella tbody th a:hover { text-decoration: underline; }
.tabella tbody tr:last-child th, .tabella tbody tr:last-child td { border-bottom: 0; }
.tabella tbody tr:hover { background: rgba(255, 255, 255, .05); }
.tabella .num { text-align: right; }
.tabella .vuota { color: rgba(255, 255, 255, .35); }
.tabella td.su  { color: var(--su); }
.tabella td.giu { color: var(--giu); }
.tabella td small { opacity: .75; font-weight: 400; }

/* ---------- Riquadri e liste ---------- */
.riquadro {
  background: var(--vetro); border: 1px solid var(--bordo);
  border-radius: 1rem; padding: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: clamp(2rem, 5vw, 3.2rem);
}
.classifica, .passi { margin: .4rem 0 0 1.2rem; }
.classifica li, .passi li { margin-bottom: .4rem; }
.classifica { list-style: none; margin-left: 0; }

.faq {
  border: 1px solid var(--bordo); border-radius: .8rem;
  padding: .9rem 1.1rem; margin-bottom: .7rem; background: var(--vetro);
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin-top: .6rem; color: var(--testo-tenue); font-weight: 300; }

.api dt { margin-top: 1rem; font-weight: 700; }
.api dd { color: var(--testo-tenue); font-weight: 300; }
code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em;
  background: rgba(255, 255, 255, .12); padding: .15em .45em; border-radius: .3em;
}
.codice {
  background: rgba(0, 0, 0, .3); border: 1px solid var(--bordo);
  border-radius: .8rem; padding: 1rem 1.2rem; overflow-x: auto; margin-bottom: .8rem;
}
.codice code { background: none; padding: 0; font-size: .86rem; line-height: 1.6; }

.altre { margin-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--bordo); padding-top: 1.6rem; }
.altre ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem .7rem; }
.altre a {
  display: inline-block; text-decoration: none; font-size: .95rem;
  background: var(--vetro); border: 1px solid var(--bordo);
  padding: .4em .9em; border-radius: .5em; color: var(--testo-tenue);
}
.altre a:hover { color: #fff; border-color: var(--accento); }
.altre a[aria-current="page"] { color: var(--fondo-1); background: var(--accento); border-color: var(--accento); font-weight: 700; }

/* ---------- Piede ---------- */
.pie {
  max-width: var(--larghezza); margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2rem) 3rem;
  border-top: 1px solid var(--bordo);
  font-size: .9rem; font-weight: 300; color: var(--testo-tenue);
}
.pie p { max-width: 80ch; margin-bottom: .6rem; }
.pie .minuto { font-size: .85rem; opacity: .8; }

/* ---------- Adattamento schermi ---------- */
@media (max-width: 900px) {
  .griglia { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .griglia { grid-template-columns: 1fr; }
  .barra { padding-bottom: .8rem; }
  .voci { gap: .9rem; font-size: .9rem; }
  h1 .reg { display: inline; }
  .tabella th, .tabella td { padding: .6rem .7rem; font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- Risposta diretta in cima alla pagina ---------- */
.risposta {
  background: rgba(127, 212, 240, .10);
  border: 1px solid var(--bordo);
  border-left: 4px solid var(--accento);
  border-radius: .25rem 1rem 1rem .25rem;
  padding: clamp(.9rem, 2.4vw, 1.2rem) clamp(1rem, 3vw, 1.5rem);
  margin-bottom: clamp(1.5rem, 4vw, 2.4rem);
  max-width: 82ch;
}
.risposta p {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 400;
  line-height: 1.6;
}

/* ---------- Chiusura del piede: crediti a destra ---------- */
.pie .chiusura {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bordo);
}
.pie .firma { margin: 0; font-size: .85rem; }
.pie .firma strong { color: var(--accento); font-weight: 700; }

@media (max-width: 560px) {
  .pie .chiusura { flex-direction: column; align-items: flex-start; }
}
