/**
 * Frontend Styles for Quote Builder Standalone Connector
 */

/* Ensure parent containers have white background - override Elementor and theme styles */
body .mqb-quote-wrapper,
.mqb-quote-wrapper,
* .mqb-quote-wrapper,
.elementor-widget .mqb-quote-wrapper,
.elementor-element .mqb-quote-wrapper,
.elementor-section .mqb-quote-wrapper,
.elementor-column .mqb-quote-wrapper,
.elementor-widget-shortcode .mqb-quote-wrapper {
    position: relative;
    width: 100%;
    margin: 20px 0;
    clear: both;
    background: #ffffff !important;
    background-color: #ffffff !important;
    padding: 0 !important;
    overflow: visible !important;
}

.mqb-quote-wrapper iframe,
.elementor-widget .mqb-quote-wrapper iframe,
.elementor-element .mqb-quote-wrapper iframe {
    border: none !important;
    display: block;
    width: 100%;
    min-height: 400px;
    background: #ffffff !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override any WordPress theme backgrounds around the wrapper */
.mqb-quote-wrapper::before,
.mqb-quote-wrapper::after {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* Override Elementor section backgrounds */
.elementor-section:has(.mqb-quote-wrapper),
.elementor-column:has(.mqb-quote-wrapper) {
    background-color: #ffffff !important;
}

/* Responsive behavior */
@media (max-width: 768px) {
    .mqb-quote-wrapper {
        margin: 15px 0;
    }
    
    .mqb-quote-wrapper iframe {
        min-height: 500px;
    }
}

/* Error message styling */
.mqb-error {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.mqb-error a {
    color: #721c24;
    text-decoration: underline;
}

/* Loading state (if needed) */
.mqb-quote-wrapper.loading {
    min-height: 400px;
    background: #ffffff !important;
    background-color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mqb-quote-wrapper.loading::before {
    content: "Loading quote form...";
    color: #666;
    font-size: 14px;
}

/* Additional Elementor-specific overrides */
.elementor-widget-shortcode .mqb-quote-wrapper,
.elementor-widget-html .mqb-quote-wrapper,
.elementor-widget-text-editor .mqb-quote-wrapper {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* Override any parent container backgrounds */
[class*="elementor"] .mqb-quote-wrapper,
[class*="elementor"] .mqb-quote-wrapper iframe {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* Ensure no grey backgrounds from WordPress or themes */
body .mqb-quote-wrapper,
.site-content .mqb-quote-wrapper,
.entry-content .mqb-quote-wrapper,
.wp-block-group .mqb-quote-wrapper {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

