/* v569 Customer responsive integrity layer.
   Public Customer ordering only. This is intentionally loaded last.
   Goal: one layout contract across phone, tablet, split view, landscape and desktop.
   No user-agent/browser/device detection. No ordering/payment logic. */

body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"]{
  --customer-gutter-v569:clamp(12px,2.4vw,28px);
  --customer-content-max-v569:1240px;
  --customer-bottom-safe-v569:env(safe-area-inset-bottom,0px);
  max-width:100%;
  overflow-x:clip!important;
}

/* Critical invariant: the fixed operating-status bar reserves its height exactly once.
   v567 set a top offset on the header globally. At phone widths the header is relative,
   which shifted it down a second time and created the production blank gap. */
@media(max-width:1279px){
  body.shop-page.has-store-status-v290[data-staff-table-order="false"][data-staff-quick-order="false"] .shop-header,
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .shop-header{
    top:auto!important;
  }
}

/* Shared purchase controls must remain legible and tappable regardless of branding. */
body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] :is(
  .mode-btn,.primary-cta,.secondary-cta,.add-btn,.customer-category-open-v494,
  .customer-menu-nav-v494 button,.reserve-link-v306,#mobile-cart-button
){
  min-height:44px!important;
  touch-action:manipulation;
}
body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] :is(
  .mode-btn,.primary-cta,.secondary-cta,.add-btn,.customer-category-open-v494,
  .customer-menu-nav-v494 button,.reserve-link-v306
){
  opacity:1!important;
  visibility:visible!important;
}

/* Media containment is an invariant, not a device-specific repair. */
body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] :is(
  .customer-category-card-v494,.premium-food-card,.food-media,.customer-category-image-v494
){
  min-width:0!important;
  max-width:100%!important;
}
body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] :is(
  .food-media,.customer-category-image-v494
){
  overflow:hidden!important;
}
body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] :is(
  .food-media img,.customer-category-image-v494 img
){
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
}

