/* ==========================================================================
   Cookie Consent — styles autonomes
   Toutes les règles sont préfixées par .cc- pour ne jamais entrer en conflit
   avec le thème WordPress ou le CSS de vos pages custom.
   ========================================================================== */

:root {
  --cc-ink: #1c1b19;
  --cc-paper: #fbfaf7;
  --cc-line: rgba(28, 27, 25, 0.12);
  --cc-accent: #FF4EA0;
  --cc-accent-ink: #ffffff;
  --cc-muted: #6b6864;
  --cc-radius: 14px;
  --cc-shadow: 0 20px 60px -20px rgba(20, 20, 18, 0.35);
  --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cc-root, .cc-root * {
  box-sizing: border-box;
  font-family: var(--cc-font);
}

/* ---------- Voile de fond (affiché seulement pour le panneau détaillé) ---------- */
.cc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 17, 0.45);
  z-index: 2147483000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cc-backdrop.cc-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Bannière ---------- */
.cc-banner {
  position: fixed;
  right: 20px;
  left: auto;
  bottom: 20px;
  max-width: 460px;
  margin: 0;
  background: var(--cc-paper);
  color: var(--cc-ink);
  border-radius: var(--cc-radius);
  border: 1px solid var(--cc-line);
  box-shadow: var(--cc-shadow);
  padding: 22px 22px 18px;
  z-index: 2147483001;
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(.22,1,.36,1), opacity 0.3s ease;
}
.cc-banner.cc-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.cc-banner__leaf {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--cc-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.cc-banner__leaf svg { width: 16px; height: 16px; }

.cc-banner__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.cc-banner__text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-muted);
  margin: 0 0 16px;
}
.cc-banner__text a {
  color: var(--cc-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Boutons ---------- */
.cc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
}
.cc-btn:active { transform: scale(0.97); }

.cc-btn--primary {
  background: var(--cc-accent);
  color: #ffffff;
}
.cc-btn--primary:hover { filter: brightness(0.92); }

.cc-btn--secondary {
  background: var(--cc-ink);
  color: var(--cc-paper);
}
.cc-btn--secondary:hover { background: #000; }

.cc-btn--ghost {
  background: transparent;
  border-color: var(--cc-line);
  color: var(--cc-ink);
}
.cc-btn--ghost:hover { border-color: var(--cc-ink); }

.cc-btn--text {
  background: transparent;
  color: var(--cc-muted);
  flex: 0 0 auto;
  padding: 10px 6px;
}
.cc-btn--text:hover { color: var(--cc-ink); }

/* ---------- Panneau de préférences ---------- */
.cc-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 48px));
  overflow-y: auto;
  background: var(--cc-paper);
  color: var(--cc-ink);
  border-radius: 18px;
  box-shadow: var(--cc-shadow);
  z-index: 2147483002;
  padding: 26px 26px 22px;
  transform: translate(-50%, -46%) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.25s ease;
}
.cc-panel.cc-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.cc-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.cc-panel__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.cc-panel__close {
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--cc-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cc-panel__close:hover { background: var(--cc-line); color: var(--cc-ink); }
.cc-panel__close svg { width: 16px; height: 16px; }

.cc-panel__intro {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-muted);
  margin: 8px 0 18px;
}

.cc-cat {
  border-top: 1px solid var(--cc-line);
  padding: 14px 0;
}
.cc-cat:last-of-type { border-bottom: 1px solid var(--cc-line); }

.cc-cat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.cc-cat__name {
  font-size: 14px;
  font-weight: 600;
}
.cc-cat__desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--cc-muted);
  margin: 6px 0 0;
  max-width: 380px;
}
.cc-cat__badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--cc-muted);
}

/* Interrupteur (toggle) */
.cc-switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
}
.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.cc-switch__track {
  position: absolute;
  inset: 0;
  background: var(--cc-line);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.cc-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s cubic-bezier(.22,1,.36,1);
}
.cc-switch input:checked ~ .cc-switch__track { background: var(--cc-accent); }
.cc-switch input:checked ~ .cc-switch__thumb { transform: translateX(16px); }
.cc-switch input:disabled ~ .cc-switch__track { background: var(--cc-accent); opacity: 0.5; }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:focus-visible ~ .cc-switch__track { outline: 2px solid var(--cc-accent); outline-offset: 2px; }

.cc-panel__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 480px) {
  .cc-banner { left: 12px; right: 12px; bottom: 12px; padding: 18px 18px 14px; }
  .cc-panel { padding: 20px 18px 18px; }
  .cc-launcher { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-panel, .cc-backdrop, .cc-switch__thumb, .cc-switch__track {
    transition: none !important;
  }
}

/* Petit lien discret à mettre dans votre footer pour rouvrir le panneau */
.cc-manage-link {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font: inherit;
}

/* ---------- Bouton flottant permanent (rouvre la bannière à tout moment) ---------- */
.cc-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--cc-accent);
  box-shadow: 0 10px 26px -8px rgba(255, 78, 160, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147482999;
  transform: scale(0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.25s ease, box-shadow 0.2s ease;
}
.cc-launcher.cc-visible {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.cc-launcher:hover {
  box-shadow: 0 14px 32px -8px rgba(255, 78, 160, 0.7);
  transform: scale(1.06);
}
.cc-launcher svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

