/* Unknown dialog elements in older Safari have no native closed state. */
html body dialog.product-lightbox:not([open]),
html body dialog.review-dialog:not([open]),
html body dialog.buy-now-dialog:not([open]) {
    display: none;
}

/* vh precedes dvh so iPadOS versions without dynamic units retain a height. */
dialog.product-lightbox[open] {
    height: 100vh;
    height: 100dvh;
}

dialog.review-dialog[open] {
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.product-dialog-compat-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483645;
    background: rgba(19, 18, 19, .72);
    touch-action: none;
}

html body dialog.product-dialog-compat[open] {
    display: block;
    position: fixed;
    z-index: 2147483646;
    box-sizing: border-box;
}

html body dialog.product-dialog-compat.product-lightbox[open] {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

html body dialog.product-dialog-compat.buy-now-dialog[open] {
    top: 10vh;
    right: 0;
    bottom: auto;
    left: 0;
    margin: 0 auto;
    max-height: 80vh;
    overflow-y: auto;
}

html body dialog.product-dialog-compat.review-dialog[open] {
    top: 5vh;
    right: 0;
    bottom: auto;
    left: 0;
    margin: 0 auto;
    width: calc(100% - 28px);
    max-width: 520px;
}
