/* ════════════════════════════════════════════════════════════════
   COOKIE CONSENT — banner + modale preferenze (Lingotto District)
   Stile coerente col sito: palette scura, Montserrat, accento bronzo.
   Logica in cookie-consent.js. Carica i tracker SOLO dopo il consenso.
   ════════════════════════════════════════════════════════════════ */

:root {
  --cc-bg:     #14110c;
  --cc-bg2:    #0e0c0a;
  --cc-cream:  #f0ead8;
  --cc-bronze: #c9a96e;
  --cc-muted:  rgba(240, 234, 216, 0.55);
  --cc-line:   rgba(240, 234, 216, 0.14);
}

/* Nasconde tutto finché JS non decide se mostrare il banner */
.cc-root { font-family: 'Montserrat', system-ui, sans-serif; }
.cc-root[hidden] { display: none !important; }

/* ── Overlay (solo per il modale preferenze) ── */
.cc-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.cc-overlay.cc-open { opacity: 1; pointer-events: auto; }

/* ── Banner (prima scelta) ── */
.cc-banner {
  position: fixed; z-index: 2147483000;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 32px); overflow-y: auto;
  background: linear-gradient(180deg, var(--cc-bg) 0%, var(--cc-bg2) 100%);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 24px 26px 22px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.cc-banner.cc-open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }

.cc-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  color: var(--cc-cream);
  font-size: 1.5rem;
  letter-spacing: .01em;
  margin: 0 0 8px;
}
.cc-text {
  color: var(--cc-muted);
  font-size: .82rem;
  line-height: 1.6;
  font-weight: 300;
  margin: 0 0 18px;
}
.cc-text a { color: var(--cc-bronze); text-decoration: none; border-bottom: 1px solid rgba(201,169,110,.4); }
.cc-text a:hover { border-bottom-color: var(--cc-bronze); }

/* ── Bottoni ── */
.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: .72rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 12px 20px; border-radius: 999px;
  cursor: pointer; border: 1px solid transparent;
  transition: background .25s ease, color .25s ease, border-color .25s ease, opacity .25s ease;
}
.cc-btn-accept { background: var(--cc-bronze); color: #1a1408; border-color: var(--cc-bronze); flex: 1 1 auto; }
.cc-btn-accept:hover { background: #d8bd8a; }
.cc-btn-reject { background: transparent; color: var(--cc-cream); border-color: var(--cc-line); flex: 1 1 auto; }
.cc-btn-reject:hover { border-color: var(--cc-cream); }
.cc-btn-prefs  { background: transparent; color: var(--cc-muted); border-color: transparent; flex: 0 0 auto; }
.cc-btn-prefs:hover { color: var(--cc-cream); }

/* ── Modale preferenze ── */
.cc-modal {
  position: fixed; z-index: 99999;
  left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98);
  width: min(620px, calc(100% - 32px));
  max-height: min(86vh, 720px); overflow-y: auto;
  background: linear-gradient(180deg, var(--cc-bg) 0%, var(--cc-bg2) 100%);
  border: 1px solid var(--cc-line);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  padding: 30px 30px 26px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.cc-modal.cc-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.cc-modal .cc-text { margin-bottom: 22px; }

.cc-group {
  border-top: 1px solid var(--cc-line);
  padding: 18px 0;
}
.cc-group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-group-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.18rem; color: var(--cc-cream); margin: 0;
}
.cc-group-desc { color: var(--cc-muted); font-size: .78rem; line-height: 1.55; font-weight: 300; margin: 8px 0 0; }
.cc-group-desc a { color: var(--cc-bronze); text-decoration: none; }

/* Switch */
.cc-switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-switch .cc-slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(240,234,216,.16); transition: background .25s ease;
}
.cc-switch .cc-slider::before {
  content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  border-radius: 50%; background: var(--cc-cream); transition: transform .25s ease;
}
.cc-switch input:checked + .cc-slider { background: var(--cc-bronze); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:disabled + .cc-slider { background: rgba(201,169,110,.45); cursor: not-allowed; }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--cc-bronze); outline-offset: 2px; }

.cc-locked { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cc-bronze); }

.cc-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cc-modal-actions .cc-btn-accept { flex: 1 1 200px; }
.cc-modal-actions .cc-btn-save   { background: transparent; color: var(--cc-cream); border-color: var(--cc-line); flex: 1 1 160px; }
.cc-modal-actions .cc-btn-save:hover { border-color: var(--cc-cream); }

/* ── Bottone fluttuante per riaprire le preferenze ──
   DISATTIVATO su richiesta: si sovrapponeva alla barra CTA WhatsApp su mobile.
   La revoca/modifica del consenso resta sempre disponibile dal link
   "Preferenze cookie" nel footer (window.LDConsent.open()) e dalla pagina
   Privacy → conforme GDPR. !important per vincere sullo stile inline che il JS
   imposta quando mostrerebbe il bottone. */
.cc-fab {
  display: none !important;
  position: fixed; z-index: 99990; left: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(20,17,12,.82); border: 1px solid var(--cc-line);
  color: var(--cc-bronze); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  transition: transform .2s ease, border-color .2s ease;
}
.cc-fab:hover { transform: scale(1.06); border-color: var(--cc-bronze); }
.cc-fab svg { width: 20px; height: 20px; }

@media (max-width: 520px) {
  .cc-banner {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 20px 18px 18px;
  }
  .cc-title { font-size: 1.3rem; }
  .cc-actions .cc-btn-accept, .cc-actions .cc-btn-reject { flex: 1 1 100%; }
  .cc-btn-prefs { flex: 1 1 100%; }
  .cc-fab { width: 38px; height: 38px; }
}
