/* O助手 v2.6.40 — modal layering and mobile drawer scrolling.
   Only the front-end application drawer and its existing business modals are
   affected. The main navigation remains unchanged whenever dialogs close. */

@media (max-width: 720px) {
  /* The mobile tab bar had z-index:140 while the drawer was at 50 and the
     checkout at 60. Suppress its hit area for the whole modal lifecycle. */
  body.ozs-dialog-open .bottom-nav {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #drawerOverlay {
    z-index: 200;
  }

  .modal-wrap {
    z-index: 210;
    padding: calc(16px + env(safe-area-inset-top)) 16px
             calc(16px + env(safe-area-inset-bottom));
  }

  #detailDrawer {
    top: 0;
    bottom: auto;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  #detailDrawer .drawer-content {
    /* Keep the purchase text/button clear of the iPhone home indicator. */
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .modal-wrap .modal {
    max-height: calc(100dvh - 32px - env(safe-area-inset-top)
                     - env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
