/* =========================================================================
   Hotel Search Box — scoped under .hsb
   Every selector is namespaced so this can sit next to the Flights widget
   (and its default.css / style.css / responsive.css) without collisions.
   ========================================================================= */

.hsb {
  --hsb-blue:    #0071C2;
  --hsb-blue-dk: #00487A;
  --hsb-blue-lt: #E4F1FB;
  --hsb-text:    #262626;
  --hsb-text-2:  #6B6B6B;
  --hsb-border:  #E7E7E7;
  --hsb-transition-fast: .15s ease;
  --hsb-transition: .18s cubic-bezier(.2, .7, .3, 1);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--hsb-text);
  width: 100%;
}

.hsb *,
.hsb *::before,
.hsb *::after {
  box-sizing: border-box;
}

.hsb-bar {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  overflow: visible;
  position: relative;
}

.hsb-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-right: 1px solid var(--hsb-border);
  cursor: pointer;
  transition: background var(--hsb-transition-fast);
}
.hsb-field:hover,
.hsb-field:focus-within { background: #FAFAFA; }
.hsb-field.hsb-destination-field { flex: 1.6; min-width: 220px; }
.hsb-field.hsb-date-field { flex: 1; min-width: 150px; }
.hsb-field.hsb-guest-field { flex: 1.1; min-width: 170px; }

.hsb-field-icon {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  color: var(--hsb-blue);
  display: flex; align-items: center; justify-content: center;
}
.hsb-field-icon svg { width: 20px; height: 20px; }

.hsb-field-content { flex: 1; min-width: 0; padding: 12px 0; }

.hsb-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--hsb-text-2);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 2px;
}

.hsb #hsb-destination {
  border: none; outline: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--hsb-text);
  width: 100%; padding: 0; font-family: inherit;
}
.hsb #hsb-destination::placeholder { color: #9B9B9B; font-weight: 500; }

.hsb #hsb-checkin,
.hsb #hsb-checkout {
  border: none; outline: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--hsb-text);
  width: 100%; padding: 0; font-family: inherit; cursor: pointer;
}

.hsb-guest-trigger {
  background: none; border: none; cursor: pointer;
  padding: 0; text-align: left; width: 100%;
  font-size: 15px; font-weight: 600; color: var(--hsb-text);
  font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}
.hsb-guest-trigger .hsb-chev { width: 12px; height: 12px; color: var(--hsb-text-2); flex: 0 0 auto; }

.hsb-submit-btn {
  flex: 0 0 auto;
  background: var(--hsb-blue);
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  padding: 0 34px;
  font-size: 16px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--hsb-transition-fast);
}
.hsb-submit-btn:hover { background: var(--hsb-blue-dk); }

/* Accessible focus rings — keyboard users tabbing through the auto-advance
   chain (destination -> dates -> guests -> search) need a visible landing
   spot at every stop. Mouse/touch clicks don't get the ring (:focus-visible). */
.hsb-stepper button:focus-visible,
.hsb-guest-trigger:focus-visible,
.hsb-submit-btn:focus-visible,
.hsb-add-room:focus-visible,
.hsb-remove-room:focus-visible {
  outline: 2px solid var(--hsb-blue-dk);
  outline-offset: 2px;
}
.hsb-submit-btn svg { width: 19px; height: 19px; }

/* -------------------------------------------------------------------------
   Autosuggest dropdown & Guests dropdown
   Both stay permanently in the layout (never display:none) so toggling
   the "open" class is what animates them in/out via opacity + transform,
   instead of the old instant show/hide. That's what makes the auto-jump
   chain read as continuous motion rather than a series of jump-cuts.
   ------------------------------------------------------------------------- */
.hsb #hsb-suggestions,
.hsb-guest-dropdown {
  position: absolute;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--hsb-border);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--hsb-transition), transform var(--hsb-transition),
              visibility 0s linear var(--hsb-transition);
}
.hsb #hsb-suggestions.open,
.hsb-guest-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--hsb-transition), transform var(--hsb-transition);
}

.hsb #hsb-suggestions {
  top: calc(100% + 8px); left: 0;
  width: 360px;
  max-height: 340px; overflow-y: auto;
}

.hsb-guest-dropdown {
  top: calc(100% + 8px); right: 0;
  width: 300px;
  max-height: 420px;
  overflow-y: auto;
  padding: 18px;
  cursor: default;
}

.hsb-room-block {
  padding: 12px 0;
  border-bottom: 1px dashed var(--hsb-border);
}
.hsb-room-block:first-child { padding-top: 0; }
.hsb-room-block:last-of-type { border-bottom: none; }

