/* Shared customer/offer contact dialog. Keep the page and dialog shell still;
   the form is the only scroll area while there is room for its heading. */
html.customer-contact-locked,
html.customer-contact-locked body {
    overscroll-behavior: none;
}

body #modal-contact-form.customer-contact-stable {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body #modal-contact-form.customer-contact-stable .modal-dialog {
    height: calc(100% - 48px);
    max-height: calc(100% - 48px);
    display: flex;
    align-items: flex-start;
    transform: none !important;
    transition: none !important;
}

body #modal-contact-form.customer-contact-stable .modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    max-height: 100% !important;
    overflow: hidden;
}

body #modal-contact-form.customer-contact-stable .modal-header {
    flex: 0 0 auto;
}

body #modal-contact-form.customer-contact-stable #PanelForm {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
    scrollbar-gutter: stable;
}

/* The shared viewport controller chooses this when the keyboard or a long
   translated heading leaves too little form space. Keep every control reachable
   in one scroll area without making the overlay itself scroll. */
body #modal-contact-form.customer-contact-stable.portal-dialog-natural-scroll .modal-content {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

body #modal-contact-form.customer-contact-stable.portal-dialog-natural-scroll #PanelForm {
    overflow: visible;
    scrollbar-gutter: auto;
}

@media (max-width: 767px), (max-height: 500px) {
    body #modal-contact-form.customer-contact-stable .modal-dialog {
        height: calc(100% - 16px);
        max-height: calc(100% - 16px);
        margin-top: 8px;
        margin-bottom: 8px;
    }
}
