/**
 * Elementor Compatibility Styles
 * Prevents Elementor from overriding theme's Font Awesome icons
 * 
 * @package V4Education
 * @since 3.0.7
 */

/* ==========================================================================
   Font Awesome Icon Protection - Prevent Elementor Override
   ========================================================================== */

/* Force theme's Font Awesome to load with higher priority */
body .fas,
body .far,
body .fal,
body .fat,
body .fab,
body .fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

body .fab {
    font-family: "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 400 !important;
}

body .far {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 400 !important;
}

/* Protect menu icons from Elementor styles */
.services-menu .fas,
.services-menu .far,
.services-menu .fab,
.nav-menu .fas,
.nav-menu .far,
.nav-menu .fab,
.dropdown-submenu .fas,
.dropdown-submenu .far,
.dropdown-submenu .fab,
.footer-menu .fas,
.footer-menu .far,
.footer-menu .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

.services-menu .fab,
.nav-menu .fab,
.dropdown-submenu .fab,
.footer-menu .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Protect service cards icons */
.seo-service-icon i,
.service-icon i,
.benefit-icon i {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 900 !important;
}

/* Protect sidebar icons */
.sidebar-widget .fas,
.sidebar-widget .far,
.sidebar-widget .fab,
.quick-links-list .fas,
.contact-info-list .fas,
.contact-info-list .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
}

.sidebar-widget .fab,
.contact-info-list .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* ==========================================================================
   Elementor Widget Isolation - Prevent Theme Conflicts
   ========================================================================== */

/* Isolate Elementor widgets from theme styles */
.elementor-widget-container {
    font-family: inherit;
}

/* Don't let Elementor override theme containers */
.site-main .elementor-section,
.site-main .elementor-container,
.site-main .elementor-column {
    max-width: none;
}

/* Preserve theme's link colors */
.site-main a:not(.elementor-button):not(.elementor-widget-button a) {
    color: inherit;
}

/* ==========================================================================
   Fix Elementor Editor Mode Conflicts
   ========================================================================== */

/* Ensure icons display correctly in Elementor editor */
body.elementor-editor-active .fas,
body.elementor-editor-active .far,
body.elementor-editor-active .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

/* ==========================================================================
   Service Menu Dropdown Icons - Extra Protection
   ========================================================================== */

/* Service menu icons - all states */
.services-menu a i,
.services-menu .menu-item a i,
.services-menu .has-dropdown > a i,
.services-menu .dropdown-submenu a i,
.services-menu .dropdown-submenu .menu-item a i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    display: inline-block !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    line-height: 1 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Brand icons in menus */
.services-menu a .fab,
.services-menu .dropdown-submenu a .fab {
    font-family: "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 400 !important;
}

/* Chevron down icons in menus */
.has-dropdown > a > .fa-chevron-down,
.menu-item-has-children > a > .fa-chevron-down {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    margin-left: 8px;
    font-size: 0.85em;
    transition: transform 0.3s ease;
}

/* Chevron right icons in submenus */
.footer-menu .fa-chevron-right,
.quick-links-list .fa-chevron-right {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    margin-right: 8px;
    font-size: 0.85em;
}

/* ==========================================================================
   Social Media Icons Protection
   ========================================================================== */

.social-links a i,
.footer-social a i,
.header-social a i {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* ==========================================================================
   Contact Icons Protection
   ========================================================================== */

.contact-info .fas,
.footer-contact .fas,
.contact-phone .fas,
.contact-email .fas,
.contact-whatsapp .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

.contact-whatsapp .fab {
    font-weight: 400 !important;
}

/* ==========================================================================
   Ensure Theme Icons Load Before Elementor
   ========================================================================== */

/* Higher specificity for theme icon classes */
body:not(.elementor-editor-active) .site-main .fas,
body:not(.elementor-editor-active) .site-main .far,
body:not(.elementor-editor-active) .site-main .fab,
body:not(.elementor-editor-active) .site-header .fas,
body:not(.elementor-editor-active) .site-header .far,
body:not(.elementor-editor-active) .site-header .fab,
body:not(.elementor-editor-active) .site-footer .fas,
body:not(.elementor-editor-active) .site-footer .far,
body:not(.elementor-editor-active) .site-footer .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
}

/* ==========================================================================
   WordPress Button Icons (Don't Let Elementor Override)
   ========================================================================== */

.wp-block-button .fas,
.btn .fas,
button .fas,
a.button .fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* ==========================================================================
   Mobile Menu Icons Protection
   ========================================================================== */

.mobile-menu-toggle .fas,
.mobile-nav .fas,
.mobile-nav .far,
.mobile-nav .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

/* ==========================================================================
   Responsive Adjustments for Elementor Pages
   ========================================================================== */

@media (max-width: 1024px) {
    /* Ensure icons scale properly on tablets */
    body .fas,
    body .far,
    body .fab {
        display: inline-block;
    }
}

@media (max-width: 768px) {
    /* Ensure icons remain visible on mobile */
    body .fas,
    body .far,
    body .fab {
        display: inline-block;
        min-width: auto;
    }
}
