/* Moteur de recherche hôtels : accueil, liste de résultats et fiche hôtel */
.he {
  --he-primary: #009aad;
  --he-primary-dark: #1e8284;
  --he-primary-soft: #E4ECF4;
  --he-primary-ink: #0B4F82;
  --he-ink: #0b0a12;
  --he-muted: #5A6878;
  --he-line: #CBD3DD;
  --he-line-soft: #E2E7EE;
  --he-bg-soft: #F4F6F9;
  --he-radius: 12px;
  --he-shadow: 0 12px 40px rgba(20, 33, 46, .18);
  position: relative;
  font-family: "DM Sans", system-ui, sans-serif;
}
.he *, .he *::before, .he *::after { box-sizing: border-box; }

/* Barre : 4 zones sur desktop, empilées sur mobile */
.he-bar { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 992px) {
  .he-bar { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.3fr) minmax(0, 1.45fr) auto; gap: 0; border: 1px solid var(--he-line); border-radius: var(--he-radius); background: #fff; }
  .he-bar > .he-field + .he-field { border-left: 1px solid var(--he-line-soft); }
  .he-bar .he-trigger { border: 0; border-radius: 0; }
  .he-bar > .he-field:first-child .he-trigger { border-radius: var(--he-radius) 0 0 var(--he-radius); }
  .he-submit-wrap { padding: 6px; }
  .he--fiche .he-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
}
.he-field { position: relative; min-width: 0; }

.he-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 16px;
  background: #fff; border: 1px solid var(--he-line); border-radius: var(--he-radius);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.he-trigger:hover { background: var(--he-bg-soft); }
