/**
 * Site-wide z-index stack for modals, sidebars, and overlay panels (all > 10000).
 * Load after bootstrap.css and main.css.
 */

/* Backdrops & dimmers */
.modal-backdrop,
.modal-backdrop.show,
.offcanvas-backdrop,
.offcanvas-backdrop.show,
.mfp-bg,
.togo-book-now-modal__backdrop,
.togo-book-now-choice-modal__backdrop,
.togo-nav-search-mobile-modal__backdrop,
.ui-widget-overlay {
  z-index: 100100 !important;
}

#togo-tour-filter-overlay,
.togo-tour-filter-overlay {
  display: none !important;
}

body.togo-filter-open #togo-tour-filter-overlay,
body.togo-filter-open .togo-tour-filter-overlay {
  display: block !important;
}

/* Sidebars & slide-in panels */
.offcanvas,
.offcanvas.show,
.offcanvas-wrapper,
.offcanvas-area,
.cart-wrapper,
.cart-area,
#togo-compare-offcanvas,
.togo-nav-search-mobile-modal {
  z-index: 100200 !important;
}

.togo-book-now-modal__panel {
  z-index: 100200 !important;
}

/* Modals & full-screen overlays */
.modal,
.modal.show,
.modal-dialog,
.togo-book-now-modal,
.togo-book-now-modal.is-open,
.tp-modal,
.tp-modal.is-open,
.mfp-wrap,
.mfp-container,
.mfp-content,
.togo-nav-search-mobile-modal__sheet,
.service-modal,
#serviceModal {
  z-index: 100300 !important;
}

/* Geo lang modal needs to be absolutely on top of everything, including chat widgets */
.geo-lang-modal {
  z-index: 2147483647 !important;
}

/* Nested layers (choice lists, compare UI, etc.) */
.togo-book-now-choice-modal,
.togo-book-now-choice-modal.is-open,
.togo-book-now-choice-modal__panel,
.compare-search-dropdown.show,
.compare-search-dropdown:not([hidden]) {
  z-index: 100400 !important;
}

/* Pickers & toasts above modals */
.flatpickr-calendar.open,
.flatpickr-calendar.static.open,
.page-buy-now .flatpickr-calendar.open,
.buy-now-room-snackbar.is-visible,
.buy-now-max-rooms-snackbar.is-visible,
.togo-compare-pill-wrap.is-visible,
#togo-compare-pill-wrap.is-visible {
  z-index: 100650 !important;
}
.togo-compare-pill-wrap,
#togo-compare-pill-wrap,
.togo-tour-details-sticky-book {
  z-index: 100500 !important;
}
#togo-mobile-app-bar,
#togo-mobile-app-bar.visible,
.togo-mobile-app-bar {
  z-index: 100480 !important;
}

/* Tour grid filters: below fixed header (10050) and app chrome */
#togo-tour-filter-overlay,
.togo-tour-filter-overlay,
body.togo-filter-open #togo-tour-filter-overlay,
body.togo-filter-open .togo-tour-filter-overlay {
  z-index: 10030 !important;
}
#togo-tour-sidebar-col,
body.togo-filter-open #togo-tour-sidebar-col {
  z-index: 10035 !important;
}
.togo-tour-filter-fab {
  z-index: 10030 !important;
}

/* Hide floating chrome while any overlay/modal is open */
body.fz-overlay-chrome-hidden #togo-compare-pill-wrap.is-visible,
body.fz-overlay-chrome-hidden .togo-compare-pill-wrap.is-visible {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 1199.98px) {
  body.fz-overlay-chrome-hidden #togo-mobile-app-bar.visible,
  body.fz-overlay-chrome-hidden .togo-mobile-app-bar.visible {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.fz-overlay-chrome-hidden.mobile-app-bar-visible {
    padding-bottom: 0 !important;
  }
  body.fz-overlay-chrome-hidden .togo-back-wrapper.togo-back-btn-show {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
