/* =========================================================
   CONSENTEMENT COOKIES (RGPD) — Estelle Tissier Coaching
   Bandeau bas d'écran + panneau de personnalisation.
   Utilise EXCLUSIVEMENT les tokens du site (tokens.css) :
   terracotta / espresso / crème / Newsreader / Source Sans.
   ========================================================= */

/* Utilitaire lecteur d'écran */
.cc-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Bandeau ---------- */
.cc-banner {
  position: fixed;
  left: 50%;
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  transform: translateX(-50%);
  width: min(100% - 1.5rem, 960px);
  z-index: 1000;
  background: var(--cream);
  color: var(--espresso-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px -20px rgba(61, 43, 31, 0.38);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  font-family: var(--font-body);
  animation: cc-rise .35s ease both;
}
@keyframes cc-rise {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.cc-banner-title {
  font-family: var(--font-title); font-weight: 500;
  color: var(--espresso); font-size: 1.3rem; line-height: 1.2;
  margin: 0 0 .5rem;
}
.cc-banner-text {
  margin: 0 0 1.2rem;
  font-size: var(--fs-body); line-height: 1.55;
  color: var(--espresso-soft);
  max-width: 70ch;
}
.cc-banner-text a { color: var(--terracotta-deep); text-decoration: underline; text-underline-offset: 2px; }

.cc-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- Boutons (3 actions de poids visuel IDENTIQUE) ---------- */
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.1;
  padding: .72rem 1.35rem; border-radius: var(--radius);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.cc-btn:active { transform: translateY(1px); }
/* Un seul et même style pour « Tout accepter », « Tout refuser » et
   « Essentiels uniquement » — aucune hiérarchie (conformité RGPD). */
.cc-btn--primary { background: var(--terracotta-deep); color: var(--cream); }
.cc-btn--primary:hover { background: var(--terracotta-darker); }
.cc-btn:focus-visible { outline: 2px solid var(--espresso); outline-offset: 2px; }

/* Lien discret « Personnaliser » */
.cc-link {
  margin-left: auto;
  background: none; border: 0; padding: .45rem .2rem; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: .98rem;
  color: var(--espresso); text-decoration: underline; text-underline-offset: 3px;
}
.cc-link:hover { color: var(--terracotta-deep); }
.cc-link:focus-visible { outline: 2px solid var(--espresso); outline-offset: 2px; border-radius: 3px; }

/* ---------- Panneau de personnalisation (modal) ---------- */
.cc-overlay {
  position: fixed; inset: 0; z-index: 1001;
  background: rgba(61, 43, 31, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  animation: cc-fade .25s ease both;
}
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }

.cc-panel {
  background: var(--cream); color: var(--espresso-soft);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -24px rgba(61, 43, 31, 0.5);
  width: min(100%, 620px); max-height: min(90vh, 760px); overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  font-family: var(--font-body);
}
.cc-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.cc-panel-title {
  font-family: var(--font-title); font-weight: 500; color: var(--espresso);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem); line-height: 1.15; margin: 0;
}
.cc-panel-intro { margin: .5rem 0 1.5rem; font-size: var(--fs-body); line-height: 1.55; color: var(--espresso-soft); }

.cc-close {
  flex: none; background: none; border: 0; cursor: pointer;
  color: var(--espresso-soft); font-size: 1.6rem; line-height: 1; padding: .1rem .35rem;
  border-radius: var(--radius);
}
.cc-close:hover { color: var(--terracotta-deep); }
.cc-close:focus-visible { outline: 2px solid var(--espresso); outline-offset: 2px; }

/* Catégories */
.cc-cat {
  display: grid; grid-template-columns: 1fr auto; gap: .4rem 1.5rem; align-items: center;
  padding: 1.2rem 0; border-top: 1px solid var(--line);
}
.cc-cat:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.cc-cat-name { font-family: var(--font-title); font-weight: 500; color: var(--espresso); font-size: 1.2rem; margin: 0 0 .35rem; }
.cc-cat-desc { margin: 0; font-size: .96rem; line-height: 1.5; color: var(--espresso-soft); }
.cc-cat-state { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.cc-always { font-size: .82rem; font-weight: 600; color: var(--terracotta-deep); white-space: nowrap; }

/* Toggle */
.cc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.cc-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-slider { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background-color .2s ease; }
.cc-slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: var(--cream); border-radius: 50%; transition: transform .2s ease;
  box-shadow: 0 1px 2px rgba(61, 43, 31, .35);
}
.cc-switch input:checked + .cc-slider { background: var(--terracotta-deep); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--terracotta-deep); outline-offset: 2px; }
/* Essentiels : toggle verrouillé (toujours actif, grisé) */
.cc-switch--locked { opacity: .5; }
.cc-switch--locked input { cursor: not-allowed; }

.cc-panel-actions { display: flex; justify-content: flex-end; }

/* Responsive */
@media (max-width: 560px) {
  .cc-actions { flex-direction: column; align-items: stretch; }
  .cc-btn { width: 100%; }
  .cc-link { margin-left: 0; margin-top: .1rem; text-align: center; }
}