.he-trigger:focus-visible { outline: 2px solid var(--he-primary); outline-offset: -2px; }
.he-field.is-open .he-trigger { background: var(--he-bg-soft); box-shadow: inset 0 -2px 0 var(--he-primary); }
.he-icon { width: 20px; height: 20px; flex: none; }
.he-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.he-label { font-size: 13px; font-weight: 600; line-height: 1.2; }
.he-value { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.he-value.is-placeholder { font-weight: 500; }

/* Destination : le champ texte est la zone cliquable */
.he-dest .he-trigger { cursor: text; }
.he-input { border: 0; padding: 0; margin: 0; width: 100%; background: transparent; font: inherit; font-size: 15px; font-weight: 600; outline: none; }
.he-input::placeholder { font-weight: 500; }
.he-clear { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; display: none; align-items: center; justify-content: center; cursor: pointer; }
.he-clear:hover { background: var(--he-line-soft); }
.he-dest.has-value .he-clear { display: inline-flex; }
.he-error { display: none; margin: 6px 4px 0; font-size: 13px; font-weight: 600; color: #B42318; }
.he-field.has-error .he-error { display: block; }
.he-field.has-error .he-trigger { box-shadow: inset 0 0 0 2px #B42318; }

.he-submit {
  width: 100%; height: 44px; padding: 0 24px; border: 0; border-radius: 10px;
  background: #f28c1e; color: #fff; font: inherit; font-size: 16px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.he-submit:hover { background: #d9740a; }
.he-submit:disabled { opacity: .7; cursor: wait; }

/* Panneaux déroulants */
.he-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 1060; display: none;
  background: #fff; border-radius: 16px; box-shadow: var(--he-shadow); border: 1px solid var(--he-line-soft);
}
.he-field.is-open > .he-panel { display: block; }
.he-panel-head { display: none; }
.he-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--he-line-soft); }
.he-panel-foot .he-summary { font-size: 14px; }
.he-panel-foot .he-summary strong { }
.he-done { min-height: 38px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--he-primary); color: #fff; font: inherit; font-weight: 500; cursor: pointer; }
.he-done:hover { background: var(--he-primary-dark); }
.he-link { border: 0; background: none; padding: 8px 4px; font: inherit; font-weight: 600; color: var(--he-primary); cursor: pointer; }
.he-link:hover { text-decoration: underline; }

/* Autocomplete */
.he-panel--dest { width: min(440px, 100%); min-width: 100%; padding: 8px 0; max-height: 420px; overflow-y: auto; }
@media (min-width: 992px) { .he-panel--dest { width: 440px; } }
.he-group { padding: 10px 16px 4px; font-size: 13px; font-weight: 600; }
.he-options { list-style: none; margin: 0; padding: 0; }
.he-option { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.he-option[aria-selected="true"], .he-option:hover { background: var(--he-primary-soft); }
.he-option-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--he-bg-soft); display: flex; align-items: center; justify-content: center; }
.he-option-icon svg { width: 18px; height: 18px; }
.he-option-main { display: flex; flex-direction: column; min-width: 0; }
.he-option-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.he-option-title mark { background: none; color: var(--he-primary-ink); font-weight: 800; padding: 0; }
.he-option-sub { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.he-status { padding: 14px 16px; font-size: 14px; }

/* Calendrier */
.he-panel--dates { padding: 16px 20px 0; width: max-content; }
.he-field--dates:not(:first-child) .he-panel--dates { left: 50%; transform: translateX(-50%); }
.he-cal-nav { position: relative; }
.he-cal-arrow { position: absolute; top: -4px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }
.he-cal-arrow:hover:not(:disabled) { background: var(--he-bg-soft); }
.he-cal-arrow:disabled { opacity: .3; cursor: default; }
.he-cal-arrow--prev { left: -8px; }
.he-cal-arrow--next { right: -8px; }
.he-months { display: flex; gap: 32px; }
.he-month { width: 296px; }
.he-month-title { text-align: center; font-weight: 600; font-size: 16px; margin: 4px 0 12px; text-transform: capitalize; }
.he-weekdays, .he-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.he-weekdays span { text-align: center; font-size: 12px; font-weight: 600; padding-bottom: 6px; }
.he-day {
  height: 42px; border: 0; background: transparent; padding: 0; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; position: relative;
}
.he-day span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 1px auto; border-radius: 50%; position: relative; z-index: 1; }
.he-day:hover:not(:disabled) span { box-shadow: inset 0 0 0 1.5px var(--he-ink); }
.he-day:disabled { color: #A7B1BD; cursor: default; text-decoration: line-through; text-decoration-color: rgba(167, 177, 189, .6); }
.he-day.is-today span { font-weight: 800; }
.he-day.is-today span::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.he-day.in-range::before { content: ""; position: absolute; inset: 1px 0; background: var(--he-primary-soft); }
.he-day.is-start::before { left: 50%; }
.he-day.is-end::before { right: 50%; }
.he-day.is-start.is-end::before { display: none; }
.he-day.is-start span, .he-day.is-end span { background: var(--he-primary); color: #fff; font-weight: 600; }
.he-cal-hint { text-align: center; font-size: 13px; padding: 4px 0 12px; }

/* Chambres & occupation */
.he-panel--guests { right: 0; left: auto; width: 380px; }
.he-rooms { max-height: 440px; overflow-y: auto; padding: 4px 20px; }
.he-room { padding: 14px 0; border-bottom: 1px solid var(--he-line-soft); }
.he-room:last-child { border-bottom: 0; }
.he-room-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.he-room-title { font-weight: 600; font-size: 15px; }
.he-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.he-row-label { display: flex; flex-direction: column; }
.he-row-label strong { font-size: 15px; font-weight: 600; }
.he-row-label small { font-size: 13px; }
.he-stepper { display: flex; align-items: center; gap: 4px; }
.he-step {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--he-line); background: #fff; color: var(--he-primary-ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.he-step svg { width: 14px; height: 14px; }
.he-step:hover:not(:disabled) { border-color: var(--he-primary); background: var(--he-primary-soft); }
.he-step:disabled { color: #A7B1BD; border-color: var(--he-line-soft); cursor: default; }
.he-count { width: 32px; text-align: center; font-weight: 600; font-size: 16px; }
.he-ages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 2px; }
.he-age label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.he-age select { width: 100%; height: 40px; padding: 0 8px; border: 1px solid var(--he-line); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
.he-age select.is-invalid { border-color: #B42318; box-shadow: 0 0 0 1px #B42318; }
.he-ages-help { grid-column: 1 / -1; font-size: 12px; }
.he-add-room { display: flex; align-items: center; gap: 8px; margin: 4px 20px 12px; }
.he-add-room svg { width: 16px; height: 16px; }

/* Liste de résultats : récapitulatif repliable sur mobile */
.he-recap { display: none; }

/* Mobile : panneaux plein écran */
@media (max-width: 991.98px) {
  .he-field.is-open > .he-panel {
    position: fixed; inset: 0; top: 0; z-index: 1080; border-radius: 0; border: 0; width: auto; max-height: none;
    display: flex; flex-direction: column; transform: none;
  }
  .he-panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--he-line-soft); flex: none; }
  .he-panel-head strong { font-size: 17px; flex: 1; text-align: center; margin-right: 44px; }
  .he-close { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .he-panel--dest .he-mobile-input { display: flex; }
  .he-panel--dest { padding: 0; }
  .he-panel--dest .he-list { flex: 1; min-height: 0; overflow-y: auto; }
  .he-panel--dates { padding: 0; }
  .he-panel--dates .he-cal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px; }
  .he-months { flex-direction: column; gap: 24px; }
  .he-month { width: 100%; }
  .he-cal-arrow { display: none; }
  .he-panel--guests .he-rooms { flex: 1; min-height: 0; max-height: none; }
  .he-panel-foot { flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 12px rgba(20, 33, 46, .06); }
  .he-done { flex: 1; min-height: 38px; max-width: 220px; }
  body.he-locked { overflow: hidden; }
  /* Panneau ouvert : l'en-tête collant (z-index 1030) et les widgets de chat flottants passaient par-dessus
     la tête (fermer) et le pied (Valider) du panneau, dont le parent crée son propre contexte d'empilement */
  body.he-locked .site-header { z-index: auto; position: static; }
  body.he-locked > [id*="whatsapp" i], body.he-locked > [class*="whatsapp" i],
  body.he-locked > [id*="wa-" i], body.he-locked > [class*="wa-" i],
  body.he-locked > [id*="chat" i], body.he-locked > [class*="chat" i] { display: none !important; }

  .he--collapsible .he-recap {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 8px 8px 16px;
    border: 1px solid var(--he-line); border-radius: 999px; background: #fff; font: inherit; text-align: left; cursor: pointer;
  }
  .he-recap-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .he-recap-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .he-recap-text span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .he-recap-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--he-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
  .he--collapsible .he-bar { display: none; margin-top: 12px; }
  .he--collapsible.is-expanded .he-bar { display: grid; }
}
.he-mobile-input { display: none; align-items: center; gap: 10px; margin: 12px 16px 4px; padding: 0 12px; height: 44px; border: 2px solid var(--he-primary); border-radius: var(--he-radius); }
.he-mobile-input .he-input { font-size: 16px; }
/* Focus : le contour du champ ouvert suffit pour la saisie ; les boutons gardent un contour visible aux couleurs du moteur.
   Sélecteurs renforcés pour primer sur les styles de focus des pages (.ht input:focus-visible…) */
.he .he-input:focus, .he .he-input:focus-visible { outline: none; box-shadow: none; }
.he .he-bar button:focus-visible, .he .he-panel button:focus-visible, .he .he-panel select:focus-visible { outline: 2px solid var(--he-primary); outline-offset: 2px; }
.he .he-bar .he-trigger:focus-visible { outline-offset: -2px; }
.he .he-trigger:focus-within { outline: 2px solid var(--he-primary); outline-offset: -2px; }
/* iOS zoome sur un champ de moins de 16 px */
@media (max-width: 767.98px) { .he-input { font-size: 16px; } }
