/* ===========================
   Cookie Bar — Luxury minimal
   =========================== */

:root{
  --cc-bg:#fff;
  --cc-text:var(--color-text,#111);
  --cc-bd:var(--color-border,#e6e6e6);
  --cc-btn-bg:#111;
  --cc-btn-text:#fff;
  --cc-maxw:var(--container-width,1200px);
  --cc-pad:14px var(--outer-pad,30px);
}

/* Nascondi se già accettato (in test era stato disabilitato dal <head>) */
html[data-consent-given="true"] #cookiebar{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Barra principale */
#cookiebar{
  position:fixed; left:0; right:0; bottom:0; z-index:1500;
  background:var(--cc-bg); color:var(--cc-text);
  border-top:1px solid var(--cc-bd);   /* riga minimal full-screen */
  font-size:12px; line-height:1.45;
}

/* Contenitori con stessa geometria (per allineamento perfetto su desktop) */
#cookiebar .cc-inner,
#cookiebar .cc-prefs .row{
  max-width:var(--cc-maxw);
  margin:0 auto;
  padding:var(--cc-pad);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

/* --- Riga top --- */
#cookiebar .cc-copy{ margin:0; flex:1 1 auto; }
#cookiebar .cc-copy a{
  color:inherit; text-decoration:underline; text-underline-offset:3px; font-weight:400;
}
#cookiebar .cc-actions{
  margin-left:auto;                /* spinge il blocco azioni a destra */
  display:flex; gap:12px; align-items:center; white-space:nowrap;
}
#cookiebar .cc-link{
  font:inherit; background:transparent; border:0; padding:0; color:inherit; cursor:pointer;
  text-decoration:underline; text-underline-offset:3px;
}
#cookiebar .cc-btn{
  appearance:none; border:0; cursor:pointer; background:var(--cc-btn-bg); color:var(--cc-btn-text);
  padding:10px 14px; border-radius:0; font:inherit; letter-spacing:.02em;
}

/* --- Preferenze --- */
#cookiebar .cc-prefs{ display:none; }
#cookiebar .cc-prefs[open]{ display:block; }

/* niente linea in mezzo: nessun border-top nella sezione preferenze */
#cookiebar #cc-prefs-title{ font-weight:400; }  /* non bold */
#cookiebar .cc-prefs .cc-actions{ margin-left:auto; }

/* Checkbox minimal (come footer) */
#cookiebar .cc-prefs input[type="checkbox"]{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  width:14px; height:14px; border:1px solid #111; border-radius:2px;
  background:transparent; display:inline-grid; place-content:center; margin:0; outline-offset:2px;
}
#cookiebar .cc-prefs input[type="checkbox"]::after{
  content:""; width:8px; height:5px; transform:rotate(-45deg);
  border-left:2px solid #111; border-bottom:2px solid #111; opacity:0;
}
#cookiebar .cc-prefs input[type="checkbox"]:checked::after{ opacity:1; }
#cookiebar .cc-prefs input[type="checkbox"]:focus-visible{ outline:1px dotted #777; }

/* Necessari (disabilitato, grigio) */
#cookiebar .cc-prefs .cc-req input[disabled]{
  border-color:#bdbdbd; background:#f5f5f5;
}
#cookiebar .cc-prefs .cc-req input[disabled]::after{
  border-left-color:#bdbdbd; border-bottom-color:#bdbdbd; opacity:1;
}

/* Responsive: forza l'a capo di "Scopri di più..." all'inizio break */
#cookiebar .cc-br{ display:none; }
@media (max-width: 1024px){
  #cookiebar .cc-br{ display:block; }
}

/* Mobile: pulsanti sopra, testo sotto, entrambi centrati */
@media (max-width: 640px){
  #cookiebar .cc-inner{
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
  }
  #cookiebar .cc-actions{
    margin-left:0;
    justify-content:center;
  }
  #cookiebar .cc-copy{ width:100%; }
  #cookiebar .cc-btn{ padding:8px 12px; }
  /* Preferenze: su mobile manteniamo layout affiancato con bottone a dx della stessa riga */
  #cookiebar .cc-prefs .row{
    flex-wrap:wrap;
    padding:12px var(--outer-pad,30px);
  }
}

/* Schermi molto piccoli */
@media (max-width: 380px){
  #cookiebar .cc-btn{ padding:7px 10px; font-size:11px; }
  #cookiebar .cc-actions{ gap:10px; }
}
