/* ═══════════════════════════════════════════════════════
   CARROZZERIA RALLY — Cookie Consent Styles
   File: cookies.css
   Usa le CSS variables già definite in style.css
   Tutto prefissato .cr- per zero conflitti
   ═══════════════════════════════════════════════════════ */

/* ── COOKIE BANNER ────────────────────────────────────── */
#cr-cookie-banner {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: min(420px, calc(100vw - 48px));
  background: var(--dark);
  border: 1px solid rgba(201,169,110,.22);
  z-index: 9900;
  padding: 32px;
  box-shadow: 0 16px 48px rgba(0,0,0,.55);

  /* Nascosto di default */
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .4s cubic-bezier(.25,.46,.45,.94),
			  transform .4s cubic-bezier(.25,.46,.45,.94);
}

#cr-cookie-banner.cr-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Header banner */
.cr-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.cr-banner-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  line-height: 1;
}

.cr-banner-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--white);
}

/* Testo */
.cr-banner-text {
  font-size: 13px;
  font-weight: 300;
  color: rgba(255,255,255,.52);
  line-height: 1.7;
  margin-bottom: 20px;
}

.cr-banner-text a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .3s;
}
.cr-banner-text a:hover { color: #debb82; }

/* ── PANNELLO PREFERENZE (collassabile) ───────────────── */
#cr-prefs-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s cubic-bezier(.25,.46,.45,.94);
  border-top: 0 solid rgba(255,255,255,.08);
}

#cr-prefs-panel.cr-open {
  max-height: 200px;
  border-top-width: 1px;
  margin-bottom: 16px;
  padding-top: 16px;
}

.cr-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.cr-pref-item:last-child { border-bottom: none; }

.cr-pref-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}

.cr-pref-label small {
  display: block;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255,255,255,.32);
  margin-top: 2px;
}

/* Toggle switch */
.cr-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.cr-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cr-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background .3s;
}

.cr-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform .3s;
}

.cr-toggle input:checked + .cr-toggle-slider {
  background: var(--gold);
}

.cr-toggle input:checked + .cr-toggle-slider::before {
  transform: translateX(18px);
}

/* Toggle fisso (essential — sempre attivo) */
.cr-toggle.cr-fixed .cr-toggle-slider {
  background: rgba(201,169,110,.3);
  cursor: not-allowed;
}
.cr-toggle.cr-fixed .cr-toggle-slider::before {
  transform: translateX(18px);
  background: var(--gold);
  opacity: .5;
}

/* ── PULSANTI BANNER ──────────────────────────────────── */
.cr-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-btn {
  width: 100%;
  padding: 13px 20px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: background .3s, color .3s, transform .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cr-btn:hover { transform: translateY(-1px); }

/* Primario — accetta tutto */
.cr-btn-primary {
  background: var(--gold);
  color: var(--black);
}
.cr-btn-primary:hover { background: #debb82; }

/* Secondario — solo essenziali */
.cr-btn-secondary {
  background: transparent;
  color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.12);
}
.cr-btn-secondary:hover {
  border-color: rgba(201,169,110,.4);
  color: var(--white);
}

/* Terziario — preferenze */
.cr-btn-tertiary {
  background: transparent;
  color: rgba(255,255,255,.35);
  font-size: 10px;
  padding: 8px 20px;
}
.cr-btn-tertiary:hover { color: var(--gold); }

/* ── RIBBON (richiama il banner dopo accettazione) ────── */
#cr-cookie-ribbon {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9800;

  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .4s cubic-bezier(.25,.46,.45,.94),
			  transform .4s cubic-bezier(.25,.46,.45,.94);
}

#cr-cookie-ribbon.cr-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#cr-ribbon-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  border: 1px solid rgba(201,169,110,.28);
  padding: 10px 16px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  transition: border-color .3s, color .3s, background .3s;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

#cr-ribbon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(13,13,13,.98);
}

#cr-ribbon-btn svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  flex-shrink: 0;
}

/* ── TOGGLE PULSANTE SALVA PREFERENZE ────────────────── */
/* Appare solo quando il pannello preferenze è aperto */
#cr-prefs-panel.cr-open ~ .cr-btn-group #cr-save-prefs {
  display: inline-flex !important;
}
#cr-prefs-panel.cr-open ~ .cr-btn-group #cr-open-prefs {
  display: none;
}

/* ── CHECKBOX PRIVACY NEL FORM PREVENTIVO ─────────────── */
.form-privacy-check { margin-top: 4px; margin-bottom: 20px; }

.cr-privacy-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.cr-privacy-input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--gold-dark);
  margin-top: 3px;
  cursor: pointer;
}

.cr-privacy-label span {
  font-size: 13px;
  font-weight: 300;
  color: var(--grey-text);
  line-height: 1.6;
}

.cr-privacy-label a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cr-privacy-label a:hover { color: var(--black); }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 480px) {
  #cr-cookie-banner {
	bottom: 0;
	left: 0;
	width: 100%;
	border-left: none;
	border-right: none;
	border-bottom: none;
	border-radius: 0;
	box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  }

  #cr-cookie-ribbon {
	bottom: 12px;
	left: 12px;
  }
}


.form-privacy-check { margin-top: 4px; margin-bottom: 20px; }
 
.cr-privacy-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
 
.cr-privacy-input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--gold-dark);
  margin-top: 3px;
  cursor: pointer;
}
 
.cr-privacy-label span {
  font-size: 13px;
  font-weight: 300;
  color: var(--grey-text);
  line-height: 1.6;
}
 
.cr-privacy-label a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cr-privacy-label a:hover { color: var(--black); }

#cr-prefs-panel.cr-open ~ .cr-btn-group #cr-save-prefs { display: flex !important; }
#cr-prefs-panel.cr-open ~ .cr-btn-group #cr-open-prefs { display: none; }
-->