/* =========================================================
   STILE DEL SITO NO TRAP VENICE
   I colori principali arrivano da sito.json (li imposta sito.js).
   Qui sotto ci sono solo i valori di riserva.
   ========================================================= */

:root {
  --principale: #0B4F6C;
  --link: #0077A8;
  --oro: #E8C75A;
  --verde: #2E7D32;
  --servizi: #00897B;

  --testo: #1D1D1F;
  --tenue: #6E6E73;
  --tenue-forte: #424245;
  --sfondo: #FFFFFF;
  --grigio: #F5F5F7;
  --bordo: #D2D2D7;

  --carattere: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --larghezza: 1120px;
  --margine: clamp(16px, 5vw, 80px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 56px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--carattere);
  color: var(--testo);
  background: var(--sfondo);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }

.solo-lettori {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.a-capo { white-space: pre-line; }

/* ---------- Barra in alto ---------- */
.barra {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid #E8E8ED;
}
.barra-dentro {
  max-width: var(--larghezza); margin: 0 auto;
  height: 52px; padding: 0 var(--margine);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.marchio { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--testo); text-decoration: none; white-space: nowrap; }
.menu { display: flex; gap: 26px; font-size: 13px; }
.menu a { color: var(--testo); text-decoration: none; opacity: 0.85; }
.menu a:hover { opacity: 1; }
.barra-destra { display: flex; align-items: center; gap: 12px; }
.lingua { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--testo); }
.lingua select {
  font: inherit; color: inherit; background: transparent;
  border: 0; padding: 6px 2px; cursor: pointer; min-height: 32px;
}

