/* RHVA V108 - final popup vertical override.
   Image on top, title/description below. Loaded last. */

/* Premium modal systems that were showing text on the side */
html body .rhva-v87-modal.is-open,
html body .rhva-v85-modal.is-open,
html body .rhva-v83-modal.is-open,
html body .rhva-v81-modal.is-open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
    overflow: auto !important;
}

/* Force side-by-side grid into vertical one-column */
html body .rhva-v87-modal.is-open .rhva-v87-dialog,
html body .rhva-v85-modal.is-open .rhva-v85-dialog,
html body .rhva-v83-modal.is-open .rhva-v83-dialog,
html body .rhva-v81-modal.is-open .rhva-v81-dialog {
    display: block !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    width: min(1040px, 94vw) !important;
    max-width: 94vw !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 92vh !important;
    overflow: auto !important;
    background: #ffffff !important;
    border-radius: 26px !important;
}

/* Image/media panel on top */
html body .rhva-v87-modal.is-open .rhva-v87-media,
html body .rhva-v85-modal.is-open .rhva-v85-media,
html body .rhva-v83-modal.is-open .rhva-v83-media,
html body .rhva-v81-modal.is-open .rhva-v81-media {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    overflow: hidden !important;
    background: #ffffff !important;
    padding: 0 !important;
}

/* Popup image full width, not side layout */
html body .rhva-v87-modal.is-open .rhva-v87-media img,
html body .rhva-v85-modal.is-open .rhva-v85-media img,
html body .rhva-v83-modal.is-open .rhva-v83-media img,
html body .rhva-v81-modal.is-open .rhva-v81-media img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 62vh !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #ffffff !important;
    border-radius: 26px 26px 0 0 !important;
}

/* Text panel below image */
html body .rhva-v87-modal.is-open .rhva-v87-body,
html body .rhva-v85-modal.is-open .rhva-v85-body,
html body .rhva-v83-modal.is-open .rhva-v83-body,
html body .rhva-v81-modal.is-open .rhva-v81-body {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 28px 34px 34px !important;
    background: #ffffff !important;
    color: #172033 !important;
    box-sizing: border-box !important;
}

/* Old rhv popup system also vertical */
html body .rhv-popup.open .rhv-popup-box {
    display: block !important;
    width: min(1040px, 94vw) !important;
    max-width: 94vw !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 92vh !important;
    overflow: auto !important;
    background: #ffffff !important;
    border-radius: 26px !important;
    margin: 4vh auto !important;
}

html body .rhv-popup.open .rhv-popup-img,
html body .rhv-popup.open .rhv-popup-img.has-img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 62vh !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #ffffff !important;
    border-radius: 26px 26px 0 0 !important;
    flex: none !important;
}

html body .rhv-popup.open .rhv-popup-text {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 28px 34px 34px !important;
    margin: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    border-radius: 0 0 26px 26px !important;
    box-sizing: border-box !important;
}

/* Clean typography */
html body .rhv-popup.open .rhv-popup-text h2,
html body .rhva-v87-modal.is-open .rhva-v87-title,
html body .rhva-v85-modal.is-open .rhva-v85-title,
html body .rhva-v83-modal.is-open .rhva-v83-title,
html body .rhva-v81-modal.is-open .rhva-v81-title {
    margin: 0 0 12px !important;
    color: #071827 !important;
    font-size: clamp(28px, 4vw, 44px) !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
}

html body .rhv-popup.open .rhv-popup-text p,
html body .rhva-v87-modal.is-open .rhva-v87-desc,
html body .rhva-v85-modal.is-open .rhva-v85-desc,
html body .rhva-v83-modal.is-open .rhva-v83-desc,
html body .rhva-v81-modal.is-open .rhva-v81-desc {
    margin: 0 !important;
    color: #445b6d !important;
    font-size: 17px !important;
    line-height: 1.75 !important;
}

/* Keep close button on top */
html body .rhv-popup.open .rhv-popup-close,
html body .rhva-v87-modal.is-open .rhva-v87-close,
html body .rhva-v85-modal.is-open .rhva-v85-close,
html body .rhva-v83-modal.is-open .rhva-v83-close,
html body .rhva-v81-modal.is-open .rhva-v81-close {
    z-index: 999999 !important;
}

/* Mobile */
@media(max-width: 768px){
    html body .rhva-v87-modal.is-open .rhva-v87-dialog,
    html body .rhva-v85-modal.is-open .rhva-v85-dialog,
    html body .rhva-v83-modal.is-open .rhva-v83-dialog,
    html body .rhva-v81-modal.is-open .rhva-v81-dialog,
    html body .rhv-popup.open .rhv-popup-box {
        width: 94vw !important;
        max-height: 90vh !important;
        border-radius: 20px !important;
    }

    html body .rhva-v87-modal.is-open .rhva-v87-media img,
    html body .rhva-v85-modal.is-open .rhva-v85-media img,
    html body .rhva-v83-modal.is-open .rhva-v83-media img,
    html body .rhva-v81-modal.is-open .rhva-v81-media img,
    html body .rhv-popup.open .rhv-popup-img,
    html body .rhv-popup.open .rhv-popup-img.has-img {
        max-height: 52vh !important;
        border-radius: 20px 20px 0 0 !important;
    }

    html body .rhva-v87-modal.is-open .rhva-v87-body,
    html body .rhva-v85-modal.is-open .rhva-v85-body,
    html body .rhva-v83-modal.is-open .rhva-v83-body,
    html body .rhva-v81-modal.is-open .rhva-v81-body,
    html body .rhv-popup.open .rhv-popup-text {
        padding: 22px 22px 26px !important;
    }
}