/* SkiAlpine - bandeau de consentement */
#sa-consent {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 880px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 28px;
  background: #0b1a33;
  color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

#sa-consent.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#sa-consent [hidden] {
  display: none !important;
}

#sa-consent .sa-consent__title {
  display: block;
  margin-bottom: 8px;
  font-family: 'Outfit', 'DM Sans', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 600;
}

#sa-consent p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.9);
}

#sa-consent a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Boutons : même taille, même importance (aucune incitation visuelle) */
#sa-consent .sa-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

#sa-consent .sa-consent__btn {
  flex: 1 1 200px;
  padding: 12px 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ffffff;
  color: #0b1a33;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease;
}

#sa-consent .sa-consent__btn--outline {
  background: transparent;
  color: #ffffff;
}

#sa-consent .sa-consent__btn:hover {
  transform: translateY(-1px);
}

#sa-consent .sa-consent__btn:focus-visible,
#sa-consent a:focus-visible,
#sa-consent .sa-consent__switch input:focus-visible + .sa-consent__slider {
  outline: 3px solid #e8794b;
  outline-offset: 2px;
}

/* Panneau "Paramétrer" */
#sa-consent .sa-consent__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

#sa-consent .sa-consent__row-text b {
  display: block;
  margin-bottom: 2px;
}

#sa-consent .sa-consent__row-text span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

#sa-consent .sa-consent__always {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

#sa-consent .sa-consent__more {
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 14px;
}

#sa-consent .sa-consent__switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 52px;
  height: 30px;
}

#sa-consent .sa-consent__switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

#sa-consent .sa-consent__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  transition: background-color 0.2s ease;
}

#sa-consent .sa-consent__slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

#sa-consent .sa-consent__switch input:checked + .sa-consent__slider {
  background: #3fa66b;
}

#sa-consent .sa-consent__switch input:checked + .sa-consent__slider::before {
  transform: translateX(22px);
}

#sa-consent .sa-consent__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Bouton permanent pour modifier son choix */
#sa-consent-fab {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: #0b1a33;
  color: #ffffff;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

#sa-consent-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}

#sa-consent-fab:focus-visible {
  outline: 3px solid #e8794b;
  outline-offset: 2px;
}

/* Le bouton flottant reste sur les écrans assez larges pour avoir une marge à gauche du contenu.
   En dessous, il masquait des champs, des boutons et le prix de la barre de réservation :
   le lien « Gérer les cookies » du pied de page et du menu mobile le remplace. */
@media (max-width: 1439px) {
  #sa-consent-fab {
    display: none;
  }
}

@media (max-width: 640px) {
  /* Bandeau resserré : il occupait près des trois quarts d'un écran de téléphone */
  #sa-consent {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 20px);
    padding: 16px;
    font-size: 14px;
    line-height: 1.45;
  }

  #sa-consent .sa-consent__title {
    margin-bottom: 6px;
    font-size: 17px;
  }

  #sa-consent p {
    margin-bottom: 8px;
  }

  #sa-consent .sa-consent__actions {
    gap: 8px;
    margin-top: 12px;
  }

  /* Refuser et Accepter côte à côte, à égalité ; Paramétrer en dessous */
  #sa-consent .sa-consent__btn {
    flex: 1 1 calc(50% - 4px);
    padding: 10px 12px;
    line-height: 1.25;
  }

  #sa-consent .sa-consent__btn--outline {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sa-consent,
  #sa-consent.is-visible,
  #sa-consent-fab,
  #sa-consent-fab.is-visible,
  #sa-consent .sa-consent__btn,
  #sa-consent .sa-consent__slider,
  #sa-consent .sa-consent__slider::before {
    transition: none;
  }
}
