/*
 * Scoped only to the existing Doctor Now patient modal.
 * No form, AJAX, autocomplete, matching, or dashboard selectors are changed.
 */

#doctorRequestModal {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    overflow: hidden !important;
    overscroll-behavior: none;
    z-index: 999999 !important;
}

#doctorRequestModal .modal-content {
    position: relative !important;
    box-sizing: border-box !important;
    width: min(100%, 760px) !important;
    max-width: 760px !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding-top: max(20px, env(safe-area-inset-top)) !important;
    padding-right: max(20px, env(safe-area-inset-right)) !important;
    padding-bottom: max(28px, env(safe-area-inset-bottom)) !important;
    padding-left: max(20px, env(safe-area-inset-left)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
    scroll-behavior: auto !important;
}

html.mdn-doctor-now-modal-open,
body.mdn-doctor-now-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

#doctorRequestModal input,
#doctorRequestModal select,
#doctorRequestModal textarea,
#doctorRequestModal button {
    touch-action: manipulation;
}

@media screen and (min-width: 769px) {
    #doctorRequestModal {
        padding: 24px !important;
    }

    #doctorRequestModal .modal-content {
        height: calc(100vh - 48px) !important;
        height: calc(100dvh - 48px) !important;
        max-height: calc(100vh - 48px) !important;
        max-height: calc(100dvh - 48px) !important;
        border-radius: 8px !important;
    }
}


/*
 * Google Places appends its dropdown directly to <body>. It must sit above
 * the fixed Doctor Now modal or suggestions appear to be missing.
 */
body.mdn-doctor-now-modal-open .pac-container {
    z-index: 1000001 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

body.mdn-doctor-now-modal-open .pac-item {
    pointer-events: auto !important;
    cursor: pointer;
}