/* Phones: compact purchase header, no doubled status offset, cart always discoverable in bottom nav. */
@media(max-width:767px){
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"]{
    padding-bottom:calc(var(--v132-nav-h,76px) + var(--customer-bottom-safe-v569) + 18px)!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .shop-header{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:10px 12px!important;
    border-radius:0 0 20px 20px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"brand" "mode" "nav"!important;
    gap:8px!important;
    align-items:center!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .brand-lockup{
    grid-area:brand!important;
    width:100%!important;
    min-width:0!important;
    gap:10px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .brand-lockup img,
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .logo-mark{
    width:46px!important;height:46px!important;flex:0 0 46px!important;
    border-radius:14px!important;object-fit:contain!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .brand-lockup strong{
    font-size:20px!important;line-height:1.08!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .brand-lockup span{
    font-size:12px!important;line-height:1.2!important;
    white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
    max-width:none!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .mode-switch{
    grid-area:mode!important;
    width:100%!important;max-width:none!important;margin:0!important;padding:5px!important;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;
    overflow:hidden!important;border-radius:16px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .mode-btn{
    width:100%!important;min-width:0!important;padding:9px 8px!important;border-radius:12px!important;
    font-size:15px!important;line-height:1.1!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .customer-nav-v306{
    grid-area:nav!important;width:100%!important;min-width:0!important;margin:0!important;
    display:block!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .reserve-link-v306{
    width:100%!important;min-height:42px!important;padding:9px 12px!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    border-radius:14px!important;
  }
  /* Account actions live in the persistent bottom app navigation at phone widths. */
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .customer-header-account-v306{
    display:none!important;
  }

  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .premium-hero{
    width:calc(100% - 24px)!important;max-width:none!important;
    margin:10px 12px 14px!important;padding:24px 20px!important;
    min-height:280px!important;border-radius:24px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-copy{
    padding:0!important;min-width:0!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-copy h1{
    font-size:clamp(34px,10.5vw,44px)!important;line-height:.98!important;
    margin:14px 0 10px!important;max-width:11ch!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-copy p{
    font-size:15px!important;line-height:1.4!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-location-v306{
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin-top:12px!important;padding:9px 10px!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-location-v306__text{
    min-width:0!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-location-v306__text small{
    overflow-wrap:anywhere!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-actions{
    display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin-top:12px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-actions a{
    width:100%!important;min-width:0!important;padding:10px 8px!important;text-align:center!important;
  }

  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .customer-benefits-v212{
    width:calc(100% - 24px)!important;max-width:none!important;margin:0 12px 14px!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .benefit-v212{
    min-width:0!important;padding:9px!important;
  }

  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .shop-shell{
    width:calc(100% - 24px)!important;max-width:none!important;margin:0 12px 42px!important;padding:0!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .menu-toolbar h2{
    font-size:clamp(28px,8vw,36px)!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .customer-category-heading-v494 h3{
    font-size:clamp(26px,7.5vw,34px)!important;
  }

  /* The phone bottom nav is the single cart launcher. */
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] #mobile-cart-button{
    display:none!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .mobile-bottom-nav-v132{
    z-index:2147481900!important;
  }

  /* Keep the install affordance above app navigation instead of covering purchase controls. */
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] :is(.pwa-v321-btn,.pwa-install-toast-v244){
    bottom:calc(var(--v132-nav-h,76px) + var(--customer-bottom-safe-v569) + 12px)!important;
  }
}

/* Very narrow phone: give product actions their own row instead of squeezing price + Add. */
@media(max-width:390px){
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .premium-food-card{
    grid-template-columns:104px minmax(0,1fr)!important;
    gap:10px!important;padding:9px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .food-media{
    width:104px!important;height:118px!important;min-width:104px!important;margin:0!important;border-radius:16px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .food-info{
    padding:0!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .food-footer{
    display:grid!important;grid-template-columns:1fr!important;gap:7px!important;padding-top:8px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .add-btn{
    width:100%!important;min-width:0!important;min-height:42px!important;padding:9px 10px!important;
  }
}

/* Tablet and split view: full content width, no desktop cart reservation, persistent cart dock. */
@media(min-width:768px) and (max-width:1279px){
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .shop-shell{
    display:block!important;
    width:min(var(--customer-content-max-v569),calc(100% - (2 * var(--customer-gutter-v569))))!important;
    max-width:var(--customer-content-max-v569)!important;
    margin:0 auto 80px!important;padding:0!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .menu-column{
    width:100%!important;max-width:none!important;
  }
  body.shop-page.category-first-v496[data-staff-table-order="false"][data-staff-quick-order="false"] .customer-category-grid-v494{
    grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr))!important;
    gap:12px!important;
  }
  body.shop-page.category-first-v496.category-selected-v494[data-staff-table-order="false"][data-staff-quick-order="false"] .menu-grid,
  body.shop-page.category-first-v496.category-searching-v494[data-staff-table-order="false"][data-staff-quick-order="false"] .menu-grid{
    grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr))!important;
    gap:12px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] #mobile-cart-button.mobile-cart-button,
  body.shop-page.cart-empty-v160[data-staff-table-order="false"][data-staff-quick-order="false"] #mobile-cart-button.mobile-cart-button{
    display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
  }
}

/* Short landscape workspaces: spend vertical space on menu content, not chrome. */
@media(max-height:560px) and (min-width:600px) and (max-width:1279px){
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .shop-header{
    padding-block:7px!important;gap:6px 10px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .brand-lockup span{display:none!important}
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .premium-hero{
    min-height:220px!important;margin-top:8px!important;padding:20px!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .hero-copy h1{
    font-size:clamp(34px,5vw,48px)!important;margin:8px 0!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] .customer-benefits-v212{
    margin-bottom:10px!important;
  }
}

/* Desktop: preserve the proven inline-cart layout and sticky header behavior. */
@media(min-width:1280px){
  body.shop-page.has-store-status-v290[data-staff-table-order="false"][data-staff-quick-order="false"] .shop-header{
    position:sticky!important;
    top:var(--store-status-height-v290,0px)!important;
  }
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] #mobile-cart-button{
    display:none!important;
  }
}

@media(prefers-reduced-motion:reduce){
  body.shop-page[data-staff-table-order="false"][data-staff-quick-order="false"] *{
    transition:none!important;animation:none!important;scroll-behavior:auto!important;
  }
}
