/* Dropdown des âges enfants */
#enfantsAgesDropdown {
  position: absolute;
  z-index: 9999;
  width: 320px;
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  display: none;
  animation: fadeIn 0.2s ease-out;
  border: 1px solid #dcdcdc;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
  height: auto;
  max-height: none;
  overflow: visible;
}

#enfantsAgesContainer {
    margin-bottom: 15px; /* laisse de la place pour les boutons */
}

.enfants-age-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.popup-buttons {
    display: flex;
    justify-content: space-between;   /* OK à gauche, Réinitialiser à droite */
    gap: 10px;
    margin-top: 10px;
}

.popup-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

#okBtn {
    background: #007bff;
    color: #fff;
}

#resetBtn {
    background: #f1f1f1;
    color: #333;
}

#enfantsAgesDropdown.visible {
  opacity: 1;
  transform: translateY(0);
}

.ages-popup-inner {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.child-age-row {
  margin-bottom: 10px;
}

.ages-popup h4 {
    margin-top: 0;
    font-size: 15px;
    font-weight: bold;
}

.age-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.age-row select {
    flex: 1;
    padding: 6px;
    border-radius: 6px;
}

.ages-popup-footer button {
  flex: 1;
  white-space: nowrap;
}

/* Popup âges enfants */
.ages-popup {
    position: absolute;
    top: 55px;
    left: 0;
    width: 320px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    z-index: 9999;
    display: none;
    transition: height 0.2s ease;
    /*overflow: hidden; /* empêche le scroll */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ages-popup {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: .375rem;
  padding: .5rem;
  display: none;
  min-width: 140px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 2000;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}


/* Enveloppe interne : header, grid, footer */
.ages-popup-header { font-weight:600; margin-bottom:8px; }
/* IMPORTANT: empêcher la grille de créer un scroll */
.ages-popup-body {
  overflow: visible !important;
}

.ages-popup-body {
  max-height: 180px;
  padding: 12px;
  padding-bottom: 10px;
}

/* grille 2 colonnes, responsive */
.ages-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow: visible;
}

.ages-popup-note {
  font-size: 11px;
  color: #555;
  margin-top: 10px;
  line-height: 1.3;
}

/* chaque cellule */
.ages-cell {
  display: flex;
  flex-direction: column;
}

/* petite taille pour selects */
.ages-popup .form-select, .ages-popup .form-control {
  font-size: 0.9rem;
  padding: .28rem .5rem;
}

/* si on doit forcer un scroll interne (overflow actif) */
.ages-popup.scrolling {
  overflow: auto;
}

/* footer collé en bas si popup scrollable (sticky) */
.ages-popup-footer.sticky {
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, #fff);
  padding-top: 8px;
}

/* petit style pour le texte explicatif */
.ages-explanatory {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #444;
}

.age-row {
    margin-bottom: 5px;
}

#enfantsAgesDropdown .info {
    margin-top: 10px;
    margin-bottom: 10px;
}

.ages-popup-header {
  background: #f8f9fa;
  padding: 10px 15px;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

.ages-popup-footer {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 5px;
}

.ages-popup select {
  width: 100%;
}

#enfantsAgesDropdown .d-flex.justify-content-between {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

#enfantsAgesDropdown .d-flex.justify-content-between button {
    flex: 1;
    white-space: nowrap;
}

#enfantsAgesDropdown {
  padding-bottom: 15px !important; /* on retire le padding énorme */
}

#enfantsAgesDropdown .ages-popup-inner {
  width: 100%;
  box-sizing: border-box;
}

#enfantsAgesDropdown .d-flex.justify-content-between {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

#enfantsAgesDropdown .d-flex.justify-content-between button {
  flex: 1;
  white-space: nowrap;
}

#enfantsAgesDropdown {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 15px !important; /* important pour corriger la marge fantôme */
}

#enfantsAgesDropdown .ages-popup-inner {
  overflow: visible !important;
}

#resetBtn {
    background-color: #fff !important;
    color: #d40000 !important;
    border: 2px solid #d40000 !important;
}

#resetBtn:hover {
    background-color: #ffe5e5 !important;
}

