/* HayOrder v1.1.56 – Mobile detail overlay: definitive layering fix.
   v1.1.55 CSS existed in the package but was not loaded by head(). This file is
   an additional failsafe for AJAX navigation from Übersicht -> Bestellung. */

@media (max-width:760px){
  /* Hide the persistent mobile header while an order detail is open. */
  body.ho59-detail-open > .mobile-header,
  body:has(#orders-ajax-root.ho59-modal-ready .ho124-detail:not([hidden])) > .mobile-header{
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  /* The dialog itself must own the full visual viewport, independent of the
     previous workspace page and its scroll position. */
  body #orders-ajax-root.ho-orders-156.ho59-modal-ready .ho54-detail.ho124-detail:not([hidden]){
    position:fixed!important;
    inset:0!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    transform:none!important;
    border-radius:0!important;
    z-index:10050!important;
    overflow:hidden!important;
  }

  body #orders-ajax-root.ho-orders-156 .ho124-detail .ho54-detail-header{
    position:sticky!important;
    top:0!important;
    z-index:10052!important;
  }

  body #orders-ajax-root.ho-orders-156 .ho124-detail .ho68-detail-scroll{
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }

  body #orders-ajax-root.ho-orders-156 .ho124-detail .ho68-modal-footer{
    position:sticky!important;
    bottom:0!important;
    z-index:10052!important;
  }

  /* Backdrop stays below the dialog, above the previous page. */
  body #orders-ajax-root.ho-orders-156 > .ho59-order-backdrop{
    z-index:10040!important;
  }
}
