/* ==========================================================================
   Banner cookie + pannello preferenze.
   Autonomo: usa solo le variabili di base.css, così funziona anche nelle pagine legali.
   ========================================================================== */
.ck, .ckp { font-family: var(--font-body, 'Manrope', system-ui, sans-serif); color: var(--text, #26344d); }
.ck *, .ckp * { box-sizing: border-box; }

/* ----- banner ----- */
.ck {
  position: fixed; z-index: 400; left: 22px; bottom: 22px; width: min(460px, calc(100vw - 44px));
  background: #fff; border-radius: 20px; padding: 26px 26px 22px;
  box-shadow: 0 24px 60px -16px rgba(6,26,61,.45), 0 0 0 1px rgba(10,40,86,.08);
  transform: translateY(24px); opacity: 0; visibility: hidden;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .4s ease, visibility 0s linear .5s;
}
.ck.is-on { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.ck__x {
  position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted, #5c6b85); cursor: pointer; display: grid; place-items: center;
}
.ck__x:hover { background: var(--paper, #f4f6fa); color: var(--navy, #0a2856); }
.ck__x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.ck__t { font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif); font-size: 26px; line-height: 1.1; font-weight: 500; color: var(--navy, #0a2856); margin: 0 30px 10px 0; }
.ck__d { font-size: 13.5px; line-height: 1.6; margin: 0 0 18px; color: var(--text, #26344d); }
.ck__d a, .ckp a { color: var(--navy, #0a2856); font-weight: 700; text-underline-offset: 3px; }
.ck__row { display: flex; flex-wrap: wrap; gap: 10px; }

/* bottoni: stesso peso visivo per accettare e rifiutare */
.ck-btn {
  flex: 1 1 auto; min-height: 46px; padding: 12px 18px; border-radius: 999px; cursor: pointer;
  font: 800 12px/1 var(--font-body, 'Manrope', system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase;
  border: 1.5px solid var(--navy, #0a2856); background: var(--navy, #0a2856); color: #fff; transition: background .2s, color .2s, transform .2s;
}
.ck-btn:hover { background: var(--navy-700, #123a75); border-color: var(--navy-700, #123a75); }
.ck-btn--line { background: transparent; color: var(--navy, #0a2856); }
.ck-btn--line:hover { background: var(--navy, #0a2856); color: #fff; border-color: var(--navy, #0a2856); }
.ck-btn:focus-visible, .ck__x:focus-visible, .ck-sw input:focus-visible + i { outline: 3px solid var(--orange, #f77601); outline-offset: 2px; }
.ck__row .ck-btn--link { flex-basis: 100%; }

/* ----- pannello preferenze ----- */
.ckp {
  position: fixed; inset: 0; z-index: 410; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(6,26,61,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s;
}
.ckp.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.ckp__box {
  position: relative; width: min(620px, 100%); max-height: min(92vh, 760px); overflow: auto; background: #fff; border-radius: 22px;
  padding: 32px 32px 26px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
}
.ckp__t { font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif); font-size: 32px; font-weight: 500; line-height: 1.1; color: var(--navy, #0a2856); margin: 0 40px 8px 0; }
.ckp__lead { font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
.ckp__x { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--paper, #f4f6fa); color: var(--navy, #0a2856); cursor: pointer; display: grid; place-items: center; }
.ckp__x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.ckp__x:hover { background: var(--navy, #0a2856); color: #fff; }
.ckc { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; padding: 18px 0; border-top: 1px solid var(--line, #e2e7f0); }
.ckc h3 { margin: 0 0 4px; font: 800 14px/1.3 var(--font-body, 'Manrope', system-ui, sans-serif); color: var(--navy, #0a2856); }
.ckc p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted, #5c6b85); }
.ckc small { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--orange-text, #b85400); }
.ck-sw { position: relative; flex-shrink: 0; width: 52px; height: 30px; margin-top: 2px; }
.ck-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.ck-sw i { position: absolute; inset: 0; border-radius: 999px; background: #c5cddc; transition: background .2s; }
.ck-sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .2s; }
.ck-sw input:checked + i { background: var(--navy, #0a2856); }
.ck-sw input:checked + i::after { transform: translateX(22px); }
.ck-sw input:disabled { cursor: not-allowed; }
.ck-sw input:disabled + i { opacity: .6; }
.ckp__row { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line, #e2e7f0); }
.ckp__links { margin: 16px 0 0; font-size: 12.5px; color: var(--muted, #5c6b85); }

@media (max-width: 560px) {
  .ck { left: 0; right: 0; bottom: 0; width: 100%; border-radius: 20px 20px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  .ck__t { font-size: 24px; }
  .ck__row .ck-btn { flex-basis: 100%; }
  .ckp { padding: 0; align-items: flex-end; }
  .ckp__box { border-radius: 22px 22px 0 0; padding: 26px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 94vh; }
  .ckp__row .ck-btn { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ck, .ckp, .ck-sw i, .ck-sw i::after { transition: none !important; } }
