/**
 * ecmcore — banner cookie.
 * Foglio a sé (non dentro il tema) perché il banner è la prima cosa che si vede e deve
 * reggersi anche se il CSS del tema tarda: qui c'è tutto il necessario, palette ECS compresa.
 * I due pulsanti di scelta sono identici per forma e dimensione: rifiutare non deve
 * costare più fatica che accettare.
 */
.ecs-cookie {
  --ecs-cookie-ink: #32323f;
  --ecs-cookie-accent: #ce4636;
  --ecs-cookie-line: #e3e1dd;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ecs-cookie-ink);
}
.ecs-cookie.is-open { display: flex; }

.ecs-cookie__backdrop { position: absolute; inset: 0; background: rgba(50, 50, 63, .45); }

.ecs-cookie__box {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  margin: 0 auto 16px;
  padding: 24px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.ecs-cookie__title { margin: 0 0 .5rem; font-size: 20px; font-weight: 700; line-height: 1.2; }
.ecs-cookie__body { margin: 0 0 1rem; font-size: 15px; line-height: 1.5; }
.ecs-cookie__body a { color: var(--ecs-cookie-accent); text-underline-offset: 2px; }

.ecs-cookie__prefs { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.ecs-cookie__row {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .7rem .8rem; border: 1px solid var(--ecs-cookie-line); border-radius: 10px; cursor: pointer;
}
.ecs-cookie__row.is-locked { background: #faf9f8; cursor: default; }
.ecs-cookie__row input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--ecs-cookie-accent); }
.ecs-cookie__row strong { display: block; font-size: 14px; }
.ecs-cookie__row small { display: block; font-size: 13px; line-height: 1.4; color: #6c868e; }

.ecs-cookie__actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; }
/* stessa forma e stesso peso per "rifiuta" e "accetta": nessuno dei due è più facile dell'altro */
.ecs-cookie__btn {
  flex: 1 1 auto; min-width: 150px;
  height: 44px; padding: 0 18px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  color: #fff; background: var(--ecs-cookie-ink);
  border: 1px solid var(--ecs-cookie-ink); border-radius: 10px; cursor: pointer;
}
.ecs-cookie__btn:hover { background: #26262f; border-color: #26262f; }
.ecs-cookie__btn--ghost, .ecs-cookie__btn--save {
  color: var(--ecs-cookie-ink); background: #fff;
}
.ecs-cookie__btn--ghost:hover, .ecs-cookie__btn--save:hover {
  background: #fff; color: var(--ecs-cookie-accent); border-color: var(--ecs-cookie-accent);
}

/* Riapertura: a riposo e' un tondo con l'icona (mezzo ingranaggio, mezzo biscotto);
   al passaggio del mouse — o col fuoco da tastiera — si allunga e scopre la scritta.
   L'etichetta resta nel DOM (e in aria-label) anche quando e' chiusa: chi usa uno
   screen reader la sente comunque. */
.ecs-cookie-reopen {
  position: fixed; left: 12px; bottom: 12px; z-index: 1500;
  display: inline-flex; align-items: center;
  height: 44px; padding: 0; width: auto;
  font-family: 'Figtree', sans-serif; font-size: 12px; font-weight: 700;
  color: #32323f; background: #fff;
  border: 1px solid #e3e1dd; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12); cursor: pointer; opacity: .85;
  overflow: hidden;
  transition: opacity .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.ecs-cookie-reopen__icon {
  flex: 0 0 42px; width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ecs-cookie-reopen__icon svg { width: 22px; height: 22px; display: block; }
.ecs-cookie-reopen__label {
  max-width: 0; opacity: 0; padding-right: 0;
  white-space: nowrap; overflow: hidden;
  transition: max-width .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease, padding-right .3s ease;
}
.ecs-cookie-reopen:hover, .ecs-cookie-reopen:focus-visible {
  opacity: 1; border-color: #ce4636; color: #c34030;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}
.ecs-cookie-reopen:hover .ecs-cookie-reopen__label,
.ecs-cookie-reopen:focus-visible .ecs-cookie-reopen__label {
  max-width: 16rem; opacity: 1; padding-right: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .ecs-cookie-reopen, .ecs-cookie-reopen__label { transition: none; }
}

@media (max-width: 575px) {
  .ecs-cookie__box { padding: 18px; border-radius: 14px; }
  .ecs-cookie__btn { min-width: 100%; }
}
