/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* Add your custom styles here */


/* ==========================
   PERSIAN FONT (IRANSansX)
   ========================== */
@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/woff2/IRANSansXFaNum-Regular.woff2') format('woff2'),
       url('fonts/woff/IRANSansXFaNum-Regular.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 700;
  src: url('fonts/woff2/IRANSansXFaNum-Bold.woff2') format('woff2'),
       url('fonts/woff/IRANSansXFaNum-Bold.woff') format('woff');
  font-display: swap;
}


/* ==========================
   GLOBAL TYPOGRAPHY
   ========================== */
body,
button,
input,
select,
textarea {
  font-family: "IRANSansX", sans-serif !important;
  font-weight: 400;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.heading-font,
.alt-font,
.nav > li > a {
  font-family: "IRANSansX", sans-serif !important;
  font-weight: 700;
}


/* ==========================
   GENERAL FONTS (NO LANGUAGE DEPENDENCY)
   ========================== */

body {
  font-family: "IRANSansX", sans-serif !important;
}

html {
  font-feature-settings: "ss01";
}


/* لیبل‌ها */
.woocommerce form .form-row label,
#customer_details label,
.woocommerce-billing-fields__field-wrapper p label {
    font-family: "IRANSansX" !important;
    font-weight: 400;
}

/* توضیحات فیلد */
.woocommerce .woocommerce-input-wrapper span,
.woocommerce .woocommerce-input-wrapper small {
    font-family: "IRANSansX" !important;
}

/* عنوان‌های بلوک */
.woocommerce-billing-fields h3,
#order_review_heading,
.woocommerce-additional-fields h3 {
    font-family: "IRANSansX" !important;
}

/* جدول سفارش */
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    font-family: "IRANSansX" !important;
}

/* Placeholder داخل فیلدها */
.woocommerce input::placeholder {
    font-family: "IRANSansX" !important;
}

/* ===============================
   LiteSpeed Lazy Load Fade-in
   Scoped for Hello Elementor
   =============================== */

/* Before lazy load */
.elementor .elementor-widget-image img[data-lazyloaded],
.elementor .elementor-widget-theme-post-content img[data-lazyloaded] {
    opacity: 0;
}

/* After lazy load */
.elementor .elementor-widget-image img.litespeed-loaded,
.elementor .elementor-widget-theme-post-content img.litespeed-loaded {
    opacity: 1;
    transition: opacity 0.5s ease-in-out 0.15s;
}


/*غیرفعال کردن Gravatar (جلوگیری از timeout)*/
add_filter( 'get_avatar', '__return_false' );



/*این کد باعث می‌شود Elementor در ادمین فونت گوگل لود نکند.
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
*/

/*جلوگیری از درخواست‌های خارجی در پیشخوان Elementor
add_action('admin_init', function() {
    remove_action('admin_init', array('Elementor\Tracker', 'send_tracking_data'));
});
*/
/*جلوگیری از بارگذاری فونت‌ها در پیشخوان
add_action('admin_enqueue_scripts', function() {
    wp_dequeue_style('elementor-google-fonts');
});

*/
/*
add_action('admin_enqueue_scripts', function () {

    // remove google fonts loaded by elementor
    wp_dequeue_style('elementor-icons');
    wp_dequeue_style('elementor-frontend');
    wp_dequeue_style('elementor-editor');

    // remove roboto font
    wp_deregister_style('elementor-google-fonts');
    wp_dequeue_style('elementor-google-fonts');

}, 100);

add_filter( 'elementor/editor/localize_settings', function( $settings ) {
    $settings['googleFonts'] = [];
    return $settings;
});



add_filter('style_loader_src', function($href){
    if (strpos($href, 'fonts.googleapis.com') !== false) {
        return false;
    }
    return $href;
});


add_action('admin_print_styles', function () {

    global $wp_styles;

    if (empty($wp_styles->registered)) {
        return;
    }

    foreach ($wp_styles->registered as $handle => $style) {
        if (isset($style->src) && strpos($style->src, 'fonts.googleapis.com') !== false) {
            wp_dequeue_style($handle);
            wp_deregister_style($handle);
        }
    }

}, 999);

*/