/* Comportamiento compartido para los modales de Venta Central. */
.modal.in {
    align-items: center;
    display: flex !important;
    justify-content: center;
    padding: 12px !important;
}

.modal:before {
    display: none !important;
}

.modal .modal-dialog {
    display: block;
    margin: auto !important;
    min-width: 0;
    width: calc(100% - 24px) !important;
    max-width: 600px;
    vertical-align: initial;
}

.modal .modal-dialog.modal-lg {
    max-width: 1100px;
}

.modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    width: 100%;
}

.modal .modal-header,
.modal .modal-footer {
    flex: 0 0 auto;
}

.modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal .table-responsive,
.modal .dataTables_wrapper {
    max-width: 100%;
}

#pventa-modal-iframe {
    max-height: calc(100vh - 115px);
    max-height: calc(100dvh - 115px);
}

@media (max-width: 767px) {
    .modal.in {
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
        padding-left: max(8px, env(safe-area-inset-left)) !important;
        padding-right: max(8px, env(safe-area-inset-right)) !important;
        padding-top: max(8px, env(safe-area-inset-top)) !important;
    }

    .modal .modal-dialog,
    .modal .modal-dialog.modal-lg {
        max-width: none;
        width: 100% !important;
    }

    .modal .modal-content {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }

    .modal .modal-header,
    .modal .modal-body,
    .modal .modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .modal .modal-footer .btn {
        margin-bottom: 4px;
        white-space: normal;
    }

    #pventa-modal-iframe {
        max-height: calc(100vh - 100px);
        max-height: calc(100dvh - 100px);
    }
}
