/* =========================================================
   COOKIE-CONSENT.CSS — Bannière + centre de préférences
   Charte main-site : carte claire, Inter, boutons .btn
   (Bebas Neue), primaire #000. Conforme RGPD / ePrivacy.
   ========================================================= */

/* Conteneur racine (caché tant que le JS n'a pas décidé d'afficher) */
.ff-cc[hidden] { display: none !important; }

/* ----------------------------------------------------------
   Bannière (premier niveau, barre fixe en bas, non bloquante)
   ---------------------------------------------------------- */
.ff-cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Sous le preloader (z-index 9999) : la bannière ne doit jamais
     passer par-dessus le rideau de chargement. */
  z-index: 9000;
  background: var(--ff-black);
  border-top: 1px solid var(--ff-gray-6);
  box-shadow: 0 -6px 24px var(--ff-black-a50);

  /* État d'animation : la barre démarre sous l'écran, invisible. */
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  will-change: transform, opacity;
}

/* Entrée : glisse vers le haut et apparaît. */
.ff-cc-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ff-cc-banner[hidden] { display: none !important; }

/* Contenu aligné sur le conteneur du site (largeur footer), fond pleine largeur */
.ff-cc-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 40px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.ff-cc-banner__text { flex: 1 1 420px; min-width: 280px; }

.ff-cc-banner__text h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ff-white);
  margin: 0 0 6px;
  line-height: 1.05;
}

.ff-cc-banner__text p {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ff-gray-4);
  margin: 0;
}

.ff-cc-link {
  color: var(--ff-black);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.ff-cc-link:hover { color: var(--ff-black); }

/* Lien sur fond sombre (bannière) : blanc */
.ff-cc-banner .ff-cc-link { color: var(--ff-white); }
.ff-cc-banner .ff-cc-link:hover { color: var(--ff-gray-3); }

.ff-cc-banner__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* On force des largeurs comparables : « Refuser » doit être aussi
   accessible que « Accepter » (exigence APD/EDPB). */
.ff-cc-banner__actions .btn,
.ff-cc-modal__foot .btn {
  font-size: 1.05em;
  padding: 11px 22px;
  min-width: 132px;
}

/* ----------------------------------------------------------
   Centre de préférences (deuxième niveau, vraie modal)
   ---------------------------------------------------------- */
.ff-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 9001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ff-cc-modal[hidden] { display: none !important; }

.ff-cc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--ff-black-a50);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ff-cc-modal.is-open .ff-cc-modal__backdrop { opacity: 1; }

.ff-cc-modal__panel {
  position: relative;
  background: var(--ff-white);
  border-radius: 14px;
  box-shadow: 0 24px 60px var(--ff-black-a50);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;

  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ff-cc-modal.is-open .ff-cc-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ff-cc-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--ff-gray-2);
}

.ff-cc-modal__head h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ff-black);
  margin: 0;
  line-height: 1;
}

.ff-cc-modal__close {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--ff-gray-5);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}
.ff-cc-modal__close:hover { color: var(--ff-black); }
.ff-cc-modal__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ff-black-a25);
}

.ff-cc-modal__body {
  padding: 18px 22px;
  overflow-y: auto;
}

.ff-cc-modal__intro {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ff-gray-6);
  margin: 0 0 16px;
}

/* Catégorie de cookies */
.ff-cc-cat {
  border: 1px solid var(--ff-gray-1);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--ff-gray-1);
}
.ff-cc-cat:last-child { margin-bottom: 0; }

.ff-cc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ff-cc-cat__title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ff-black);
}

.ff-cc-cat__always {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ff-success);
  white-space: nowrap;
}

.ff-cc-cat__desc {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ff-gray-5);
  margin: 0;
}

/* Interrupteur (switch) */
.ff-cc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}
.ff-cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ff-cc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--ff-gray-3);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.ff-cc-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: var(--ff-white);
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px var(--ff-black-a25);
}
.ff-cc-switch input:checked + .ff-cc-slider { background: var(--ff-black); }
.ff-cc-switch input:checked + .ff-cc-slider::before { transform: translateX(20px); }
.ff-cc-switch input:focus-visible + .ff-cc-slider {
  box-shadow: 0 0 0 3px var(--ff-black-a25);
}

.ff-cc-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--ff-gray-2);
  background: var(--ff-gray-1);
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  .ff-cc-banner__inner {
    padding: 18px 16px;
    gap: 16px;
  }
  .ff-cc-banner__actions {
    width: 100%;
  }
  .ff-cc-banner__actions .btn {
    flex: 1 1 100%;
    min-width: 0;
  }
  .ff-cc-modal__foot { justify-content: stretch; }
  .ff-cc-modal__foot .btn {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* ----------------------------------------------------------
   Accessibilité : pas d'animation si l'utilisateur la refuse
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ff-cc-banner,
  .ff-cc-modal__backdrop,
  .ff-cc-modal__panel {
    transition: none !important;
  }
  .ff-cc-banner { transform: none; }
  .ff-cc-modal__panel { transform: none; }
}
