/* ==========================================================================
   MONSIEUR JAMIN — BANDEAU & GESTION DU CONSENTEMENT DES COOKIES (CNIL / RGPD)
   ========================================================================== */

/* --- Bandeau Flottant (Cookie Banner) --- */
.jamin-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 48px);
  max-width: 980px;
  background: rgba(18, 18, 24, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 16px;
  padding: 24px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 175, 55, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  color: #fafafa;
  box-sizing: border-box;
}

.jamin-cookie-banner.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1 1 500px;
}

.cookie-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cookie-banner-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.cookie-banner-title {
  font-family: var(--font-serif, 'Cinzel', serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin: 0;
}

.cookie-banner-desc {
  font-size: 0.88rem;
  color: #b0b4ba;
  line-height: 1.55;
  margin: 0;
}

.cookie-banner-desc a {
  color: var(--accent-gold, #d4af37);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.cookie-banner-desc a:hover {
  color: #fbbf24;
}

/* Boutons du bandeau */
.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-btn {
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
}

/* Accepter tout - Gold Premium */
.cookie-btn-accept {
  background: linear-gradient(135deg, #d4af37 0%, #aa820a 100%);
  color: #0d0c0a;
  border: 1px solid #d4af37;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.cookie-btn-accept:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d4af37 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Refuser tout - Équivalence stricte CNIL */
.cookie-btn-reject {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

/* Personnaliser */
.cookie-btn-settings {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 10px 14px;
}

.cookie-btn-settings:hover {
  color: var(--accent-gold, #d4af37);
}

/* --- Fenêtre Modale de Personnalisation --- */
.jamin-cookie-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.jamin-cookie-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.jamin-cookie-modal {
  background: #121218;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.15);
  color: #fafafa;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  position: relative;
  box-sizing: border-box;
}

.cookie-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.cookie-modal-title {
  font-family: var(--font-serif, 'Cinzel', serif);
  font-size: 1.35rem;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.cookie-modal-subtitle {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0;
}

.cookie-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.2s ease;
}

.cookie-modal-close:hover {
  color: #ffffff;
}

/* Liste des catégories */
.cookie-category-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cookie-category-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-category-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.cookie-badge-required {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #d4af37;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-category-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

/* Switch Toggle Apple-style */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  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: rgba(255, 255, 255, 0.15);
  transition: 0.3s ease;
  border-radius: 24px;
}

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

.cookie-switch input:checked + .cookie-slider {
  background-color: #d4af37;
}

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

.cookie-switch input:disabled + .cookie-slider {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #d4af37;
}

/* Footer de la modale */
.cookie-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* --- Bouton permanent discret pour réouvrir les préférences --- */
.jamin-cookie-floating-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(18, 18, 24, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #cbd5e1;
  border-radius: 30px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 999;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.jamin-cookie-floating-trigger:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #fff;
  border-color: #d4af37;
  transform: translateY(-2px);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .jamin-cookie-banner {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 18px 20px;
  }
  .cookie-banner-content {
    gap: 16px;
  }
  .cookie-banner-actions {
    width: 100%;
    flex-direction: column;
  }
  .cookie-btn {
    width: 100%;
  }
  .jamin-cookie-modal {
    padding: 22px 18px;
  }
  .cookie-modal-footer {
    flex-direction: column;
  }
  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}
