/* SHIFT.gg UI repair patch — load LAST on product.html and index.html.
   Fixes checkout positioning and prevents the cart trigger from being hidden
   by common responsive/stacking rules. Does not replace brand/avatar images. */

/* Checkout: center in the visible viewport, scroll tall content. */
html body.checkout-open .checkout-modal:not([hidden]) {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  box-sizing: border-box !important;
  width: min(570px, calc(100vw - 24px)) !important;
  max-width: 570px !important;
  max-height: calc(100dvh - 24px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: 100001 !important;
}
html body.checkout-open .checkout-overlay:not([hidden]) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
}
html body .checkout-modal[hidden],
html body .checkout-overlay[hidden] { display: none !important; }

/* Keep the dynamically created cart button reachable in the nav.
   This only styles an existing button; it cannot restore a missing script. */
html body .header .nav > .cart-trigger {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
}

/* Do not modify the header logo/avatar: retain whichever image the
   site's existing JS and branding rules currently select. */

/* Product header: share home logo/avatar dimensions without replacing images. */
.header .nav > .logo { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; white-space: nowrap; text-decoration: none; }
.header .nav > .logo .blue { color: #348eff; }
.header .nav > .cart-trigger { margin-left: 8px; }
@media (max-width: 980px) { .header .nav { flex-wrap: wrap; } .header .nav > .cart-trigger { margin-left: auto; } }
