/* ==========================================================================
   LINÉA LE MANS – BANDEAU COOKIES & CONSENT MANAGEMENT PLATFORM (CMP)
   Conforme RGPD / CNIL & Google Consent Mode v2 (Google Ads & GA4)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BANDEAU FLOTTANT PRINCIPAL (BAS D'ÉCRAN)
   -------------------------------------------------------------------------- */
.cookie-banner-overlay {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 660px;
  margin: 0 auto;
  z-index: 99998;
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner-overlay.show {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.cookie-banner-card {
  background: rgba(8, 44, 66, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(196, 169, 119, 0.45);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4), 0 0 35px rgba(196, 169, 119, 0.12);
  color: #ffffff;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
}

.cookie-banner-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cookie-icon-gold {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: #ecd8b0;
}

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

.cookie-banner-text {
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.cookie-banner-text a {
  color: #ecd8b0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.cookie-banner-text a:hover {
  color: #ffffff;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Boutons principaux avec symétrie CNIL stricte */
.cookie-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  border: 1px solid transparent;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, #c4a977 0%, #ecd8b0 100%);
  color: #082c42;
  border-color: #c4a977;
  box-shadow: 0 4px 14px rgba(196, 169, 119, 0.35);
}

.cookie-btn-accept:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(196, 169, 119, 0.5);
}

.cookie-btn-refuse {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.cookie-btn-refuse:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-1px);
}

.cookie-btn-customize {
  background: transparent;
  color: #ecd8b0;
  border-color: rgba(196, 169, 119, 0.35);
  margin-right: auto;
}

.cookie-btn-customize:hover {
  background: rgba(196, 169, 119, 0.15);
  border-color: #ecd8b0;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   2. MODALE DÉTAILLÉE DE PERSONNALISATION (CENTRE DE PRÉFÉRENCES)
   -------------------------------------------------------------------------- */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 26, 39, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal-card {
  background: #ffffff;
  border-radius: 18px;
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(196, 169, 119, 0.4);
  overflow: hidden;
  animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.cookie-modal-header {
  background: #082c42;
  color: #ffffff;
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #c4a977;
}

.cookie-modal-title {
  font-family: var(--font-serif, 'Cinzel', serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}

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

.cookie-modal-body {
  padding: 24px 26px;
  overflow-y: auto;
  flex: 1;
}

.cookie-modal-intro {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #475569;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

/* Catégories de cookies */
.cookie-category-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.cookie-category-item:hover {
  border-color: #cbd5e1;
}

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

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

.cookie-category-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #082c42;
  margin: 0;
}

.cookie-category-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #64748b;
  margin: 0;
}

.cookie-category-vendors {
  margin-top: 8px;
  font-size: 0.74rem;
  color: #94a3b8;
}

/* Badge Toujours Actif */
.cookie-badge-required {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Switch Toggle Haute Précision */
.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;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 24px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

.cookie-switch input:focus + .cookie-slider {
  box-shadow: 0 0 1px #047857;
}

.cookie-modal-footer {
  padding: 18px 26px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   3. BOUTON FLOTTANT PERMANENT DE RÉVOCATION (BAS GAUCHE)
   -------------------------------------------------------------------------- */
.cookie-launcher-btn {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 99990;
  background: rgba(8, 44, 66, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(196, 169, 119, 0.4);
  color: #ecd8b0;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.cookie-launcher-btn:hover {
  background: #082c42;
  border-color: #c4a977;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.cookie-launcher-btn svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   4. RESPONSIVE MOBILE (IPHONE / PETITS ÉCRANS)
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .cookie-banner-overlay {
    bottom: 12px;
    left: 12px;
    right: 12px;
  }
  
  .cookie-banner-card {
    padding: 18px 18px;
    border-radius: 14px;
  }

  .cookie-banner-title {
    font-size: 1.02rem;
  }

  .cookie-banner-text {
    font-size: 0.8rem;
    margin-bottom: 16px;
  }

  .cookie-banner-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .cookie-btn {
    width: 100%;
    padding: 11px 16px;
  }

  .cookie-btn-customize {
    margin-right: 0;
    order: 3;
  }
  .cookie-btn-refuse {
    order: 2;
  }
  .cookie-btn-accept {
    order: 1;
  }

  .cookie-launcher-btn {
    bottom: 14px;
    left: 14px;
    padding: 7px 12px;
    font-size: 0.72rem;
  }

  .cookie-modal-card {
    max-height: 94vh;
  }
  
  .cookie-modal-header {
    padding: 16px 18px;
  }
  
  .cookie-modal-body {
    padding: 16px 18px;
  }
  
  .cookie-modal-footer {
    padding: 14px 18px;
    flex-direction: column;
  }
  
  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}
