/* ===== COOKIE CONSENT — usa i token del design v7 (design.css) ===== */

.pb-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.pb-consent[hidden] { display: none; }

/* .btn imposta display:inline-flex e vincerebbe sull'attributo hidden:
   senza questa regola "Salva preferenze" resterebbe sempre visibile. */
.pb-consent [hidden] { display: none !important; }

.pb-consent-card {
  pointer-events: auto;
  width: 100%;
  max-width: var(--maxw);
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  transform: translateY(14px);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
}

.pb-consent.in .pb-consent-card { transform: none; opacity: 1; }

.pb-consent-main { flex: 1 1 auto; min-width: 0; }

.pb-consent-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.pb-consent-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.pb-consent-text a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pb-consent-text a:hover { color: var(--blue-hover); }

.pb-consent-prefs {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.pb-consent-prefs[hidden] { display: none; }

.pb-consent-opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}

.pb-consent-opt input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: var(--blue);
  cursor: pointer;
}

.pb-consent-opt input:disabled { cursor: default; opacity: .65; }

.pb-consent-opt strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
}

.pb-consent-opt em {
  display: block;
  font-style: normal;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-soft);
}

.pb-consent-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  min-width: 190px;
}

.pb-consent-actions .btn { width: 100%; }

.pb-consent-link {
  background: none;
  border: none;
  padding: 4px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}

.pb-consent-link:hover { color: var(--blue); }

/* Link "Preferenze cookie" nel footer */
.pb-consent-reopen {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pb-consent-reopen:hover { color: var(--blue); }

@media (max-width: 860px) {
  .pb-consent { padding: 12px; }

  .pb-consent-card {
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border-radius: var(--r-md);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  .pb-consent-actions {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .pb-consent-actions .btn {
    flex: 1 1 140px;
    width: auto;
    min-height: 44px;
  }

  .pb-consent-link {
    flex: 1 1 100%;
    text-align: center;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .pb-consent-card { padding: 18px 16px; }
  .pb-consent-title { font-size: 16px; }
  .pb-consent-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pb-consent-card { transition: none; transform: none; opacity: 1; }
}
