/**
 * iOS Safari visualViewport scroll lock
 * =====================================
 *
 * Owned here so pages that set hide_navigation (checkout, discover, listspot)
 * still receive the same VV containment without duplicating rules from
 * mobile_navigation.css.
 *
 * Class applied by: js/shared/navigation/mobile-bottom-nav-offset.js
 *
 * Short-page rubber-band (hubs): overflow-y:scroll + bounce spacer (JS).
 * Messaging shells must NOT get body scroll — that lets iOS drag the composer
 * to the top of the visual viewport on focus. They keep overflow:hidden.
 */

html.swiftspot-ios-safari.swiftspot-ios-vv-lock {
  height: 100% !important;
  max-height: none !important;
  overflow: hidden !important;
}

html.swiftspot-ios-safari.swiftspot-ios-vv-lock body {
  height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

/* Hub pages: body is the rubber-band scroll root */
html.swiftspot-ios-safari.swiftspot-ios-vv-lock
  body:not(.checkout-page):not(.host-inbox-messaging-tab):not(.my-bookings-messaging-tab):not(.discover-page):not(.chat-page) {
  overflow-y: scroll !important;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
}

/*
 * Messaging / chat shells: internal scroll only. Beat hub overflow-y:scroll so
 * focus does not body-scroll the composer to the top of the screen.
 */
html.swiftspot-ios-safari.swiftspot-ios-vv-lock
  body:is(.host-inbox-messaging-tab, .my-bookings-messaging-tab, .chat-page) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

html.swiftspot-ios-safari.swiftspot-ios-vv-lock
  body:not(.checkout-page):not(.host-inbox-messaging-tab):not(.my-bookings-messaging-tab):not(.discover-page):not(.chat-page)
  #main-content {
  flex-shrink: 0 !important;
}

html.swiftspot-ios-safari.swiftspot-ios-vv-lock #swiftspot-ios-vv-bounce-spacer {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  pointer-events: none !important;
}
