/* ================================================================
   EU Cookie Consent – white-label
   assets/css/eu-cookie-consent.css
   I colori --ecc-primary / --ecc-dark sono iniettati da wp_head
   in base alle impostazioni del sito (con fallback qui sotto).
   ================================================================ */

:root {
  --ecc-primary:    #2563eb;
  --ecc-dark:       #1a1a2e;
  --ecc-text:       #2d2d2d;
  --ecc-muted:      #6b7280;
  --ecc-border:     #e5e7eb;
  --ecc-bg:         #ffffff;
  --ecc-radius:     14px;
  --ecc-shadow:     0 -2px 40px rgba(0,0,0,.14), 0 2px 20px rgba(0,0,0,.08);
  --ecc-transition: .28s cubic-bezier(.4,0,.2,1);
}

/* ── Overlay ──────────────────────────────────────────────────── */
.ecc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 99998; opacity: 0;
  transition: opacity var(--ecc-transition); pointer-events: none;
}
.ecc-overlay.ecc-visible { opacity: 1; pointer-events: auto; }

/* ── Banner base ──────────────────────────────────────────────── */
.ecc-banner {
  position: fixed; z-index: 99999;
  background: var(--ecc-bg);
  box-shadow: var(--ecc-shadow);
  padding: 20px 24px 22px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px; color: var(--ecc-text);
  transition: transform var(--ecc-transition);
  max-height: 90vh; overflow-y: auto; box-sizing: border-box;
}
.ecc-banner * { box-sizing: border-box; }

/* Variante BARRA (full-width bottom) */
.ecc-banner--bar {
  bottom: 0; left: 0; right: 0;
  border-top: 3px solid var(--ecc-primary);
  transform: translateY(110%);
}
.ecc-banner--bar.ecc-visible { transform: translateY(0); }

/* Variante CARD: barra su mobile, card centrata su desktop */
.ecc-banner--card {
  bottom: 0; left: 0; right: 0;
  border-top: 3px solid var(--ecc-primary);
  transform: translateY(110%);
}
.ecc-banner--card.ecc-visible { transform: translateY(0); }

@media (min-width: 900px) {
  .ecc-banner--card {
    bottom: 24px; left: 50%; right: auto;
    transform: translateX(-50%) translateY(130%);
    width: 680px; max-width: calc(100vw - 48px);
    border-top: none; border-radius: var(--ecc-radius);
    border-left: 4px solid var(--ecc-primary);
  }
  .ecc-banner--card.ecc-visible { transform: translateX(-50%) translateY(0); }
}

/* ── Header ───────────────────────────────────────────────────── */
.ecc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.ecc-logo {
  display: flex; align-items: center; gap: 7px;
  color: var(--ecc-primary);
  font-weight: 700; font-size: 13px;
  letter-spacing: .04em; text-transform: uppercase;
}
.ecc-badge {
  background: var(--ecc-dark); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  padding: 3px 8px; border-radius: 4px;
}
.ecc-brand {
  font-size: 12px; color: var(--ecc-muted);
  font-weight: 600; margin-bottom: 10px;
}

/* ── Body ─────────────────────────────────────────────────────── */
.ecc-body { margin-bottom: 16px; }
.ecc-text { line-height: 1.6; color: #444; margin: 0; }
.ecc-link {
  color: var(--ecc-primary); text-decoration: none;
  font-weight: 600; white-space: nowrap; margin-left: 4px;
  transition: opacity .2s;
}
.ecc-link:hover { opacity: .75; }

/* ── Pannello gestione ────────────────────────────────────────── */
.ecc-manage-panel {
  background: #f8f9fb; border: 1px solid var(--ecc-border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 14px;
  animation: eccSlideDown .25s ease;
}
.ecc-manage-panel[hidden] { display: none; }
@keyframes eccSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ecc-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ecc-toggle-info { display: flex; flex-direction: column; gap: 2px; }
.ecc-toggle-info strong { font-size: 13px; color: var(--ecc-dark); }
.ecc-toggle-info span { font-size: 12px; color: var(--ecc-muted); }

/* ── Switch ───────────────────────────────────────────────────── */
.ecc-switch {
  position: relative; display: inline-block;
  width: 44px; height: 24px; flex-shrink: 0; cursor: pointer;
}
.ecc-switch input { opacity: 0; width: 0; height: 0; }
.ecc-slider {
  position: absolute; inset: 0; background: #d1d5db;
  border-radius: 24px; transition: background var(--ecc-transition);
}
.ecc-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform var(--ecc-transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.ecc-switch input:checked + .ecc-slider { background: var(--ecc-primary); }
.ecc-switch input:checked + .ecc-slider::before { transform: translateX(20px); }
.ecc-switch--disabled { opacity: .55; cursor: not-allowed; }

/* ── Azioni ───────────────────────────────────────────────────── */
.ecc-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ecc-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; border-radius: 8px; padding: 10px 18px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s; white-space: nowrap; line-height: 1;
}
.ecc-btn:focus-visible { outline: 2px solid var(--ecc-primary); outline-offset: 2px; }
.ecc-btn--primary {
  background: var(--ecc-primary); color: #fff; margin-left: auto;
  padding: 11px 22px; font-size: 14px;
  box-shadow: 0 3px 12px rgba(0,0,0,.18);
  filter: saturate(1);
}
.ecc-btn--primary:hover { filter: brightness(.92); transform: translateY(-1px); }
.ecc-btn--primary:active { transform: translateY(0); }
.ecc-btn--outline {
  background: transparent; color: var(--ecc-muted);
  border: 1.5px solid var(--ecc-border);
}
.ecc-btn--outline:hover { border-color: #9ca3af; color: var(--ecc-text); }
.ecc-btn--ghost { background: transparent; color: var(--ecc-muted); }
.ecc-btn--ghost:hover { background: #f3f4f6; color: var(--ecc-text); }
.ecc-btn-icon { font-size: 14px; }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ecc-banner { padding: 16px 16px 20px; }
  .ecc-actions { flex-direction: column; gap: 8px; }
  .ecc-btn { width: 100%; justify-content: center; }
  .ecc-btn--primary { margin-left: 0; }
}

/* ── A11y / Print ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ecc-banner, .ecc-overlay { transition: none; }
}
@media print { .ecc-banner, .ecc-overlay { display: none !important; } }