/* ---------- Pulsanti a pillola ---------- */
.pillola {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 26px; min-height: 48px;
  border-radius: 999px; border: 1.5px solid transparent;
  background: var(--principale); color: #fff;
  font-weight: 600; font-size: 17px; text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.pillola:hover { transform: translateY(-1px); }
.pillola.piccola { padding: 6px 14px; min-height: 32px; font-size: 13px; }
.pillola.bianca { background: #fff; color: var(--testo); }
.pillola.bordo-bianco { background: transparent; border-color: #fff; color: #fff; }
.pillola[aria-disabled="true"] { cursor: default; }
.pillola[aria-disabled="true"]:hover { transform: none; }
.pillola:not([aria-disabled="true"]) .presto { display: none; }

/* ---------- Apertura ---------- */
.apertura {
  position: relative; overflow: hidden;
  min-height: min(760px, calc(100svh - 52px));
  display: flex; align-items: center; justify-content: center;
  background: #24343B; color: #fff; text-align: center;
  padding: 96px var(--margine);
}
.apertura-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.apertura-velo { position: absolute; inset: 0; background: rgba(8, 20, 26, 0.52); }
.apertura-testo { position: relative; display: flex; flex-direction: column; align-items: center; }
.apertura h1 {
  margin: 0 0 18px;
  font-size: clamp(48px, 8.5vw, 96px); line-height: 1.02;
  font-weight: 700; letter-spacing: -0.035em;
}
.apertura-sotto { margin: 0 0 36px; font-size: clamp(19px, 2.2vw, 26px); line-height: 1.35; color: #E3EAEC; max-width: 720px; }
.store { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.apertura-nota { margin: 22px 0 0; font-size: 14px; color: #D5DEE1; }

/* ---------- Blocchi ---------- */
.blocco { padding: clamp(72px, 10vw, 120px) var(--margine); }
.blocco.grigio { background: var(--grigio); }
.blocco.nero { background: #000; color: #F5F5F7; }
.centrato { text-align: center; display: flex; flex-direction: column; align-items: center; }
.con-telefono { padding-bottom: 0; overflow: hidden; }

.etichetta { margin: 0 0 10px; font-size: clamp(17px, 1.8vw, 21px); font-weight: 600; color: var(--principale); display: flex; align-items: center; gap: 8px; }
.etichetta.verde { color: var(--verde); }
.etichetta.servizi { color: var(--servizi); }
.etichetta.oro { color: var(--oro); }

.titolo-enorme, .titolo-grande, .titolo-medio { margin: 0 0 16px; font-weight: 700; line-height: 1.05; }
.titolo-enorme { font-size: clamp(42px, 6.5vw, 76px); letter-spacing: -0.035em; }
.titolo-grande { font-size: clamp(36px, 5.2vw, 64px); letter-spacing: -0.03em; }
.titolo-medio { font-size: clamp(32px, 3.6vw, 46px); letter-spacing: -0.025em; }

.sotto { margin: 0 0 18px; font-size: clamp(17px, 1.8vw, 21px); line-height: 1.45; color: var(--tenue); max-width: 660px; }
.sotto.piccolo { font-size: 17px; max-width: 420px; }
.nero .sotto { color: #A1A1A6; }
.centrato .sotto:last-of-type { margin-bottom: 48px; }

/* ---------- Telefoni con gli screenshot ---------- */
.telefono {
  width: 280px; flex: none;
  padding: 10px; border-radius: 46px; background: #1C1C1E;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.16);
}
.telefono.grande { width: 320px; padding: 11px; border-radius: 52px; box-shadow: 0 40px 80px rgba(0, 0, 0, 0.18); }
/* ---------- Schermate dell'app (testi tradotti sopra un'immagine senza scritte) ----------
   Le misure tra parentesi sono pixel dello screenshot originale (largo 939, alto 2048):
   --x --y = posizione, --w = larghezza, --f = grandezza testo, --l = interlinea. */
.schermo {
  position: relative; overflow: hidden; container-type: inline-size;
  aspect-ratio: 939 / 2048; border-radius: 36px; background: #F2F2F4;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.telefono.grande .schermo { border-radius: 41px; }
.schermo { text-align: left; }
.schermo > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sopra { position: absolute; inset: 0; }
.schermo .s {
  position: absolute; margin: 0;
  left: calc(var(--x) / 939 * 100%); top: calc(var(--y) / 2048 * 100%);
  width: calc(var(--w) / 939 * 100%);
  font-size: calc(var(--f) / 9.39 * 1cqw); line-height: calc(var(--l) / 9.39 * 1cqw);
  color: var(--c, #1C1C1E); font-weight: var(--p, 400); letter-spacing: 0;
}
.schermo .s-adatta { white-space: nowrap; overflow: hidden; }
.schermo .s-ombra { text-shadow: 0 0.2cqw 1.2cqw rgba(0, 0, 0, 0.28); }
.schermo .s-sfumato .grad {
  background: linear-gradient(90deg, #0077A8, #0096B4, #14A89A);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* barra in basso dell'app */
.s-nav { position: absolute; left: 0; right: 0; top: calc(1912 / 2048 * 100%); }
.s-nav span {
  position: absolute; left: calc((var(--cx) - 100) / 939 * 100%); width: calc(200 / 939 * 100%);
  text-align: center; white-space: nowrap;
  font-size: calc(30 / 9.39 * 1cqw); line-height: calc(50 / 9.39 * 1cqw);
  color: #6E6E73; font-weight: 500;
}
.s-nav span.attiva { color: #1C1C1E; font-weight: 700; }

/* Mappa della folla */
.s-legenda {
  position: absolute; left: calc(467 / 939 * 100%); top: calc(147 / 2048 * 100%); transform: translateX(-50%);
  min-width: calc(706 / 939 * 100%); height: calc(124 / 2048 * 100%); box-sizing: border-box;
  padding: 0 4cqw; border-radius: 99cqw; background: rgba(250, 251, 255, 0.97);
  box-shadow: 0 0.5cqw 2cqw rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6cqw;
  white-space: nowrap;
}
.s-livelli { display: flex; gap: 2.6cqw; font-size: 3.8cqw; line-height: 1.1; color: #1C1C1E; }
.s-livelli span { display: flex; align-items: center; gap: 1cqw; }
.s-livelli i { width: 2.4cqw; height: 2.4cqw; border-radius: 50%; display: inline-block; }
.s-livelli b { font-weight: 600; }
.s-legenda small { font-size: 3.1cqw; line-height: 1.1; color: #5F6E74; }
.s-chip-adesso, .s-btn-adesso {
  position: absolute; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: 1.6cqw;
  background: #005478; color: #fff; font-weight: 700; border-radius: 99cqw; white-space: nowrap; box-sizing: border-box;
}
.s-chip-adesso {
  left: calc(370 / 939 * 100%); top: calc(1081 / 2048 * 100%);
  min-width: calc(208 / 939 * 100%); height: calc(96 / 2048 * 100%); padding: 0 3cqw;
  font-size: calc(40 / 9.39 * 1cqw);
}
.s-btn-adesso {
  left: calc(469 / 939 * 100%); top: calc(1577 / 2048 * 100%);
  min-width: calc(364 / 939 * 100%); height: calc(106 / 2048 * 100%); padding: 0 4cqw;
  font-size: calc(42 / 9.39 * 1cqw); box-shadow: 0 0.8cqw 2cqw rgba(0, 0, 0, 0.18);
}
.s-btn-adesso svg { width: 5cqw; height: 5cqw; flex: none; }

/* Menu Scanner: titolo, testo, pulsanti e nota uno sotto l'altro (come nell'app) */
.s-flusso {
  position: absolute; left: calc(var(--x) / 939 * 100%); top: calc(var(--y) / 2048 * 100%);
  width: calc(var(--w) / 939 * 100%); display: flex; flex-direction: column;
}
.s-flusso p { margin: 0; }
.s-h { font-size: calc(66 / 9.39 * 1cqw); line-height: calc(84 / 9.39 * 1cqw); font-weight: 700; color: #1C1C1E; }
.s-corpo { margin-top: calc(21 / 9.39 * 1cqw) !important; font-size: calc(40 / 9.39 * 1cqw); line-height: calc(59 / 9.39 * 1cqw); color: #3C3C40; }
.s-nota { margin-top: calc(45 / 9.39 * 1cqw) !important; font-size: calc(32 / 9.39 * 1cqw); line-height: calc(48 / 9.39 * 1cqw); color: #8A8A8E; }
.s-btn {
  display: flex; align-items: center; justify-content: center; gap: 2.6cqw;
  border-radius: 99cqw; box-sizing: border-box; font-size: calc(42 / 9.39 * 1cqw); font-weight: 700; white-space: nowrap;
}
.s-btn svg { width: 5cqw; height: 5cqw; flex: none; }
.s-btn-pieno { margin-top: calc(52 / 9.39 * 1cqw); height: calc(127 / 9.39 * 1cqw); background: #005478; color: #fff; }
.s-btn-bordo { margin-top: calc(27 / 9.39 * 1cqw); height: calc(129 / 9.39 * 1cqw); border: 0.53cqw solid #0B78A8; color: #0B78A8; }

/* Servizi utili: schede e filtri */
.s-schede, .s-filtri {
  position: absolute; left: calc(40 / 939 * 100%); right: calc(40 / 939 * 100%);
  display: flex; gap: calc(24 / 939 * 100%); overflow: hidden; white-space: nowrap;
}
.s-schede { top: calc(844 / 2048 * 100%); height: calc(120 / 2048 * 100%); }
.s-filtri { top: calc(1006 / 2048 * 100%); height: calc(112 / 2048 * 100%); }
.s-schede span, .s-filtri span {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 1cqw;
  border-radius: 99cqw; font-size: calc(40 / 9.39 * 1cqw); font-weight: 500; color: #1C1C1E;
}
.s-schede span { padding: 0 5cqw; background: #fff; border: 0.2cqw solid #E2E2E6; }
.s-schede span.on, .s-filtri span.on { background: #008677; border-color: #008677; color: #fff; font-weight: 600; }
.s-filtri span { padding: 0 4cqw; font-size: calc(38 / 9.39 * 1cqw); }
.s-filtri span b { font-weight: 600; }
.s-filtri .acqua { background: #D4E5F9; color: #1073D1; }
.s-filtri .bagni { background: #E6DBEC; color: #702D9E; }
.telefono.scuro { background: #2C2C2E; box-shadow: none; }
.con-telefono .telefono { margin-bottom: -120px; }

/* ---------- Mangiare + Servizi ---------- */
.coppia {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  padding: 24px; max-width: 1400px; margin: 0 auto;
}
.riquadro {
  border-radius: 28px; background: var(--grigio);
  padding: 56px 24px 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-height: 860px;
}
.riquadro .sotto { margin-bottom: 36px; }

/* ---------- Risparmio ---------- */
.risparmio {
  max-width: var(--larghezza); margin: 0 auto;
  display: flex; align-items: center; gap: clamp(40px, 7vw, 80px);
}
.risparmio-testo { flex: 1 1 0; min-width: 0; }

/* ---------- PRO ---------- */
.prezzo { margin: 0 0 4px; font-size: 40px; font-weight: 700; }
.prezzo-giorni { font-size: 19px; font-weight: 500; color: #A1A1A6; }
.nota { margin: 0 0 52px; font-size: 14px; color: #86868B; }
.due-telefoni { display: flex; gap: 40px; align-items: flex-start; }
.sfalsato { margin-top: 60px; }

/* ---------- Punti in riga ---------- */
.punti { display: grid; gap: 32px; width: 100%; max-width: var(--larghezza); text-align: left; }
.punti.quattro { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.punti.tre { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 40px 0; }
.punti p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--tenue-forte); }
.punti strong { display: block; color: var(--testo); margin-bottom: 4px; }
.link-testo { margin-top: 40px; font-size: 17px; text-decoration: none; }
.link-testo:hover { text-decoration: underline; }

/* ---------- Mappa di calore ---------- */
.calore { width: 100%; max-width: var(--larghezza); border-radius: 28px; background: var(--grigio); padding: 24px; text-align: left; }
.calore-testa { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 17px; }
.interruttore { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: #E8E8ED; }
.interruttore button {
  border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 18px; min-height: 40px; border-radius: 999px;
  background: transparent; color: var(--tenue);
  transition: background 0.25s ease, color 0.25s ease;
}
.interruttore button[aria-pressed="true"] { background: #fff; color: var(--testo); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.calore-mappa { position: relative; border-radius: 16px; overflow: hidden; }
#griglia-calore { display: grid; grid-template-columns: repeat(36, minmax(0, 1fr)); gap: 2px; }
#griglia-calore i { display: block; aspect-ratio: 1; border-radius: 3px; transition: background-color 0.45s ease; }
.luogo { position: absolute; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #fff; color: var(--testo); white-space: nowrap; }
.calore-piede { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--tenue); }
.legenda { display: flex; align-items: center; gap: 8px; }
.legenda i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Contatti ---------- */
.contatti { border-top: 1px solid #E8E8ED; }
.contatti .sotto:last-of-type { margin-bottom: 22px; }
.email-grande { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; text-decoration: none; color: var(--principale); word-break: break-all; }
.email-grande:hover { text-decoration: underline; }

/* ---------- Piè di pagina ---------- */
.piede { background: var(--grigio); color: var(--tenue); font-size: 12px; line-height: 1.6; padding: 22px var(--margine) 30px; }
.piede > p, .piede-riga { max-width: var(--larghezza); margin: 0 auto; }
.piede > p { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--bordo); }
.piede-riga { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; }
.piede-riga nav { display: flex; gap: 18px; }
.piede a { color: var(--tenue-forte); text-decoration: none; }
.piede a:hover { text-decoration: underline; }

/* ---------- Comparsa morbida mentre si scorre ---------- */
.compare { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.compare.visto { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .compare { opacity: 1; transform: none; transition: none; } }

/* ---------- Tablet ---------- */
@media (max-width: 980px) {
  .menu { display: none; }
  .punti.quattro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risparmio { flex-direction: column; text-align: center; }
  .risparmio .sotto { margin-left: auto; margin-right: auto; }
  .risparmio .etichetta { justify-content: center; }
}

/* ---------- Telefono ---------- */
@media (max-width: 720px) {
  .coppia { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .riquadro { padding: 44px 16px 0; max-height: 720px; }
  .telefono { width: 240px; border-radius: 40px; padding: 9px; }
  .telefono .schermo { border-radius: 31px; }
  .telefono.grande { width: 260px; border-radius: 44px; padding: 9px; }
  .telefono.grande .schermo { border-radius: 35px; }
  .due-telefoni { gap: 14px; }
  .due-telefoni .telefono { width: 44vw; max-width: 220px; border-radius: 30px; padding: 6px; }
  .due-telefoni .telefono .schermo { border-radius: 24px; }
  .sfalsato { margin-top: 36px; }
  .con-telefono .telefono { margin-bottom: -90px; }
  .punti.quattro, .punti.tre { grid-template-columns: 1fr; gap: 20px; }
  .calore { padding: 14px; border-radius: 20px; }
  #griglia-calore { gap: 1px; }
  #griglia-calore i { border-radius: 2px; }
  .luogo { font-size: 10px; padding: 2px 6px; }
  .marchio { font-size: 16px; }
  .titolo-grande { font-size: 32px; }
  .titolo-enorme { font-size: 38px; }
  .barra-destra .pillola { display: none; }
}

/* =========================================================
   ANIMAZIONI (morbide, stile Apple). Attive solo se il visitatore
   non ha chiesto "riduci movimento" e se JavaScript funziona.
   ========================================================= */
@keyframes sali { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes avvicina { from { transform: scale(1.1); } to { transform: scale(1); } }
@keyframes galleggia { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.anim .apertura-foto { animation: avvicina 3.2s cubic-bezier(.2,.7,.2,1) both; }
.anim .apertura h1 { animation: sali 1s .15s cubic-bezier(.2,.7,.2,1) both; }
.anim .apertura-sotto { animation: sali 1s .35s cubic-bezier(.2,.7,.2,1) both; }
.anim .apertura .store { animation: sali 1s .55s cubic-bezier(.2,.7,.2,1) both; }
.anim .apertura-nota { animation: sali 1s .7s cubic-bezier(.2,.7,.2,1) both; }

/* i telefoni entrano salendo e si raddrizzano */
.anim .telefono {
  opacity: 0;
  transform: perspective(1600px) translateY(110px) rotateX(18deg) scale(.95);
  transition: opacity 1s ease, transform 1.3s cubic-bezier(.16,.84,.24,1);
  translate: 0 var(--spost, 0px);
  will-change: transform;
}
.anim .risparmio .telefono { transform: perspective(1600px) translateX(90px) rotateY(-24deg) scale(.95); }
.anim .coppia .riquadro:nth-child(2) .telefono { transition-delay: .15s; }
.anim .due-telefoni .telefono:first-child { transform: perspective(1600px) translateY(140px) rotate(-7deg); }
.anim .due-telefoni .telefono:last-child { transform: perspective(1600px) translateY(190px) rotate(7deg); transition-delay: .18s; }
.anim .telefono.visto { opacity: 1 !important; transform: none !important; }

/* cambio lingua: i testi sfumano */
.sopra, [data-t] { transition: opacity .28s ease; }
.cambio-lingua .sopra, .cambio-lingua main [data-t] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .anim .apertura-foto, .anim .apertura h1, .anim .apertura-sotto, .anim .apertura .store, .anim .apertura-nota { animation: none; }
  .anim .telefono { opacity: 1; transform: none; transition: none; translate: none; }
  .sopra, [data-t] { transition: none; }
}
