/* Global Popup Widget Styles (using JS-injected classes for cross-browser support) */
.cnc-popup-modal-wrapper .dialog-message { padding: 0 !important; width: 100% !important; max-width: 100% !important; overflow: visible !important; }
.cnc-popup-modal-wrapper .dialog-widget-content { background: transparent !important; box-shadow: none !important; margin: auto !important; overflow: visible !important; }
.cnc-popup-modal-wrapper .dialog-close-button, 
.cnc-popup-modal-wrapper .elementor-popup__close-button { display: none !important; }

.elementor-widget-oneclblf_popup, 
.elementor-widget-oneclblf_popup .elementor-widget-container { overflow: visible !important; }

/* Default Layout Widths */
.cnc-popup-modal-layout1,
.cnc-popup-modal-layout2 { max-width: 465px !important; width: 100% !important; overflow: visible !important; }
.cnc-popup-modal-layout3 { max-width: 965px !important; width: 100% !important; overflow: visible !important; }
.cnc-popup-modal-layout4 { max-width: 642px !important; width: 100% !important; overflow: visible !important; }
.cnc-popup-modal-layout5 { max-width: 1400px !important; width: 100% !important; overflow: visible !important; }
.cnc-popup-modal-layout6 { max-width: 1400px !important; width: 100% !important; overflow: visible !important; }

/* Editor Width Fallback (if dialog-widget is missing in standard page edit) */
body.elementor-editor-active .elementor-widget-oneclblf_popup:has(.cnc-popup.layout1),
body.elementor-editor-active .elementor-widget-oneclblf_popup:has(.cnc-popup.layout2) { width: 465px; max-width: 100%; margin: 0 auto; }
body.elementor-editor-active .elementor-widget-oneclblf_popup:has(.cnc-popup.layout3) { width: 965px; max-width: 100%; margin: 0 auto; }
body.elementor-editor-active .elementor-widget-oneclblf_popup:has(.cnc-popup.layout4) { width: 642px; max-width: 100%; margin: 0 auto; }
body.elementor-editor-active .elementor-widget-oneclblf_popup:has(.cnc-popup.layout5) { width: 1400px; max-width: 100%; margin: 0 auto; }
body.elementor-editor-active .elementor-widget-oneclblf_popup:has(.cnc-popup.layout6) { width: 1400px; max-width: 100%; margin: 0 auto; }

/* Global Close button styles for layouts 2-6 */
:where(.cnc-popup:not(.layout1) .cnc-popup-content) .close-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background-color: #005BC5; right: 12px; top: 12px; transition: all 0.3s ease-in-out; position: absolute; z-index: 10; cursor: pointer; }
:where(.cnc-popup:not(.layout1) .cnc-popup-content) .close-btn:hover { background-color: #02357e; }
:where(.cnc-popup:not(.layout1) .cnc-popup-content) .close-btn img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 11px; }

@media (max-width: 767px) {
    .cnc-popup-modal-wrapper .dialog-widget-content { width: 95% !important; } 
    :where(.cnc-popup:not(.layout1) .cnc-popup-content) .close-btn { width: 30px; height: 30px; top: -5px; right: -5px; } 
    :where(.cnc-popup:not(.layout1) .cnc-popup-content) .close-btn img { padding: 6px; } 
}

/* Standalone Modal Styles */
.cnc-popup-standalone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.cnc-popup-standalone-overlay.active {
    opacity: 1;
    visibility: visible;
}
.cnc-popup-standalone-overlay .elementor,
.cnc-popup-standalone-overlay .elementor-element,
.cnc-popup-standalone-overlay .elementor-widget-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.cnc-popup-standalone-overlay .cnc-popup {
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
}
.cnc-popup-standalone-overlay.active .cnc-popup {
    transform: scale(1);
}

.cnc-popup-standalone-overlay .cnc-popup.layout1 { overflow: visible !important; }

