/* Bandeau cookies / consentement — petite carte colorée (inspiration Axeptio).
   Design IDENTIQUE pour tous les sites : seule --ck-accent change, tout le reste en
   dérive via color-mix(). Sans bordure, thémable (var --c-*), responsive.
   Fallbacks : chaque fond coloré a une déclaration plate AVANT sa version color-mix. */
.ck {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  width: 372px;
  max-width: calc(100vw - 40px);
  --ck-accent: var(--c-accent, #2b6cb0);
  --ck-ink: var(--c-accent-ink, #fff);
  --ck-surf: var(--c-surface, #f4f6fa);
}
.ck[hidden] { display: none; }

.ck-box {
  background: var(--c-bg, #fff);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ck-accent) 11%, var(--c-bg, #fff)), var(--c-bg, #fff) 96px);
  color: var(--c-text, #1f2430);
  border-radius: 18px;
  box-shadow: 0 18px 48px -14px rgba(20, 28, 55, .32), 0 3px 12px -8px rgba(20, 28, 55, .2);
  padding: 15px;
  animation: ck-in .45s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes ck-in {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* En-tête : badge d'icône + texte */
.ck-top { display: flex; gap: 12px; align-items: center; }
.ck-ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  border-radius: 13px;
  background: var(--ck-surf);
  background: color-mix(in srgb, var(--ck-accent) 16%, var(--c-bg, #fff));
  box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--ck-accent) 45%, transparent);
  animation: ck-pop .5s cubic-bezier(.16, 1, .3, 1) .1s both;
}
@keyframes ck-pop { from { transform: scale(0); } to { transform: scale(1); } }
.ck-title { display: block; font-size: .98rem; margin-bottom: 2px; }
.ck-text { margin: 0; font-size: .84rem; line-height: 1.45; color: var(--c-muted, #5b6472); }
.ck-text a { color: var(--ck-accent); font-weight: 600; text-decoration: none; }
.ck-text a:hover { text-decoration: underline; }

/* Catégories (cartes + toggle) */
.ck-panel { display: flex; flex-direction: column; gap: 6px; margin-top: 13px; }
/* display:flex ci-dessus ecrase l'attribut [hidden] (display:none de l'UA) : sans
   cette regle le panneau reste visible en permanence. Il doit rester cache jusqu'au
   clic sur "Personnaliser". */
.ck-panel[hidden] { display: none; }
.ck-cat {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  background: var(--ck-surf);
  border-radius: 12px;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  animation: ck-row .35s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes ck-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ck-panel .ck-cat:nth-child(2) { animation-delay: .04s; }
.ck-panel .ck-cat:nth-child(3) { animation-delay: .08s; }
.ck-cat:hover:not(.is-locked) { background: color-mix(in srgb, var(--ck-accent) 9%, var(--ck-surf)); }
.ck-cat.is-locked { cursor: default; }

.ck-cat-ic {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--ck-accent);
  background: color-mix(in srgb, var(--ck-accent) 15%, transparent);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1);
}
.ck-cat:hover:not(.is-locked) .ck-cat-ic { transform: scale(1.1) rotate(-4deg); }
.ck-cat-tx { flex: 1 1 auto; min-width: 0; }
.ck-cat-tx strong { display: block; font-size: .84rem; font-weight: 600; }
.ck-cat-tx small { display: block; color: var(--c-muted, #5b6472); font-size: .75rem; margin-top: 1px; }

/* Toggle (la case devient un interrupteur) */
.ck-cat input {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 38px; height: 22px;
  border-radius: 100px;
  background: var(--c-border, #d5dae4);
  cursor: pointer;
  transition: background .22s ease;
}
.ck-cat input::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}
.ck-cat input:checked { background: var(--ck-accent); }
.ck-cat input:checked::after { transform: translateX(16px); }
.ck-cat input:disabled { opacity: .55; cursor: default; }

/* Actions */
.ck-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ck-btn {
  font: inherit;
  font-weight: 700;
  font-size: .84rem;
  padding: 9px 16px;
  border: 0;
  border-radius: 100px;
  cursor: pointer;
  transition: background .2s ease, filter .16s ease;
}
.ck-btn:active { filter: brightness(.95); }
.ck-primary {
  background: var(--ck-accent);
  color: var(--ck-ink);
  box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--ck-accent) 45%, transparent);
}
.ck-primary:hover { background: color-mix(in srgb, var(--ck-accent) 84%, #000); }
.ck-soft { background: var(--ck-surf); color: var(--c-text, #1f2430); }
.ck-soft { background: color-mix(in srgb, var(--ck-accent) 9%, var(--ck-surf)); }
.ck-soft:hover { background: color-mix(in srgb, var(--ck-accent) 22%, var(--ck-surf)); }
.ck-wide { grid-column: 1 / -1; }

.ck-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 7px;
  background: none;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-size: .79rem;
  font-weight: 600;
  color: var(--c-muted, #5b6472);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ck-link svg { opacity: .8; }
.ck-link:hover {
  color: var(--ck-accent);
  background: color-mix(in srgb, var(--ck-accent) 9%, transparent);
}

@media (max-width: 480px) {
  .ck { left: 10px; right: 10px; bottom: 10px; width: auto; max-width: none; }
  .ck-box { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ck-box, .ck-ico, .ck-cat { animation: none; }
  .ck-btn, .ck-cat, .ck-cat-ic, .ck-cat input::after { transition: none; }
}
