/**
 * Elementor Compatibility Styles
 *
 * Ensures proper integration between Elementor and theme styles
 *
 * @package Clean_Theme
 * @since 1.0.0
 */

/* ===================================
   Elementor Page General Styles
   =================================== */

/* Remove default padding/margins on Elementor pages */
.elementor-page-content .entry-content {
    max-width: none;
    padding: 0;
    margin: 0;
}

.elementor-page #maincontent,
.elementor-page .content-area {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* Full-width template adjustments */
.elementor-full-width .entry-content {
    max-width: none;
}

/* Canvas template - completely blank */
body.elementor-canvas {
    margin: 0;
    padding: 0;
}

.elementor-canvas #page-content {
    padding: 0;
    margin: 0;
}

/* ===================================
   Bootstrap & Elementor Compatibility
   =================================== */

/* Prevent Bootstrap from affecting Elementor columns */
.elementor-page .elementor-column,
.elementor-page .elementor-row {
    box-sizing: border-box;
}

/* Reset Bootstrap grid interference */
.elementor-section .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.elementor-section .row {
    margin: 0;
}

/* Fix Bootstrap button conflicts */
.elementor-button {
    border: none;
    outline: none;
}

/* Ensure Elementor container widths work properly */
.elementor-section.elementor-section-boxed > .elementor-container {
    max-width: 1200px;
    margin: 0 auto;
}

.elementor-section.elementor-section-full_width > .elementor-container {
    max-width: 100%;
}

/* ===================================
   Typography Resets for Elementor
   =================================== */

/* Let Elementor manage headings on Elementor pages */
.elementor-widget-heading h1,
.elementor-widget-heading h2,
.elementor-widget-heading h3,
.elementor-widget-heading h4,
.elementor-widget-heading h5,
.elementor-widget-heading h6 {
    font-family: inherit;
    margin: 0;
    padding: 0;
}

/* Reset paragraph margins inside Elementor widgets */
.elementor-widget-text-editor p {
    margin-bottom: 1em;
}

.elementor-widget-text-editor p:last-child {
    margin-bottom: 0;
}

/* ===================================
   Spacing & Layout Fixes
   =================================== */

/* Remove theme wrapper padding on Elementor pages */
.elementor-page .wrapper,
.elementor-page .site-main {
    padding-left: 0;
    padding-right: 0;
}

/* Ensure sections span full width */
.elementor-page .elementor-section {
    width: 100%;
}

/* Remove extra spacing from article tags */
.elementor-page article {
    margin: 0;
}

/* ===================================
   Header/Footer Adjustments
   =================================== */

/* Adjust spacing when using theme header with Elementor */
.elementor-full-width .site-main {
    padding-top: 0;
}

/* Make sure header doesn't overlap Elementor content */
body:not(.elementor-canvas) .elementor-page .site-main {
    margin-top: 0;
}

/* ===================================
   Widget Specific Fixes
   =================================== */

/* Fix image widget */
.elementor-widget-image img {
    max-width: 100%;
    height: auto;
}

/* Fix video widget */
.elementor-widget-video {
    overflow: hidden;
}

/* Fix form widgets */
.elementor-field-group {
    margin-bottom: 1rem;
}

/* ===================================
   Responsive Adjustments
   =================================== */

@media (max-width: 1024px) {
    .elementor-section.elementor-section-boxed > .elementor-container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 767px) {
    /* Stack columns on mobile */
    .elementor-column {
        width: 100% !important;
    }

    /* Reduce section padding on mobile */
    .elementor-section {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ===================================
   Editor Fixes
   =================================== */

/* Ensure proper display in Elementor editor */
.elementor-editor-active .site-header {
    position: relative;
}

/* Hide theme elements in canvas mode preview */
body.elementor-editor-preview.elementor-template-canvas #header,
body.elementor-editor-preview.elementor-template-canvas footer {
    display: none;
}

/* ===================================
   Performance Optimizations
   =================================== */

/* Improve rendering performance */
.elementor-section {
    will-change: auto;
}

.elementor-widget {
    backface-visibility: hidden;
}

/* ===================================
   Custom Theme Integration
   =================================== */

/* Match theme color scheme */
.elementor-page a {
    color: inherit;
    text-decoration: none;
}

/* Preserve theme button styles on non-Elementor buttons */
.elementor-page .btn:not(.elementor-button) {
    /* Keep theme button styles */
}

/* Match scrollbar styling if theme has custom scrollbars */
.elementor-page ::-webkit-scrollbar {
    /* Add if needed */
}
