/* HCH Mobile Booking Fix v1.0.0 (HWE-79). Loaded last (priority 200) on estate_property pages only. */

/* 1. Phone booking sheet must scroll. hch-cards-v2.css:719 sets max-height:none + overflow:visible on
      body.hchx-v2 #primary.listingsidebar2; on a fixed bottom sheet that pushes Guests/dates above the screen and the
      body is locked (.hchx-lock), so nothing can be reached. hch-bookbox-edit only repairs this while its own card is active. */
@media (max-width:991px){
  body.hchmbf-on.hchx-v2 .hchx #primary.listingsidebar2{
    max-height:88vh!important;max-height:88dvh!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;overscroll-behavior:contain;
    padding-bottom:env(safe-area-inset-bottom)
  }
  /* 3. "Request Quotes" popup (bootstrap modal z-index 1050) opened BEHIND the sheet (z-index 100020). */
  body.hchmbf-on.hchx-v2 .modal{z-index:100060!important}
  body.hchmbf-on.hchx-v2 .modal-backdrop{z-index:100050!important}
}

/* 2. Guest picker on touch devices. Bootstrap inserts .dropdown-backdrop (z-index 990) on touch; hch-listing-v2.css:156
      gave the list z-index 60, so every tap on "4 guests" hit the backdrop, which only closed the list. */
body.hchmbf-on #booking_guest_no_wrapper_list{z-index:1000!important}
body.hchmbf-on #booking_form_request .dropdown-backdrop{display:none!important}
body.hchmbf-on #booking_guest_no_wrapper_list li{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:rgba(0,0,0,.08);min-height:40px;box-sizing:border-box}

/* 4. Inline "please fix this" messages */
.hchmbf-msg{display:block;margin:6px 0 4px;padding:8px 12px;border-radius:8px;background:#fdecea;border:1px solid #d93025;color:#a50e0e!important;font:700 14px/1.35 "Open Sans",Roboto,Arial,sans-serif;text-align:left;scroll-margin-top:96px}
.hchmbf-msg:before{content:"\26A0\FE0E  ";font-weight:800}
.hchmbf-bad{outline:2px solid #d93025!important;outline-offset:2px;border-radius:10px;background-color:#fff6f5!important;scroll-margin-top:96px;animation:hchmbf-shake .35s ease 1}
.hchmbf-bad.hchbe-in,.hchmbf-bad.hchbe-out{outline-offset:-2px}
input.hchmbf-bad,textarea.hchmbf-bad,select.hchmbf-bad{border-color:#d93025!important;outline-offset:0}
#booking_form_request_mess.hchmbf-sum,#booking_form_request_mess_modal.hchmbf-sum{display:block!important;background:#fdecea!important;border:1px solid #d93025;color:#a50e0e!important;font-weight:700;padding:10px 12px;border-radius:8px;margin:10px 0}
@keyframes hchmbf-shake{0%,100%{transform:none}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@media (prefers-reduced-motion:reduce){.hchmbf-bad{animation:none}}
