/* ===== Bannière cookies – style moderne ===== */

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(680px, calc(100% - 32px));
  box-sizing: border-box;

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;

  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow:
    0 2px 6px rgba(17, 24, 39, 0.06),
    0 20px 50px rgba(17, 24, 39, 0.22);
  color: var(--texte, #111827);

  animation: cookie-entree 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.cookie-banner[hidden],
.cookie-gerer[hidden] { display: none; }

/* Icône */
.cookie-banner::before {
  content: "🍪";
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  border-radius: 14px;
  background: var(--accent-doux, rgba(31, 99, 214, 0.1));
}

.cookie-banner p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--texte-doux, #4b5563);
}

/* Boutons */
.cookie-actions {
  display: flex;
  gap: 8px;
}

.cookie-actions button {
  padding: 11px 20px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--bord-fort, #b3bac6);
  background: transparent;
  color: var(--texte, #111827);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.cookie-actions button:hover {
  background: rgba(17, 24, 39, 0.06);
}

.cookie-actions button.primaire {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #1f63d6), var(--accent-hover, #174fb0));
  box-shadow: 0 6px 16px rgba(31, 99, 214, 0.35);
}

.cookie-actions button.primaire:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 99, 214, 0.45);
}

.cookie-actions button:active { transform: scale(0.97); }

.cookie-actions button:focus-visible,
.cookie-gerer:focus-visible {
  outline: 3px solid var(--accent, #1f63d6);
  outline-offset: 2px;
}

/* Petit bouton pour rouvrir le choix */
.cookie-gerer {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--bord, #c9ced7);
  background: var(--carte, #fff);
  color: var(--texte, #111827);
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.12);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

.cookie-gerer::before { content: "🍪"; font-size: 0.9rem; }
.cookie-gerer:hover { opacity: 1; transform: translateY(-2px); }

@keyframes cookie-entree {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Mobile : tout s'empile, boutons pleine largeur */
@media (max-width: 600px) {
  .cookie-banner {
    bottom: 12px;
    grid-template-columns: auto 1fr;
    padding: 16px;
    border-radius: 18px;
  }
  .cookie-banner::before { width: 40px; height: 40px; font-size: 1.25rem; }
  .cookie-actions { grid-column: 1 / -1; }
  .cookie-actions button { flex: 1; }
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
  .cookie-banner {
    background: rgba(24, 26, 33, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
  }
  .cookie-banner p { color: #b6bcc8; }
  .cookie-actions button { color: #f3f4f6; border-color: rgba(255, 255, 255, 0.25); }
  .cookie-actions button:hover { background: rgba(255, 255, 255, 0.08); }
  .cookie-gerer { background: #1c1e26; color: #f3f4f6; border-color: rgba(255, 255, 255, 0.15); }
}

/* Respect de la préférence « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { animation: none; }
  .cookie-actions button, .cookie-gerer { transition: none; }
}