/*!
 * ea-consent.css — stile del banner cookie
 *
 * Regola non negoziabile: "Rifiuta tutti" e "Accetta tutti" condividono la
 * stessa classe .ea-cc-btn--primary. Stesse dimensioni, stesso colore, stesso
 * peso visivo. Non differenziarli: e proprio la disparita grafica il dark
 * pattern piu sanzionato dal Garante.
 */

:root {
  --ea-cc-bg: #ffffff;
  --ea-cc-fg: #1c1c1c;
  --ea-cc-muted: #5a5a5a;
  --ea-cc-accent: #a81e2e;      /* rosso Emporio Amato */
  --ea-cc-border: #d8d8d8;
  --ea-cc-radius: 8px;
}

#ea-cc-root { font-family: inherit; font-size: 15px; line-height: 1.5; }
.ea-cc-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ea-cc-lock { overflow: hidden; }

/* ------------------------------------------------------------------ banner */
.ea-cc-banner {
  position: fixed; inset: auto 0 0 0; z-index: 2147483000;
  background: var(--ea-cc-bg); color: var(--ea-cc-fg);
  border-top: 3px solid var(--ea-cc-accent);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
  transform: translateY(100%); transition: transform .28s ease;
  visibility: hidden;
}
.ea-cc-banner.is-open { transform: none; visibility: visible; }

.ea-cc-banner__inner {
  max-width: 1180px; margin: 0 auto; padding: 20px 24px;
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
}
.ea-cc-banner__text { flex: 1 1 420px; min-width: 0; }
.ea-cc-banner__title { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.ea-cc-banner__text p { margin: 0; font-size: 14px; color: var(--ea-cc-muted); }
.ea-cc-banner__text a { color: var(--ea-cc-accent); text-decoration: underline; }

.ea-cc-banner__actions {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; min-width: 220px;
}

/* ----------------------------------------------------------------- bottoni */
.ea-cc-btn {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border-radius: var(--ea-cc-radius); transition: filter .15s ease;
}
.ea-cc-btn:focus-visible { outline: 3px solid var(--ea-cc-accent); outline-offset: 2px; }
.ea-cc-btn:hover { filter: brightness(1.08); }

/* Accetta e Rifiuta: identici. Non modificare l'uno senza l'altro. */
.ea-cc-btn--primary {
  display: block; width: 100%; padding: 12px 24px;
  background: var(--ea-cc-accent); color: #fff;
  border: 2px solid var(--ea-cc-accent);
}
.ea-cc-btn--link {
  display: block; width: 100%; padding: 8px 24px;
  background: none; border: 0; color: var(--ea-cc-muted);
  text-decoration: underline; font-weight: 500; font-size: 14px;
}

/* ------------------------------------------------------------------- modal */
.ea-cc-modal { position: fixed; inset: 0; z-index: 2147483001; }
.ea-cc-modal[hidden] { display: none; }
.ea-cc-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.ea-cc-modal__dialog {
  position: relative; margin: 5vh auto; max-width: 640px; width: calc(100% - 32px);
  max-height: 90vh; display: flex; flex-direction: column;
  background: var(--ea-cc-bg); color: var(--ea-cc-fg);
  border-radius: 12px; overflow: hidden; box-shadow: 0 12px 48px rgba(0, 0, 0, .35);
}
.ea-cc-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--ea-cc-border);
}
.ea-cc-modal__head h2 { margin: 0; font-size: 18px; }
.ea-cc-close {
  background: none; border: 0; font-size: 28px; line-height: 1;
  cursor: pointer; color: var(--ea-cc-muted); padding: 0 4px;
}
.ea-cc-modal__body { padding: 8px 22px; overflow-y: auto; }
.ea-cc-modal__foot {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 16px 22px; border-top: 1px solid var(--ea-cc-border);
}
.ea-cc-modal__foot .ea-cc-btn--primary { flex: 1 1 160px; width: auto; }

/* -------------------------------------------------------------- categorie */
.ea-cc-cat { padding: 18px 0; border-bottom: 1px solid var(--ea-cc-border); }
.ea-cc-cat:last-child { border-bottom: 0; }
.ea-cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ea-cc-cat__head h3 { margin: 0; font-size: 16px; }
.ea-cc-cat p { margin: 8px 0 0; font-size: 14px; color: var(--ea-cc-muted); }
.ea-cc-cat__meta { font-size: 12.5px; opacity: .85; }
.ea-cc-always { font-size: 13px; color: var(--ea-cc-muted); white-space: nowrap; }

/* --------------------------------------------------------------- switch */
.ea-cc-switch { position: relative; display: inline-block; cursor: pointer; flex: 0 0 auto; }
.ea-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ea-cc-switch__ui {
  display: block; width: 48px; height: 26px; border-radius: 13px;
  background: #bdbdbd; transition: background .18s ease;
}
.ea-cc-switch__ui::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform .18s ease;
}
.ea-cc-switch input:checked + .ea-cc-switch__ui { background: var(--ea-cc-accent); }
.ea-cc-switch input:checked + .ea-cc-switch__ui::after { transform: translateX(22px); }
.ea-cc-switch input:focus-visible + .ea-cc-switch__ui {
  outline: 3px solid var(--ea-cc-accent); outline-offset: 2px;
}

/* --------------------------------------------- pulsante di riapertura */
.ea-cc-reopen {
  position: fixed; left: 16px; bottom: 16px; z-index: 2147482999;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--ea-cc-bg); color: var(--ea-cc-fg);
  border: 1px solid var(--ea-cc-border); box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  font-size: 20px; line-height: 1;
}
.ea-cc-reopen:focus-visible { outline: 3px solid var(--ea-cc-accent); outline-offset: 2px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 720px) {
  .ea-cc-banner__inner { padding: 16px; gap: 16px; }
  .ea-cc-banner__actions { width: 100%; min-width: 0; }
  .ea-cc-banner__text p { max-height: 40vh; overflow-y: auto; }
  .ea-cc-modal__dialog { margin: 0; width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .ea-cc-modal__foot .ea-cc-btn--primary { flex: 1 1 100%; }
  .ea-cc-reopen { width: 40px; height: 40px; bottom: 12px; left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ea-cc-banner, .ea-cc-switch__ui, .ea-cc-switch__ui::after { transition: none; }
}
