/* V582 - app-wide mobile UI/UX consolidation. Layout-only; no business logic. */
html,body{max-width:100%;overflow-x:hidden}
img,svg,video,canvas{max-width:100%}
@media (max-width: 575.98px){
  body{font-size:14px}
  .container,.container-fluid{--bs-gutter-x:1rem}
  .card{border-radius:14px}
  .card-body{padding:12px}
  .form-control,.form-select{min-height:40px;padding-top:7px;padding-bottom:7px}
  textarea.form-control{min-height:72px}
  .btn:not(.btn-sm){min-height:40px;padding-top:7px;padding-bottom:7px}
  .table-responsive{max-width:100%;-webkit-overflow-scrolling:touch}
  .modal-dialog{margin:8px;max-width:calc(100% - 16px)}
  .modal-content{max-height:calc(100dvh - 16px);overflow:auto}
  [style*="position: sticky"],[style*="position:sticky"]{max-width:100%}

  /* Orders: keep rush payment choices on one row where three choices fit. */
  body.orders-page-v284 #liveOrdersWrap .quick-close-actions-v354{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
  body.orders-page-v284 #liveOrdersWrap .quick-close-actions-v354 .quick-close-btn-v354{grid-column:auto!important;min-width:0!important;min-height:42px!important;padding:6px 3px!important;font-size:11px!important;line-height:1.15!important}
  body.orders-page-v284 #liveOrdersWrap .quick-close-head-v354 small{display:none}
  body.orders-page-v284 #liveOrdersWrap .quick-close-v354{padding:10px!important}

  /* POS: compact destructive action; quantity minus already removes at zero. */
  .cart-mini-action-v460.remove{min-width:30px!important;width:30px!important;padding:0!important;font-size:20px!important;line-height:1!important}
  .pos-add-existing-v582{display:inline-block;color:#166534!important;text-decoration:none}
  .pos-payment-buttons-v546{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .pos-pay-btn-v546{min-width:0!important;padding-left:3px!important;padding-right:3px!important}

  /* Prevent floating connectivity/status affordances from covering bottom controls. */
  #shmsOfflineProofV573,#offlineIndicatorV566,#offlineIndicatorV568,#offlineIndicatorV579,.offline-indicator-v566,.offline-indicator-v568,.offline-indicator-v579{right:8px!important;bottom:max(88px,calc(env(safe-area-inset-bottom) + 72px))!important;max-width:40px!important;overflow:hidden}
}
@media (max-width: 339.98px){
  body.orders-page-v284 #liveOrdersWrap .quick-close-actions-v354 .quick-close-btn-v354{font-size:10px!important}
  .pos-pay-btn-v546{font-size:11px!important}
}
@media (min-width:576px) and (max-width:991.98px){
  .modal-dialog{max-width:calc(100% - 32px)}
}

/* V583 mobile marketing navigation fix.
   The off-canvas drawer/backdrop are fixed descendants of the sticky header.
   When the header is scrolled/stuck, backdrop-filter and overflow clipping can
   create a containing/clipping context that keeps the opened drawer outside
   the visible mobile viewport. Neutralize that context only while the drawer
   is open; desktop/tablet navigation and the closed header stay unchanged. */
@media (max-width: 820px) {
  body.nav-open .site-header {
    overflow: visible !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    contain: none !important;
    transform: none !important;
    filter: none !important;
    perspective: none !important;
  }

  body.nav-open .nav-links,
  body.nav-open .nav-backdrop {
    position: fixed !important;
  }

  body.nav-open .nav-links {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open .nav-backdrop {
    inset: 0 !important;
  }
}
