/* Manage product modals — Majorsoft ModalDialog; responsive on /manage/products */

.bmodal-content.manage-product-modal-dialog,
.bmodal-content:has(.manage-product-modal-shell) {
    width: min(600px, calc(100vw - 1.5rem)) !important;
    max-width: calc(100vw - 1.5rem) !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 1.5rem) !important;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.bmodal:has(.manage-product-modal-shell) {
    overflow-x: hidden;
}

.bmodal-content:has(.manage-product-modal-shell) .bmodal-header {
    flex: 0 0 auto;
    display: block;
    padding-right: 2.5rem;
}

.manage-product-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.bmodal-content:has(.manage-product-modal-shell) .bmodal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem 0.75rem;
    box-sizing: border-box;
}

.manage-product-modal-shell {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.manage-product-modal-shell .container,
.manage-product-modal-shell .container-fluid {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.manage-product-modal-shell .row {
    margin-left: 0;
    margin-right: 0;
}

.manage-product-modal-shell .row > [class*="col"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    max-width: 100%;
}

.manage-product-modal-shell .form-control,
.manage-product-modal-shell select,
.manage-product-modal-shell textarea,
.manage-product-modal-shell input[type="file"] {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .bmodal-content.manage-product-modal-dialog,
    .bmodal-content:has(.manage-product-modal-shell) {
        width: calc(100vw - 0.75rem) !important;
        max-width: calc(100vw - 0.75rem) !important;
        max-height: calc(100dvh - 0.75rem) !important;
        top: 0.375rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
    }

    .manage-product-modal-title {
        font-size: 1.05rem;
    }

    .manage-product-modal-shell .col-md-6,
    .manage-product-modal-shell .col-md-6 > .row > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .manage-product-modal-shell .row > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
