/**
 * 1. Make the dialog container, and its child overlay spread across
 *    the entire window.
 */
.dialog-container,
.dialog-overlay {
    position: fixed; /* 1 */
    top: 0; /* 1 */
    right: 0; /* 1 */
    bottom: 0; /* 1 */
    left: 0; /* 1 */
}

/**
  * 1. Make sure the dialog container and all its descendants sits on
  *    top of the rest of the page.
  * 2. Make the dialog container a flex container to easily center the
  *    dialog.
  */
.dialog-container {
    z-index: 9999; /* 1 */
    display: flex; /* 2 */
    margin-bottom: 6em;
}

/**
  * 1. Make sure the dialog container and all its descendants are not
  *    visible and not focusable when it is hidden.
  */
.dialog-container[aria-hidden='true'] {
    display: none; /* 1 */
}

/**
  * 1. Make the overlay look like an overlay.
  */
.dialog-overlay {
    background-color: rgb(43 46 56 / 0.9); /* 1 */
    animation: fade-in 200ms both;
}

.dialog-content {
    z-index: 9999;
    overflow: auto;
    position: absolute;
    background-color: white;
    padding: 1em;
    max-width: 70%;
    width: 600px;
    height: 100dvh;
}

.dialog-content.on-left-side {
    left: 0;
    animation: fade-in 400ms 200ms both, slide-in-from-left 400ms 200ms both;
}

.dialog-content.on-right-side {
    right: 0;
    animation: fade-in 400ms 200ms both, slide-in-from-right 400ms 200ms both;
}

.dialog-content.on-bottom-side {
    bottom: 0;
    animation: fade-in 400ms 200ms both, slide-in-from-bottom 400ms 200ms both;
}

.dialog-content > .dialog-fragment {
    padding: 35px 0;
}

.dialog-content .dialog-button {
    width: 100%;
}

.dialog-title {
    text-align: center;
}

@media screen and (min-width: 700px) {
    .dialog-content {
        padding: 3em;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes slide-in-from-left {
    from {
        transform: translateX(-100%);
    }
}

@keyframes slide-in-from-right {
    from {
        transform: translateX(100%);
    }
}

@keyframes slide-in-from-bottom {
    from {
        transform: translateY(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dialog-overlay,
    .dialog-content {
        animation: none;
    }
}

.dialog-content h1 {
    margin: 0;
    font-size: 1.25em;
}

.dialog-close {
    position: absolute;
    top: 28px;
    border: 0;
    padding: 0.25em;
    background-color: transparent;
    font-size: 1.5em;
    width: 1.5em;
    height: 1.5em;
    text-align: center;
    cursor: pointer;
    transition: 0.15s;
    border-radius: 50%;
    color: red;
    z-index: 1;
}

.on-left-side > .dialog-close {
    left: 18px;
}

.on-right-side > .dialog-close,
.on-bottom-side > .dialog-close {
    right: 18px;
}

.dialog-close:hover {
    background-color: rgb(50 50 0 / 0.15);
}

@media screen and (min-width: 700px) {
    .dialog-close {
        top: 1em;
        right: 1em;
    }
}

.dialog-content > .dialog-fragment .width-container,
.dialog-content > .dialog-fragment figure {
    margin: 0;
    padding: 0;
}

.dialog-content > .dialog-fragment .add-to-quote-container {
    display: none;
}

.dialog-content > .dialog-fragment img {
    max-width: 100%;
}