/* ========== Cookie Consent (GDPR) – Stili base ==========
   Compatibile con Bootstrap 5.x
   - Banner compatto e responsivo
   - Modale preferenze semplice e accessibile
   - Nessun colore hardcoded di Bootstrap: puoi sovrascrivere con utility classes
   ======================================================== */

/* Variabili (facili da personalizzare) */
:root {
  --cc-bg: #ffffff;
  --cc-text: #212529;
  --cc-border: #dee2e6;
  --cc-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  --cc-overlay: rgba(0, 0, 0, 0.6);
}

/* Banner */
.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0; /* default, può diventare top via data-config */
  background: var(--cc-bg);
  color: var(--cc-text);
  border-top: 1px solid var(--cc-border);
  box-shadow: var(--cc-shadow);
  padding: 0.875rem 1rem;
  z-index: 1080;
  display: none; /* mostrato via JS */
}

.cc-banner.cc-top {
  top: 0;
  bottom: auto;
  border-top: 0;
  border-bottom: 1px solid var(--cc-border);
}

.cc-banner .cc-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: 1140px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .cc-banner .cc-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.cc-banner p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.95rem;
}

.cc-banner a {
  color: inherit;
  text-decoration: underline;
}

.cc-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .cc-actions {
    justify-content: flex-end;
  }
}

/* Bottoni (usano classi Bootstrap se presenti; qui fallback minimi) */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  border: 1px solid var(--cc-border);
  background: #f8f9fa;
  color: #212529;
  cursor: pointer;
  text-decoration: none;
}

.cc-btn-primary {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

.cc-btn-outline {
  background: transparent;
}

/* Modale preferenze */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--cc-overlay);
}

.cc-modal[aria-hidden="false"] {
  display: flex;
}

.cc-modal .cc-dialog {
  width: min(520px, 92vw);
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 0.5rem;
  box-shadow: var(--cc-shadow);
  padding: 1rem 1rem;
}

@media (min-width: 576px) {
  .cc-modal .cc-dialog {
    padding: 1.25rem 1.25rem;
  }
}

.cc-dialog h5 {
  margin: 0 0 0.5rem 0;
}

.cc-list {
  margin: 0.5rem 0 1rem 0;
  padding: 0;
  list-style: none;
}

.cc-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--cc-border);
}

.cc-list li:last-child {
  border-bottom: 0;
}

.cc-switch {
  margin-top: 0.15rem;
}

.cc-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.cc-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}
