/* Shared storefront contract: hidden cart container + data-storefront-cart-panel.
   The Order online selector also supports the existing compiled Holi theme. */
body { --storefront-cart-width: 24rem; }
body [data-storefront-cart] [data-storefront-cart-panel] {
  width: min(100%, var(--storefront-cart-width));
  max-width: 100vw;
}
@media (min-width: 768px) {
  /* Theme overlays must not block the page beside a non-modal cart. */
  body #malbis-cart-overlay[data-storefront-cart] { pointer-events: none; }
  body #malbis-cart-overlay[data-storefront-cart] .malbis-overlay-shade { display: none; }
  body #malbis-cart-overlay[data-storefront-cart] [data-storefront-cart-panel] { pointer-events: auto; }
  body:has([data-storefront-cart]:not([hidden])),
  body:has([role="dialog"][aria-label="Order online"]) {
    box-sizing: border-box;
    padding-right: var(--storefront-cart-width);
  }
}
@media (max-width: 767px) {
  body:has([data-storefront-cart]:not([hidden])) { overflow: hidden; }
  body [data-storefront-cart] [data-storefront-cart-panel] {
    width: 100%;
    border-radius: 0;
  }
}

/* Malbis uses viewport breakpoints; allow its content to fit the reduced page. */
@media (min-width: 768px) {
  body:has([data-storefront-cart]:not([hidden])) .mk-menu-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  }
  body:has([data-storefront-cart]:not([hidden])) .mk-nav {
    height: auto;
    min-height: 78px;
    flex-wrap: wrap;
    padding-block: 12px;
  }
  body:has([data-storefront-cart]:not([hidden])) .malbis-cart-trigger { display: none; }
  body:has([data-storefront-cart]:not([hidden])) .container { max-width: 100%; }
}
