/* ============================================================
   COOKIE CONSENT — vztech.de
   Eredita le variabili colore/font definite in styles.css
   (--black, --gold, --gold-dim, --gold-pale, --cream, --muted, --border)
   Ogni var() ha un fallback nel caso questo file venga caricato
   prima di styles.css.
   ============================================================ */

.cc-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ── BANNER ─────────────────────────────────────────────── */
.cc-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  max-width: 1140px;
  margin: 0 auto;
  z-index: 9999;

  background: #fff;
  border: 1px solid rgba(10,10,15,0.06);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(10,10,15,0.18), 0 4px 16px rgba(10,10,15,0.08);

  padding: 26px 36px;
  display: flex;
  align-items: center;
  gap: 28px;

  font-family: var(--font-body, 'Inter', sans-serif);

  transform: translateY(calc(100% + 40px));
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}
.cc-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.cc-banner[hidden] { display: none; }

.cc-banner-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc-banner-icon svg { width: 30px; height: 30px; }

.cc-banner-text {
  flex: 1 1 auto;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--black, #0A0A0F);
  min-width: 220px;
}
.cc-banner-text a {
  color: var(--gold-dim, #9E7E33);
  text-decoration: underline;
  font-weight: 500;
}
.cc-banner-text a:hover { color: var(--gold, #C9A84C); }

.cc-banner-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.cc-link-settings {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--black, #0A0A0F);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
  transition: color 0.2s;
}
.cc-link-settings:hover,
.cc-link-settings:focus-visible { color: var(--gold-dim, #9E7E33); }

.cc-btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.cc-btn:active { transform: translateY(0); }

.cc-btn-reject {
  background: rgba(10,10,15,0.05);
  color: var(--black, #0A0A0F);
  border: 1px solid rgba(10,10,15,0.1);
}
.cc-btn-reject:hover { border-color: rgba(10,10,15,0.2); background: rgba(10,10,15,0.08); }

.cc-btn-accept {
  background: var(--black, #0A0A0F);
  color: #fff;
  box-shadow: 0 4px 14px rgba(10,10,15,0.25);
}
.cc-btn-accept:hover { background: #222234; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(10,10,15,0.3); }

.cc-btn:focus-visible,
.cc-link-settings:focus-visible,
.cc-toggle input:focus-visible + .cc-toggle-track {
  outline: 2px solid var(--gold, #C9A84C);
  outline-offset: 2px;
}

/* ── REOPEN TAB (icona fissa per riaprire le preferenze) ──── */
.cc-reopen-tab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--black, #0A0A0F);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 10px 28px rgba(10,10,15,0.28);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s;
}
.cc-reopen-tab.is-visible { opacity: 1; transform: scale(1); pointer-events: auto; }
.cc-reopen-tab:hover { background: #222234; }
.cc-reopen-tab svg { width: 24px; height: 24px; }

/* ── MODALE IMPOSTAZIONI ────────────────────────────────── */
.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10,10,15,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cc-overlay.is-open { opacity: 1; pointer-events: auto; }
.cc-overlay[hidden] { display: flex; } /* hidden gestito via classe, non via attributo, per poter animare */

.cc-modal {
  background: var(--cream, #F5F4F0);
  border-radius: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 40px;
  font-family: var(--font-body, 'Inter', sans-serif);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc-overlay.is-open .cc-modal { transform: translateY(0) scale(1); }

.cc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.cc-modal-title {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--black, #0A0A0F);
}
.cc-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted, #6B7280);
  padding: 4px;
  line-height: 0;
  transition: color 0.2s;
}
.cc-modal-close:hover { color: var(--black, #0A0A0F); }
.cc-modal-close svg { width: 20px; height: 20px; }

.cc-modal-intro {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted, #6B7280);
  margin-bottom: 28px;
}
.cc-modal-intro a { color: var(--gold-dim, #9E7E33); text-decoration: underline; }

.cc-category {
  border-top: 1px solid var(--border, rgba(201,168,76,0.18));
  padding: 18px 0;
}
.cc-category:first-of-type { border-top: 1px solid var(--border, rgba(201,168,76,0.18)); }

.cc-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cc-category-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--black, #0A0A0F);
}
.cc-category-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim, #9E7E33);
  margin-left: 8px;
}
.cc-category-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted, #6B7280);
  margin-top: 6px;
  padding-right: 56px;
}

/* Toggle switch */
.cc-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
}
.cc-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.cc-toggle input:disabled { cursor: not-allowed; }
.cc-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(10,10,15,0.15);
  border-radius: 999px;
  transition: background 0.2s;
}
.cc-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(10,10,15,0.3);
  transition: transform 0.2s;
}
.cc-toggle input:checked + .cc-toggle-track { background: var(--gold, #C9A84C); }
.cc-toggle input:checked + .cc-toggle-track::after { transform: translateX(18px); }
.cc-toggle input:disabled + .cc-toggle-track { background: var(--gold-dim, #9E7E33); opacity: 0.55; }

.cc-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.cc-modal-footer .cc-btn { flex: 1 1 auto; }
.cc-btn-save {
  background: transparent;
  color: var(--black, #0A0A0F);
  border: 1.5px solid rgba(10,10,15,0.18);
}
.cc-btn-save:hover { border-color: var(--gold, #C9A84C); color: var(--gold-dim, #9E7E33); background: var(--gold-pale, rgba(201,168,76,0.12)); }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .cc-banner {
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 22px;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    border-radius: 22px;
  }
  .cc-banner-icon { display: none; }
  .cc-banner-actions {
    justify-content: space-between;
    width: 100%;
  }
  .cc-btn-reject, .cc-btn-accept { flex: 1 1 auto; text-align: center; }
  .cc-link-settings { flex: 1 1 100%; text-align: center; order: 3; }
  .cc-modal { padding: 28px; }
  .cc-category-desc { padding-right: 0; }
  .cc-reopen-tab { left: 14px; bottom: 14px; }
}

/* Rispetta utenti che preferiscono meno animazioni */
@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-overlay, .cc-modal, .cc-reopen-tab, .cc-toggle-track, .cc-toggle-track::after {
    transition: none !important;
  }
}
