/* Overlay */
.cdp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    z-index: 2147483647;
    overflow-y: auto;
    padding: 40px 20px;
}

/* Popup Box */
.cdp-popup-content {
    position: relative;
    max-width: 1080px;
    width: 100%;
    margin: auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
}

/* Close Button */
.cdp-close {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #ffffff;
    color: #000;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 2147483647;
}

/* Prevent Divi section overflow issues */
.cdp-popup-body .et_pb_section {
    padding: 0 !important;
}

.cdp-popup-body .et_pb_row {
    width: 100% !important;
}

/* ==============================================================
   Mobile/Tablet Stack Fix For Popup Layouts
   ------------------------------------------
   Divi 5 generates its responsive flex CSS (the --flex-direction
   custom property and its breakpoint overrides) from a scan of
   the page's saved database content. Since a popup's Divi Library
   content only exists in a separate library-item post - never
   physically written into the page itself - Divi never generates
   tablet/phone rules for it. This intentionally forces popup rows
   and columns to stack below 980px, covering both the legacy
   et_pb_row/et_pb_column classes and Divi 5's newer flex classes.
============================================================== */

@media (max-width: 980px) {
    .cdp-popup-body .et_pb_row,
    .cdp-popup-body .et_flex_row {
        display: block !important;
        flex-direction: column !important;
    }
    .cdp-popup-body .et_pb_column,
    .cdp-popup-body .et_flex_column {
        width: 100% !important;
        margin-right: 0 !important;
        display: block !important;
    }
}