/**
 * P231 — Add Traveller keyboard / visualViewport (website additive patch).
 * Does not touch Bus/Flight/Cab payment JS. Loaded after main CSS.
 * Works with --vt-visible-height / .vt-kb-open set by p231-at-keyboard.js.
 */

html {
  --vt-kb-inset: 0px;
  --vt-visible-height: 100dvh;
}

/* When keyboard open: constrain overlay + sheet to visible viewport */
html.vt-kb-open .at-overlay,
html.vt-kb-open .booking-page > .at-overlay {
  height: var(--vt-visible-height, 100dvh) !important;
  max-height: var(--vt-visible-height, 100dvh) !important;
  top: 0 !important;
  bottom: auto !important;
  box-sizing: border-box !important;
}

html.vt-kb-open .at-overlay:has(.at-modal-shell),
html.vt-kb-open .booking-page > .at-overlay:has(.at-modal-shell) {
  padding: 8px !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

html.vt-kb-open .at-sheet:has(.at-modal-shell),
html.vt-kb-open .booking-page > .at-overlay:has(.at-modal-shell) .at-sheet:has(.at-modal-shell) {
  height: auto !important;
  max-height: calc(var(--vt-visible-height, 100dvh) - 16px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

html.vt-kb-open .at-modal-shell,
html.vt-kb-open .at-sheet:has(.at-modal-shell) > .at-modal-shell {
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

html.vt-kb-open .at-modal-shell > .at-modal-shell__header {
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 3 !important;
  background: #fff !important;
}

html.vt-kb-open .at-modal-shell > .at-modal-shell__content,
html.vt-kb-open .at-modal-shell .at-modal-shell__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

html.vt-kb-open .at-modal-shell > .at-modal-shell__footer {
  flex-shrink: 0 !important;
}

html.at-modal-open,
html.at-modal-open body {
  overflow: hidden !important;
}
