/* Keep native dialogs in the viewport, including when opened after scrolling. */
dialog.cart-dialog, dialog.product-dialog, dialog.checkout-dialog {
  position: fixed;
  inset: 0;
  transform: none;
}
dialog.cart-dialog { margin: 0 0 0 auto; }
dialog.product-dialog, dialog.checkout-dialog { margin: auto; }
dialog:not([open]) { display: none; }
dialog.cart-dialog[open] { display: flex; flex-direction: column; }
.cart-head { flex-shrink: 0; }
.cart-items { min-height: 0; flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  dialog.cart-dialog, dialog.product-dialog, dialog.checkout-dialog {
    inset: 0; margin: 0; width: 100%; max-width: 100%;
    height: 100vh; max-height: 100vh;
    height: 100dvh; max-height: 100dvh;
    border: 0; border-radius: 0;
  }
  dialog.cart-dialog { overflow: hidden; }
  dialog.product-dialog, dialog.checkout-dialog { overflow-y: auto; overscroll-behavior: contain; }
  .cart-summary { max-height: 55%; overflow-y: auto; }
  .cart-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .cart-summary { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .cart-head button, .cart-summary button { min-height: 44px; }
}
/* Persistent, readable payment diagnostics inside the native dialog. */
#confirmationError:not(:empty){background:#fff0f0;color:#741b24;border:2px solid #b93446;padding:16px;border-radius:12px;font-weight:600;overflow-wrap:anywhere}
#paymentOperation{display:block;box-sizing:border-box;width:100%;min-height:48px;font-size:18px;margin:12px 0}
#resultModal details{margin:16px 0}
#resultModal summary{cursor:pointer;padding:12px 0}
