
/* v446 - FIX REAL: el modal sí abre en PC y mobile.
   El CSS v443 ocultaba .modal con display:none y solo mostraba .open/[aria-hidden=false],
   pero el JS original agrega .show. Esta capa unifica ambos estados. */
html body #modalBackdrop.show,
html body .modal-backdrop.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

html body #productModal.show,
html body #productModal.open,
html body #productModal[aria-hidden="false"],
html body .modal.show {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10000 !important;
}

html body #productModal.show .modal-card,
html body #productModal.open .modal-card,
html body #productModal[aria-hidden="false"] .modal-card {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

/* PC: Empanadas con modal grande, pero sin tapar el footer */
@media (min-width: 761px) {
  html body #productModal[data-type="empanadas"] {
    padding: 16px !important;
  }

  html body #productModal[data-type="empanadas"] .modal-card {
    width: min(900px, calc(100vw - 48px)) !important;
    height: min(92dvh, 820px) !important;
    max-height: min(92dvh, 820px) !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
  }

  html body #productModal[data-type="empanadas"] .modal-body {
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 16px 18px 22px !important;
  }

  html body #productModal[data-type="empanadas"] .modal-foot {
    position: relative !important;
    z-index: 2 !important;
    flex-shrink: 0 !important;
  }

  html body #productModal[data-type="empanadas"] .emp-grid {
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Mobile: conserva el comportamiento tipo app */
@media (max-width: 760px) {
  html body #productModal[data-type="empanadas"] {
    padding: 0 !important;
    align-items: stretch !important;
  }

  html body #productModal[data-type="empanadas"] .modal-card {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
  }

  html body #productModal[data-type="empanadas"] .modal-body {
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-bottom: 18px !important;
  }

  html body #productModal[data-type="empanadas"] .modal-foot {
    position: relative !important;
    z-index: 5 !important;
  }
}
