/* =============================================
   BANNIÈRE COOKIE CONSENT — Styles AWL
   Palette : blanc / dark-900 (#09090b) / jaune volt (#facc15)
   Font    : Inter (même que le site)
   ============================================= */

:root {
  /* Identiques aux variables Tailwind du site */
  --cookie-bg:           #ffffff;
  --cookie-border:       #e4e4e7;          /* zinc-200 */
  --cookie-text:         #09090b;          /* dark-900 */
  --cookie-text-muted:   #71717a;          /* zinc-500 */
  --cookie-accent:       #facc15;          /* volt-400 */
  --cookie-accent-hover: #eab308;          /* volt-500 */
  --cookie-btn-decline-bg:    #f4f4f5;     /* zinc-100 */
  --cookie-btn-decline-hover: #e4e4e7;     /* zinc-200 */
  --cookie-radius: 24px;
  --cookie-shadow: 0 20px 50px rgba(0, 0, 0, 0.10), 0 4px 16px rgba(0,0,0,0.06);
}

/* ---- Overlay (fond semi-transparent) ---- */
#cookie-overlay {
  display: none;
  position: fixed;
  inset: 0; /* équivalent à top/right/bottom/left: 0 */
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

/* ---- Popup principal ---- */
#cookie-banner {
  display: none;
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 560px;
  background: var(--cookie-bg);
  border: 1px solid var(--cookie-border);
  border-radius: var(--cookie-radius);
  box-shadow: var(--cookie-shadow);
  padding: 28px 32px;
  z-index: 9999;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--cookie-text);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Icône cookie ---- */
#cookie-banner .cookie-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: block;
}

/* ---- Titre ---- */
#cookie-banner h3 {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--cookie-text);  /* dark-900: même que les titres du site */
  letter-spacing: -0.3px;
}

/* ---- Texte de description ---- */
#cookie-banner p {
  margin: 0 0 20px 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--cookie-text-muted);
}

/* ---- Lien dans le texte ---- */
#cookie-banner p a {
  color: var(--cookie-text);         /* dark-900, comme les liens du site */
  font-weight: 700;
  border-bottom: 2px solid var(--cookie-accent); /* soulignage jaune volt */
  text-decoration: none;
}
#cookie-banner p a:hover {
  color: #ca8a04;                    /* volt-600 au survol */
}

/* ---- Groupe de boutons ---- */
#cookie-banner .cookie-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Bouton commun ---- */
#cookie-banner .cookie-buttons button {
  flex: 1;
  min-width: 120px;
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

#cookie-banner .cookie-buttons button:active {
  transform: scale(0.97);
}

/* ---- Bouton "Accepter" (principal) ----
   Identique au CTA principal du site : fond jaune volt, texte dark-900
   Même style que : bg-volt-400 text-dark-900 shadow-[0_8px_30px_rgba(250,204,21,0.3)]  */
#cookie-banner #btn-accept {
  background: var(--cookie-accent);
  color: var(--cookie-text);         /* texte noir sur fond jaune, comme le site */
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.35);
}

#cookie-banner #btn-accept:hover {
  background: var(--cookie-accent-hover);
  box-shadow: 0 8px 30px rgba(234, 179, 8, 0.45);
}

/* ---- Bouton "Refuser" (secondaire) ----
   Style secondaire du site : fond zinc-100, texte zinc-500  */
#cookie-banner #btn-decline {
  background: var(--cookie-btn-decline-bg);
  color: var(--cookie-text-muted);
  border: 2px solid var(--cookie-border);
}

#cookie-banner #btn-decline:hover {
  background: var(--cookie-btn-decline-hover);
  color: var(--cookie-text);
}

/* ---- Bouton "Paramètres" (tertiaire, optionnel) ---- */
#cookie-banner #btn-settings {
  flex: 0 0 auto;
  background: transparent;
  color: var(--cookie-text-muted);
  border: 2px solid var(--cookie-border) !important;
  font-size: 13px;
  padding: 11px 16px;
}

#cookie-banner #btn-settings:hover {
  color: var(--cookie-text);
  border-color: var(--cookie-text) !important;
}

/* ---- Animations ---- */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Responsive mobile ---- */
@media (max-width: 480px) {
  #cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    border-radius: 20px 20px 0 0;  /* coins plus cohérents avec le site */
    padding: 24px 20px;
    border-bottom: none;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ==============================================
   PANNEAU PARAMÈTRES DÉTAILLÉS
   S'ouvre en remplacement de la bannière simple
   ============================================== */

#cookie-settings {
  display: none;
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 560px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
  padding: 28px 32px;
  z-index: 9999;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Bouton retour en haut du panneau */
#cookie-settings .settings-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

#cookie-settings .settings-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #09090b;
  letter-spacing: -0.3px;
  flex: 1;
}

#btn-back {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #71717a;
  cursor: pointer;
  transition: all 0.15s;
}
#btn-back:hover { background: #e4e4e7; color: #09090b; }

/* ---- Catégorie de cookie ---- */
.cookie-category {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cookie-category-info { flex: 1; }

.cookie-category-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #09090b;
  margin-bottom: 4px;
}

.cookie-category-info p {
  font-size: 12px;
  color: #71717a;
  line-height: 1.55;
  margin: 0;
}

/* ---- Badge "Toujours actif" ---- */
.badge-always {
  font-size: 11px;
  font-weight: 700;
  color: #71717a;
  background: #e4e4e7;
  border-radius: 99px;
  padding: 3px 10px;
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ---- Toggle switch ---- */
.toggle-wrap {
  flex-shrink: 0;
  margin-top: 2px;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #e4e4e7;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.toggle input:checked + .toggle-slider {
  background: #facc15;   /* volt-400 */
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ---- Bouton Sauvegarder du panneau ---- */
#btn-save-settings {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  background: #09090b;   /* dark-900 : style bouton secondaire du site */
  color: #facc15;        /* texte volt-400 */
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
}
#btn-save-settings:hover { background: #18181b; }

/* ---- Responsive mobile (panneau) ---- */
@media (max-width: 480px) {
  #cookie-settings {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding: 24px 20px;
  }
}

