/* ================================================================
   COOKIES — Bandeau & Panneau de gestion
   ================================================================ */

/* ── Bandeau bas de page ───────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1a1a1a;
  color: #f5f5f5;
  border-top: 2px solid #c9a96e;
  padding: 1rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

#cookie-banner.cookie-banner-visible {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 250px;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e0e0e0;
}

.cookie-banner-text a {
  color: #c9a96e;
  text-decoration: underline;
}

.cookie-banner-text a:hover {
  color: #fff;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Boutons génériques ────────────────────────────────────────── */
.cookie-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.cookie-btn-primary {
  background: #c9a96e;
  color: #1a1a1a;
}

.cookie-btn-primary:hover {
  background: #b8935a;
}

.cookie-btn-secondary {
  background: transparent;
  color: #f5f5f5;
  border: 1px solid #555;
}

.cookie-btn-secondary:hover {
  background: #2a2a2a;
  border-color: #888;
}

.cookie-btn-outline {
  background: transparent;
  color: #c9a96e;
  border: 1px solid #c9a96e;
}

.cookie-btn-outline:hover {
  background: #c9a96e;
  color: #1a1a1a;
}

/* ── Overlay ───────────────────────────────────────────────────── */
#cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(2px);
}

#cookie-overlay.cookie-overlay-visible {
  opacity: 1;
}

/* ── Panneau de personnalisation ───────────────────────────────── */
#cookie-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  z-index: 10001;
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid #333;
  border-top: 3px solid #c9a96e;
  border-radius: 8px;
  padding: 2rem;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

#cookie-panel.cookie-panel-visible {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.cookie-panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.cookie-panel-close:hover {
  color: #fff;
  background: #2a2a2a;
}

#cookie-panel h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: #c9a96e;
  padding-right: 2rem;
}

.cookie-panel-intro {
  font-size: 0.88rem;
  color: #aaa;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ── Options cookies (ligne avec toggle) ───────────────────────── */
.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #2a2a2a;
}

.cookie-option:last-of-type {
  border-bottom: 1px solid #2a2a2a;
}

.cookie-option-info {
  flex: 1;
}

.cookie-option-info strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #f5f5f5;
}

.cookie-option-info p {
  margin: 0;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.4;
}

/* ── Toggle switch ─────────────────────────────────────────────── */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  background: #444;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: #c9a96e;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(22px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Pied du panneau ───────────────────────────────────────────── */
.cookie-panel-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .cookie-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
  }

  #cookie-panel {
    padding: 1.5rem;
  }
}