.hsb-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.hsb-room-header strong {
  font-size: 12px;
  color: var(--hsb-text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hsb-remove-room {
  background: none; border: none;
  color: #C0392B;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background var(--hsb-transition-fast);
}
.hsb-remove-room:hover { background: #FBEAE9; }

.hsb-counter-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--hsb-border);
}
.hsb-room-block > .hsb-counter-row:last-of-type { border-bottom: none; }

.hsb-counter-label { display: flex; flex-direction: column; }
.hsb-counter-label strong { font-size: 14px; color: var(--hsb-text); font-weight: 600; }
.hsb-counter-label span { font-size: 12px; color: var(--hsb-text-2); }

.hsb-stepper { display: flex; align-items: center; gap: 12px; }
.hsb-stepper button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid #B0B0B0;
  background: #fff;
  color: var(--hsb-blue);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--hsb-transition-fast), border-color var(--hsb-transition-fast), transform .1s ease;
}
.hsb-stepper button:hover:not(:disabled) { border-color: var(--hsb-blue); background: var(--hsb-blue-lt); }
.hsb-stepper button:active:not(:disabled) { transform: scale(.92); }
.hsb-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.hsb-stepper span { font-weight: 600; min-width: 16px; text-align: center; font-size: 14px; }

.hsb-child-ages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}
.hsb-child-age-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--hsb-text-2);
}
.hsb-child-age-select {
  font-family: inherit;
  font-size: 13px;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--hsb-border);
  background: #fff;
  color: var(--hsb-text);
  cursor: pointer;
}

.hsb-add-room {
  width: 100%; margin-top: 6px;
  background: none;
  border: 1px dashed var(--hsb-blue);
  color: var(--hsb-blue);
  border-radius: 6px;
  padding: 9px 0;
  font-family: inherit;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  transition: background var(--hsb-transition-fast);
}
.hsb-add-room:hover:not(:disabled) { background: var(--hsb-blue-lt); }
.hsb-add-room:disabled { opacity: .4; cursor: not-allowed; }

.hsb-guest-save {
  margin-top: 14px; width: 100%;
  background: var(--hsb-blue); color: #fff;
  border: none; border-radius: 6px;
  padding: 10px 0; font-family: inherit;
  font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background var(--hsb-transition-fast);
}
.hsb-guest-save:hover { background: var(--hsb-blue-dk); }

/* -------------------------------------------------------------------------
   Mobile — bottom-sheet treatment for both dropdowns, larger tap targets
   ------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hsb-bar { flex-direction: column; border-radius: 12px; }
  .hsb-field { border-right: none; border-bottom: 1px solid var(--hsb-border); width: 100%; padding: 14px 16px; }
  .hsb-submit-btn { border-radius: 0 0 12px 12px; padding: 18px; justify-content: center; font-size: 16px; }
}

@media (max-width: 640px) {
  .hsb #hsb-suggestions,
  .hsb-guest-dropdown {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: 100%;
    max-height: 75vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 18px);
  }
  .hsb #hsb-suggestions.open,
  .hsb-guest-dropdown.open {
    transform: translateY(0);
  }

  /* Dims the page behind the sheet — makes it read as a focused modal
     instead of a panel floating over a cramped, still-interactive page. */
  body.hsb-sheet-open::after,
  body.hsb-datepicker-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 45;
  }

  .hsb-stepper button { width: 34px; height: 34px; }
  .hsb-guest-save,
  .hsb-add-room { padding: 12px 0; font-size: 14px; }
}

/* jQuery UI datepicker restyle — scoped so it doesn't touch the Flights
   panel's own bootstrap-datepicker instances */
.hsb-datepicker.ui-datepicker {
  font-family: 'Inter', sans-serif;
  background: #fff;
  border: 1px solid #E7E7E7;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  padding: 10px;
}
.hsb-datepicker .ui-datepicker-header {
  background: #0071C2; color: #fff;
  border-radius: 6px; border: none;
}
.hsb-datepicker .ui-datepicker-title { color: #fff; font-weight: 600; }
.hsb-datepicker .ui-state-default { border-radius: 5px; transition: background var(--hsb-transition-fast); }
.hsb-datepicker .ui-state-active,
.hsb-datepicker .ui-widget-content .ui-state-active {
  background: #0071C2; border-color: #0071C2; color: #fff;
}
.hsb-datepicker .ui-state-hover { background: #E4F1FB; }

/* On small screens the popup gets pinned to the center of the viewport
   (instead of jQuery UI's usual "just under the input" placement, which
   can run off-screen next to a field near the bottom of the search bar)
   and sits above the dim backdrop declared above. */
@media (max-width: 640px) {
  .hsb-datepicker.ui-datepicker {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    width: 92vw;
    max-width: 340px;
    z-index: 1000;
  }
}