/* =============================================
   Bannière et modal de consentement cookies
   Variables en :root car pas de wrapper .cookie-consent
   ============================================= */

:root {
  --cookie-consent-z-banner: 9000;
  --cookie-consent-z-overlay: 9100;
  --cookie-consent-z-modal: 9200;
  --cookie-consent-bg: #0D1E2E;
  --cookie-consent-surface: #152C42;
  --cookie-consent-border: rgba(255, 255, 255, 0.1);
  --cookie-consent-text: #E8EEF5;
  --cookie-consent-muted: #7A94B0;
  --cookie-consent-accent: #1D72F5;
  --cookie-consent-accent-hover: #3A8BFF;
  --cookie-consent-radius: 8px;
  --cookie-consent-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ----- Bannière fixe en bas (z-index > header/topbar) ----- */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  padding: 1rem 1.25rem;
  background: var(--cookie-consent-bg);
  border-top: 1px solid var(--cookie-consent-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.cookie-consent-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.cookie-consent-banner-text {
  flex: 1 1 280px;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--cookie-consent-text);
}

.cookie-consent-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

/* ----- Boutons ----- */
.cookie-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.35;
  border-radius: var(--cookie-consent-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.cookie-consent-btn--primary {
  background: var(--cookie-consent-accent);
  color: #fff;
  border-color: var(--cookie-consent-accent);
}

.cookie-consent-btn--primary:hover {
  background: var(--cookie-consent-accent-hover);
  border-color: var(--cookie-consent-accent-hover);
}

.cookie-consent-btn--secondary {
  background: transparent;
  color: var(--cookie-consent-text);
  border-color: var(--cookie-consent-border);
}

.cookie-consent-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--cookie-consent-muted);
}

.cookie-consent-btn--outline {
  background: transparent;
  color: var(--cookie-consent-text);
  border-color: var(--cookie-consent-border);
}

.cookie-consent-btn--outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--cookie-consent-muted);
}

/* ----- Overlay ----- */
.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--cookie-consent-z-overlay);
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cookie-consent-overlay--open {
  opacity: 1;
  visibility: visible;
}

/* ----- Modal ----- */
.cookie-consent-modal {
  position: fixed;
  inset: 0;
  z-index: var(--cookie-consent-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cookie-consent-modal--open {
  opacity: 1;
  visibility: visible;
}

.cookie-consent-modal-inner {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--cookie-consent-surface);
  border: 1px solid var(--cookie-consent-border);
  border-radius: var(--cookie-consent-radius);
  box-shadow: var(--cookie-consent-shadow);
  padding: 1.5rem;
}

.cookie-consent-modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cookie-consent-text);
}

.cookie-consent-modal-desc {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--cookie-consent-muted);
}

.cookie-consent-modal-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cookie-consent-category {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  cursor: pointer;
}

.cookie-consent-category--disabled {
  cursor: default;
  opacity: 0.85;
}

.cookie-consent-category input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.25rem;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--cookie-consent-accent);
}

.cookie-consent-category--disabled input {
  cursor: not-allowed;
}

.cookie-consent-category-label {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--cookie-consent-text);
}

.cookie-consent-category-desc {
  width: 100%;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--cookie-consent-muted);
  padding-left: 1.75rem;
}

.cookie-consent-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
  .cookie-consent-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-banner-actions {
    justify-content: stretch;
  }

  .cookie-consent-btn {
    width: 100%;
  }

  .cookie-consent-modal-inner {
    padding: 1.25rem;
  }
}

/* Lien « Gérer mes cookies » dans le footer */
.footer-cookie-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--cookie-consent-muted, #7A94B0);
  cursor: pointer;
  opacity: 0.85;
  transition: color 0.2s, opacity 0.2s;
  text-align: left;
}

.footer-cookie-link:hover {
  color: var(--cookie-consent-text, #E8EEF5);
  opacity: 1;
}
