/* ── MPHB Hourly Booking ─────────────────────────────────────────────── */

/* Toggle pill horaire / journalier */
.mphb-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: 50px;
  overflow: hidden;
  border: 2px solid #060097;
  width: fit-content;
}
.mphb-mode-btn {
  flex: 1;
  padding: 9px 22px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #fff;
  color: #060097;
  transition:
    background 0.2s,
    color 0.2s;
  line-height: 1;
  white-space: nowrap;
}
.mphb-mode-btn:first-child {
  border-radius: 50px 0 0 50px;
}
.mphb-mode-btn:last-child {
  border-radius: 0 50px 50px 0;
}
.mphb-mode-btn.is-active {
  background: #060097;
  color: #fff;
}
.mphb-mode-btn:not(.is-active):hover {
  background: #f0f0ff;
}

/* Picker horaire (dans le formulaire de recherche) */
.mphb-hourly-picker-wrap {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
}
.mphb-h-fields {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.mphb-h-field {
  flex: 1;
  min-width: 120px;
}
.mphb-h-field label {
  display: block;
  font-size: 0.82em;
  font-weight: 600;
  color: #444;
  margin-bottom: 5px;
}
.mphb-h-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95em;
  height: 40px;
  background: #fff;
}
.mphb-h-field select:disabled {
  background: #f0f0f0;
  color: #aaa;
}

/* Résumé durée / prix */
.mphb-h-summary {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  border-radius: 4px;
  font-size: 0.88em;
  flex-wrap: wrap;
}
.mphb-h-dur,
.mphb-h-price {
  font-weight: 700;
  color: #2e7d32;
}

/* Erreur */
.mphb-h-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fce4e4;
  border-left: 4px solid #e53935;
  border-radius: 4px;
  color: #c62828;
  font-size: 0.85em;
}

/* Chargement */
.mphb-h-loading {
  margin-top: 6px;
  font-size: 0.82em;
  color: #888;
}

/* Timeline (mode checkout) */
.mphb-h-picker {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
}
.mphb-h-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.mphb-h-col {
  flex: 1;
  min-width: 130px;
}
.mphb-h-lbl {
  display: block;
  font-weight: 600;
  font-size: 0.85em;
  color: #333;
  margin-bottom: 5px;
}
.mphb-h-col select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95em;
}
.mphb-h-col select:disabled {
  background: #f0f0f0;
  color: #999;
}
.mphb-h-bar {
  margin-top: 14px;
  height: 20px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.mphb-h-bar-inner {
  position: relative;
  width: 100%;
  height: 100%;
}
.mphb-h-seg {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
}
.mphb-h-seg--bk {
  background: repeating-linear-gradient(
    45deg,
    #e53935,
    #e53935 4px,
    #ffcdd2 4px,
    #ffcdd2 8px
  );
  opacity: 0.8;
}
.mphb-h-seg--sel {
  background: #4caf50;
  opacity: 0.75;
}

@media (max-width: 480px) {
  .mphb-mode-toggle {
    width: 100%;
  }
  .mphb-mode-btn {
    flex: 1;
    text-align: center;
  }
  .mphb-h-fields {
    flex-direction: column;
  }
  .mphb-h-row {
    flex-direction: column;
  }
  .mphb-h-summary {
    flex-direction: column;
    gap: 4px;
  }
}

/* ── Masquage de la date de départ sur les pages avec notre toggle ────── */
/* La date de départ n'est jamais pertinente : en mode journalier on réserve
   1 jour, en mode horaire on utilise les créneaux. On la masque globalement
   sur les formulaires qui contiennent notre toggle. */
.mphb-hide-checkout .mphb-check-out-date-wrapper {
  display: none !important;
}
.mphb-hide-checkout .mphb-check-out-date-wrapper input {
  display: none !important;
  visibility: hidden !important;
}

/* Masquage immédiat avant que le JS s'exécute : cible les formulaires
   qui ont un mount point hourly dans leur scope */
.mphb-booking-form:has(~ .mphb-hourly-search-mount) .mphb-check-out-date-wrapper,
.mphb-hourly-search-mount ~ .mphb-booking-form .mphb-check-out-date-wrapper {
  display: none !important;
}

/* Fallback sans :has() pour les navigateurs plus anciens —
   le JS prend le relais via addClass('mphb-hide-checkout') */