/* ==========================================================================
   Cookie banner Sensitivi.com – sfondo nero, testo bianco, pulsanti blu
   ========================================================================== */
:root {
  --cb-bg: #000000;
  --cb-text: #ffffff;
  --cb-muted: #d6d6d6;
  --cb-blue: #1a6ee8;
  --cb-blue-hover: #0f57c2;
  --cb-border: #333333;
  --cb-radius: 14px;
  --cb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cb-hidden { display: none !important; }

/* Velo scuro dietro al banner: richiama l'attenzione ma non blocca la pagina */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 99998;
  pointer-events: none;
}

.cb-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: var(--cb-bg);
  color: var(--cb-text);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  padding: 22px 24px 20px;
  font-family: var(--cb-font);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  z-index: 99999;
  box-sizing: border-box;
}

.cb-banner:focus { outline: none; }
.cb-banner *, .cb-float * { box-sizing: border-box; }

.cb-banner .cb-title {
  margin: 0 36px 10px 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cb-text);
}

.cb-banner p {
  margin: 0 0 12px;
  padding: 0;
  color: var(--cb-muted);
}

.cb-banner a {
  color: var(--cb-text);
  text-decoration: underline;
}
.cb-banner a:hover { color: #9ec3ff; }

/* X di chiusura */
.cb-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--cb-text);
  font: 400 28px/1 var(--cb-font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
}
.cb-close:hover, .cb-close:focus-visible { background: #222; outline: none; }
.cb-close:focus-visible { box-shadow: 0 0 0 2px var(--cb-blue); }

/* Pulsanti */
.cb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cb-btn {
  flex: 1 1 140px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--cb-blue);
  background: var(--cb-blue);
  color: #fff;
  font: 700 15px/1.2 var(--cb-font);
  padding: 11px 16px;
  margin: 0;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: background-color .15s, border-color .15s;
}
.cb-btn:hover, .cb-btn:focus-visible {
  background: var(--cb-blue-hover);
  border-color: var(--cb-blue-hover);
  outline: none;
}
.cb-btn:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }

/* Con le preferenze aperte i 4 pulsanti si dispongono su due righe */
.cb-actions--prefs .cb-btn { flex: 1 1 calc(50% - 5px); }

.cb-btn--outline { background: transparent; }
.cb-btn--outline:hover, .cb-btn--outline:focus-visible { background: var(--cb-blue); border-color: var(--cb-blue); }

/* Preferenze per categoria */
.cb-prefs {
  margin-top: 6px;
  border-top: 1px solid var(--cb-border);
  padding-top: 4px;
}

.cb-cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cb-border);
}
.cb-cat:last-child { border-bottom: none; }

.cb-cat-text strong {
  display: block;
  color: var(--cb-text);
  margin-bottom: 2px;
}
.cb-cat-text small { font-weight: 400; color: var(--cb-muted); }
.cb-cat-text span {
  color: var(--cb-muted);
  font-size: 13.5px;
}

/* Interruttori */
.cb-switch {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 26px;
  margin-top: 2px;
}
.cb-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.cb-switch input:disabled { cursor: not-allowed; }
.cb-switch .cb-slider {
  position: absolute;
  inset: 0;
  background: #555;
  border-radius: 26px;
  transition: background-color .2s;
}
.cb-switch .cb-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.cb-switch input:checked + .cb-slider { background: var(--cb-blue); }
.cb-switch input:checked + .cb-slider::before { transform: translateX(22px); }
.cb-switch input:disabled + .cb-slider { opacity: .6; }
.cb-switch input:focus-visible + .cb-slider { box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }

/* Pulsante di richiamo (biscotto) in basso a destra */
.cb-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--cb-blue);
  background: var(--cb-bg);
  cursor: pointer;
  z-index: 99997;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  padding: 0;
  margin: 0;
  transition: transform .15s, background-color .15s;
}
.cb-float:hover, .cb-float:focus-visible { background: var(--cb-blue); transform: scale(1.06); outline: none; }
.cb-float:focus-visible { box-shadow: 0 0 0 3px #fff; }
.cb-float svg { width: 30px; height: 30px; display: block; }
.cb-float:hover svg g, .cb-float:focus-visible svg g { fill: var(--cb-blue); }

@media (max-width: 480px) {
  .cb-banner { bottom: 12px; padding: 18px 16px 16px; font-size: 14px; width: calc(100% - 24px); }
  .cb-banner .cb-title { font-size: 1.1rem; }
  .cb-btn { flex: 1 1 40%; padding: 11px 10px; font-size: 14.5px; }
  .cb-float { width: 46px; height: 46px; right: 12px; bottom: 12px; }
  .cb-float svg { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-btn, .cb-float, .cb-switch .cb-slider, .cb-switch .cb-slider::before { transition: none; }
}

@media print {
  .cb-banner, .cb-overlay, .cb-float { display: none !important; }
}
