/* ============================================================
   VTI Common — elements any page can use.
   ============================================================ */

/* Section: contact popup (MKT comment REQ-WEB-001 / REQ-WEB-012). A <dialog> holding
   the Contact Us form section; that section keeps its own look, only its outer
   page spacing (section padding, page gutter) is dropped inside the popup. */
.vti-common-popup {
    width: min(1440px, calc(100vw - 48px));
    max-width: none;
    max-height: calc(100dvh - 48px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: inherit;
}

.vti-common-popup::backdrop {
    background: rgba(0, 0, 0, .5);
}

.vti-common-popup__body {
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.vti-common-popup .vti-contact-us-form {
    padding: 0;
}

/* Beats the Contact Us mobile gutter (.vti-contact-us-form .vti-contact-us__wrap)
   whatever order the two stylesheets load in. */
.vti-common-popup .vti-contact-us-form .vti-contact-us__wrap {
    width: 100%;
}

/* Flatsome styles bare buttons (uppercase, margin, min-height). */
.vti-common-popup .vti-common-popup__close {
    position: absolute;
    z-index: 2;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .8);
    box-shadow: none;
    cursor: pointer;
    transition: background-color 100ms linear;
}

.vti-common-popup .vti-common-popup__close img {
    display: block;
    width: 24px;
    height: 24px;
}

.vti-common-popup .vti-common-popup__close:focus-visible {
    outline: 2px solid #0c5ed9;
    outline-offset: 2px;
}

@media (hover: hover) {
    .vti-common-popup .vti-common-popup__close:hover {
        background: #fff;
    }
}

/* The page behind does not scroll while the popup is open (js/vti-common.js). */
html.vti-common-popup-open {
    overflow: hidden;
}

/* UX Builder: a block in the content flow, edited in place. */
.vti-common-popup--inline {
    position: relative;
    display: block;
    width: min(1440px, calc(100% - 48px));
    max-height: none;
    margin: 40px auto;
    overflow: visible;
}

.vti-common-popup--inline .vti-common-popup__body {
    max-height: none;
    overflow: visible;
}

@media (max-width: 699px) {
    .vti-common-popup:not(.vti-common-popup--inline) {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }

    .vti-common-popup:not(.vti-common-popup--inline) .vti-common-popup__body {
        max-height: 100dvh;
    }

    /* padding-top: room for the close button (12 + 40 + 12) above the title. */
    .vti-common-popup:not(.vti-common-popup--inline) .vti-contact-us-form__box {
        min-height: 100dvh;
        padding-top: 64px;
        border-radius: 0;
    }

    .vti-common-popup .vti-common-popup__close {
        top: 12px;
        right: 12px;
    }
}
