/* ==========================================================================
   Pubblipro - banner dei cookie e link legali nel piede
   Si aggiunge a base.css. Usa gli stessi colori, font e pulsanti del resto del sito.
   ========================================================================== */

/* ---------- Link legali nel piede ---------- */
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  transition: color 160ms var(--ease);
}
.linkbtn:focus-visible { outline: 2px solid var(--paper-text); outline-offset: 4px; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) {
  .linkbtn:hover { color: #E8777C; }
}

/* ---------- Banner ---------- */
.consent {
  position: fixed;
  left: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 90;
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 30px 26px 24px;
  border-radius: var(--radius);
  background: var(--ink-2);
  color: var(--paper-text);
  border: 1px solid rgba(242, 237, 227, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overscroll-behavior: contain;
}
.consent[hidden], .consent [hidden] { display: none; }
.consent:not([hidden]) { animation: consent-in 320ms var(--ease) both; }
@keyframes consent-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
.consent::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 0;
  width: 48px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--red);
}

.consent__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.consent__title:focus { outline: none; }
.consent p { margin: 0; color: var(--muted-on-ink); }
.consent a { color: var(--paper-text); text-decoration: underline; }
.consent a:focus-visible, .consent button:focus-visible, .consent input:focus-visible + span {
  outline: 2px solid var(--paper-text);
  outline-offset: 3px;
}

.consent__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.consent .btn { min-height: 48px; padding: 0 20px; font-size: 16px; flex: 1 1 140px; }
.consent .btn-line { flex-basis: 100%; }

/* ---------- Scelte per categoria ---------- */
.consent__opt {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid rgba(242, 237, 227, 0.14);
}
.consent__opt:first-of-type { margin-top: 18px; }
.consent__optText { flex: 1 1 auto; min-width: 0; }
.consent__optText label { display: block; margin-bottom: 2px; font-weight: 600; font-size: 17px; color: var(--paper-text); }
.consent__optText p { font-size: 15px; line-height: 1.5; }

.consent__switch { position: relative; flex: none; width: 52px; height: 30px; margin-top: 2px; }
.consent__switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.consent__switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #3E3E4A;
  transition: background-color 160ms var(--ease);
}
.consent__switch span::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper-text);
  transition: transform 200ms var(--ease);
}
.consent__switch input:checked + span { background: var(--red); }
.consent__switch input:checked + span::after { transform: translateX(22px); }
.consent__switch input:disabled { cursor: not-allowed; }
.consent__switch input:disabled + span { opacity: 0.55; }

/* ---------- Telefono ---------- */
@media (max-width: 600px) {
  .consent {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 0;
  }
  .consent::before { left: 20px; }
  .consent .btn { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .consent:not([hidden]) { animation: none; }
  .consent__switch span, .consent__switch span::after, .linkbtn { transition: none; }
}

