/**
 * Cookie Consent — Bannière style lilial.fr
 * Zone haute fond sombre + zone basse fond clair + panneau déroulant
 *
 * @author Club Lilial
 * @version 2.0
 */

/* =============================================================================
   OVERLAY
   ============================================================================= */

.cc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  pointer-events: none;
}

.cc-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* =============================================================================
   BANNIÈRE — Conteneur principal
   ============================================================================= */

.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.7s ease, opacity 0.5s ease;
  font-family: 'Calibri', 'Segoe UI', Arial, sans-serif;
}

.cc-banner--visible {
  transform: translateY(0);
  opacity: 1;
}

.cc-banner--closing {
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

/* =============================================================================
   ZONE HAUTE — Fond sombre
   ============================================================================= */

.cc-banner__top {
  background-color: #3c4a54;
  padding: 28px 0 24px;
}

.cc-banner__top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

/* Logo */
.cc-banner__logo {
  margin-bottom: 14px;
}

.cc-banner__logo-img {
  width: 90px;
  height: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  filter: brightness(1.8);
}

.cc-banner__logo-img:hover {
  opacity: 1;
}

/* Texte */
.cc-banner__text {
  font-size: 14px;
  line-height: 1.7;
  color: #c8cfd4;
  margin: 0 auto 22px;
  max-width: 720px;
}

.cc-banner__policy-link {
  color: #7ec8d4;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.cc-banner__policy-link:hover,
.cc-banner__policy-link:focus {
  color: #ffffff;
}

/* =============================================================================
   BOUTONS — Ovales, côte à côte
   ============================================================================= */

.cc-banner__buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cc-btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.2px;
  line-height: 1.4;
  white-space: nowrap;
}

/* Bouton contour blanc — « Autoriser la sélection » */
.cc-btn--outline {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.cc-btn--outline:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

/* Bouton plein bleu-vert — « Autoriser tous les cookies » */
.cc-btn--filled {
  background-color: #5eaab4;
  color: #ffffff;
  border: 2px solid #5eaab4;
}

.cc-btn--filled:hover {
  background-color: #4d959e;
  border-color: #4d959e;
}

/* =============================================================================
   ZONE BASSE — Fond clair
   ============================================================================= */

.cc-banner__bottom {
  background-color: #f1f1f1;
  border-top: 1px solid #e0e0e0;
}

.cc-banner__bottom-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =============================================================================
   CHECKBOXES — Style carré avec coche personnalisée
   ============================================================================= */

.cc-banner__checkboxes {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.cc-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: #444444;
  position: relative;
}

/* Masquer l'input natif (technique sr-only / visually-hidden) */
.cc-checkbox__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Boîte carrée personnalisée */
.cc-checkbox__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid #b0b0b0;
  border-radius: 3px;
  background-color: #ffffff;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

/* Coche (masquée par défaut) */
.cc-checkbox__box::after {
  content: '';
  display: block;
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
  margin-top: -2px;
}

/* Checkbox cochée → fond bleu-vert + coche visible */
/* Note : ~ (frère général) au lieu de + (frère adjacent) pour compatibilité
   avec script.js qui peut insérer un <span> entre l'input et .cc-checkbox__box */
.cc-checkbox__input:checked ~ .cc-checkbox__box {
  background-color: #5eaab4;
  border-color: #5eaab4;
}

.cc-checkbox__input:checked ~ .cc-checkbox__box::after {
  transform: rotate(45deg) scale(1);
}

/* Nécessaires — verrouillée (cochée + désactivée) */
.cc-checkbox__box--locked {
  background-color: #5eaab4;
  border-color: #5eaab4;
  opacity: 0.7;
  cursor: not-allowed;
}

.cc-checkbox__box--locked::after {
  transform: rotate(45deg) scale(1);
}

.cc-checkbox__input:disabled ~ .cc-checkbox__label {
  color: #888888;
  cursor: not-allowed;
}

.cc-checkbox__label {
  line-height: 1.3;
  font-weight: 400;
}

/* =============================================================================
   « AFFICHER LES DÉTAILS » — Bouton texte + flèche
   ============================================================================= */

.cc-banner__details-toggle {
  flex-shrink: 0;
}

.cc-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #444444;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.cc-details-btn:hover {
  color: #5eaab4;
}

.cc-details-btn__arrow {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  position: relative;
  top: -3px;
  transition: transform 0.3s ease;
}

.cc-details-btn--open .cc-details-btn__arrow {
  transform: rotate(180deg);
}

/* =============================================================================
   PANNEAU DÉROULANT DES DÉTAILS
   ============================================================================= */

.cc-banner__details-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  background-color: #f9f9f9;
  border-top: 1px solid #e8e8e8;
}

.cc-banner__details-panel--open {
  max-height: 30vh;
  overflow-y: auto;
}

.cc-banner__details-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 32px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #666666;
}

.cc-banner__details-content p {
  margin: 0 0 10px 0;
}

.cc-banner__details-content p:first-child {
  font-weight: 400;
  color: #213d46;
}

.cc-banner__details-content p:first-child strong {
  font-weight: 700;
}

.cc-banner__details-content p:last-child {
  margin-bottom: 0;
}

/* =============================================================================
   RESPONSIVE — TABLETTE
   ============================================================================= */

@media (max-width: 768px) {
  .cc-banner__top-inner {
    padding: 0 20px;
  }

  .cc-banner__text {
    font-size: 13px;
  }

  .cc-btn {
    padding: 10px 24px;
    font-size: 14px;
  }

  .cc-banner__bottom-inner {
    flex-direction: column;
    gap: 14px;
    padding: 14px 20px;
  }

  .cc-banner__checkboxes {
    gap: 18px;
    justify-content: center;
  }

  .cc-banner__details-toggle {
    align-self: flex-end;
  }

  .cc-banner__details-content {
    padding: 16px 20px;
  }
}

/* =============================================================================
   RESPONSIVE — MOBILE
   ============================================================================= */

@media (max-width: 480px) {
  .cc-banner__top {
    padding: 20px 0 18px;
  }

  .cc-banner__top-inner {
    padding: 0 16px;
  }

  .cc-banner__logo-img {
    width: 70px;
  }

  .cc-banner__text {
    font-size: 12px;
    line-height: 1.5;
  }

  .cc-banner__buttons {
    flex-direction: column;
    gap: 10px;
  }

  .cc-btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 14px;
  }

  .cc-banner__bottom-inner {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .cc-banner__checkboxes {
    gap: 12px;
    flex-wrap: wrap;
  }

  .cc-checkbox {
    font-size: 13px;
  }

  .cc-checkbox__box {
    width: 20px;
    height: 20px;
  }

  .cc-banner__details-content {
    padding: 14px 16px;
    font-size: 12.5px;
  }
}

/* =============================================================================
   ACCESSIBILITÉ — Focus
   ============================================================================= */

.cc-checkbox__input:focus-visible ~ .cc-checkbox__box {
  outline: 2px solid #5eaab4;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(94, 170, 180, 0.25);
}

.cc-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(94, 170, 180, 0.4);
}

.cc-details-btn:focus-visible {
  outline: 2px solid #5eaab4;
  outline-offset: 2px;
}
