/* Modal Portal - Forces modals to render at page level above all components */
/* This ensures modals opened from within offcanvas or other stacking contexts display correctly */

.modal-portal-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important; /* Higher than Bootstrap offcanvas (1045) */
    pointer-events: none !important; /* Allow clicks through wrapper */
}

.modal-portal-wrapper .modal {
    pointer-events: auto !important; /* Re-enable clicks on modal itself */
}

.modal-portal-wrapper .modal-dialog {
    z-index: 10001 !important;
}

/* Modals are authored inside components that can be rendered into a nowrap context
   (e.g. the product table's `<td style="white-space: nowrap">`), and the wrapper is only
   moved to <body> after the first render. Reset inherited wrapping so the copy never runs
   off the side of the dialog, and break long unbroken strings (emails, part numbers). */
.modal-portal-wrapper .modal-content {
    white-space: normal !important;
    overflow-wrap: break-word;
}
