/* ═══════════════════════════════════════════════════════════
   SYSTÈME DE GESTION DES COOKIES - RGPD
   Intégré au design Cœur d'Émeraude
   ═══════════════════════════════════════════════════════════ */

/* ─── BANDEAU COOKIES (bas de page) ─── */
#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: linear-gradient(135deg, var(--vert-profond) 0%, var(--vert-moyen) 100%);
  border-top: 2px solid var(--or);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.5s ease-out;
}

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

@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.cookie-consent-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 40px;
}

.cookie-consent-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cookie-consent-text h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--or-clair);
  margin-bottom: 8px;
}

.cookie-consent-text p {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 700px;
}

.cookie-consent-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* ─── BOUTONS ─── */
.cookie-btn {
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 14px 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: var(--emeraude);
  color: white;
}

.cookie-btn-primary:hover {
  background: var(--emeraude-clair);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(62, 180, 137, 0.4);
}

.cookie-btn-secondary {
  background: transparent;
  color: var(--or-clair);
  border: 1px solid var(--or);
}

.cookie-btn-secondary:hover {
  background: rgba(196, 163, 90, 0.1);
  border-color: var(--or-clair);
}

.cookie-btn-link {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 14px 20px;
  text-decoration: underline;
}

.cookie-btn-link:hover {
  color: white;
}

/* ─── MODAL DE PERSONNALISATION ─── */
#cookie-consent-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

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

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.cookie-modal-content {
  position: relative;
  background: var(--blanc-casse);
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-modal-header {
  background: var(--vert-profond);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--or);
}

.cookie-modal-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--or-clair);
  margin: 0;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  color: var(--or-clair);
  font-size: 32px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.cookie-modal-close:hover {
  background: rgba(196, 163, 90, 0.2);
  transform: rotate(90deg);
}

.cookie-modal-body {
  padding: 32px;
  max-height: 50vh;
  overflow-y: auto;
}

.cookie-category {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--creme-fonce);
}

.cookie-category:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cookie-category-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.cookie-category h4 {
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--vert-profond);
  margin-bottom: 6px;
}

.cookie-category p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--texte-moyen);
}

/* ─── SWITCH TOGGLE ─── */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 28px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
  background-color: var(--emeraude);
}

.cookie-switch input:checked + .cookie-slider:before {
  transform: translateX(24px);
}

.cookie-switch input:disabled + .cookie-slider {
  background-color: var(--vert-moyen);
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-modal-footer {
  padding: 20px 32px;
  background: var(--creme-fonce);
  border-top: 1px solid rgba(26, 58, 53, 0.1);
  text-align: center;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .cookie-consent-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .cookie-consent-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }

  .cookie-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    padding: 20px;
  }

  .cookie-category-header {
    flex-direction: column;
    gap: 12px;
  }
}

/* ─── LIEN DANS LE FOOTER POUR RÉOUVRIR LES PRÉFÉRENCES ─── */
.cookie-preferences-link {
  font-size: 12px;
  color: var(--texte-leger);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.3s ease;
}

.cookie-preferences-link:hover {
  color: var(--emeraude);
}
