<?php
/**
 * Commercial Cleaning functions and definitions
 *
 * @package commercial_cleaning
 * @since 1.0
 */

if ( ! defined( 'COMMERCIAL_CLEANING_VERSION' ) ) {
	// Replace the version number of the theme on each release.
	define( 'COMMERCIAL_CLEANING_VERSION', wp_get_theme()->get( 'Version' ) );
}

if ( ! function_exists( 'commercial_cleaning_support' ) ) :
	function commercial_cleaning_support() {

		load_theme_textdomain( 'commercial-cleaning', get_template_directory() . '/languages' );

		add_theme_support( 'custom-background', apply_filters( 'commercial_cleaning_custom_background', array(
            'default-color' => 'ffffff',
            'default-image' => '',
        )));

		// Add support for block styles.
		add_theme_support( 'wp-block-styles' );

		add_theme_support('woocommerce');

		// Enqueue editor styles.
		add_editor_style(get_stylesheet_directory_uri() . '/assets/css/editor-style.css');
	}
endif;

add_action( 'after_setup_theme', 'commercial_cleaning_support' );

if ( ! function_exists( 'commercial_cleaning_styles' ) ) :
	function commercial_cleaning_styles() {
		// Register theme stylesheet.
		$commercial_cleaning_theme_version = wp_get_theme()->get( 'Version' );

		$COMMERCIAL_CLEANING_VERSION_string = is_string( $commercial_cleaning_theme_version ) ? $commercial_cleaning_theme_version : false;
		wp_enqueue_style(
			'commercial-cleaning-style',
			get_template_directory_uri() . '/style.css',
			array(),
			$COMMERCIAL_CLEANING_VERSION_string
		);

		wp_style_add_data('commercial-cleaning', 'style-rtl', 'replace');

		wp_enqueue_style( 'dashicons' );

		wp_enqueue_style( 'animate-css', esc_url(get_template_directory_uri()).'/assets/css/animate.css' );

		wp_enqueue_script( 'jquery-wow', esc_url(get_template_directory_uri()) . '/assets/js/wow.js', array('jquery') );
	    
		 //font-awesome
		 wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/inc/fontawesome/css/all.css'
		 	, array(), '6.7.0' );

		 wp_enqueue_style( 'owl.carousel-style', get_template_directory_uri().'/assets/css/owl.carousel.css', array(), COMMERCIAL_CLEANING_VERSION );
		wp_enqueue_script( 'owl.carousel-js', get_template_directory_uri(). '/assets/js/owl.carousel.js', array('jquery') ,COMMERCIAL_CLEANING_VERSION,true);

		 wp_enqueue_script('commercial-cleaning-custom-scripts', get_template_directory_uri() . '/assets/js/custom-script.js',  array('jquery'),'' ,true );
	}
endif;

add_action( 'wp_enqueue_scripts', 'commercial_cleaning_styles' );

// Add block patterns
require get_template_directory() . '/inc/block-patterns.php';

// Add block styles
require get_template_directory() . '/inc/block-styles.php';

// Block Filters
require get_template_directory() . '/inc/block-filters.php';

// Svg icons
require get_template_directory() . '/inc/icon-function.php';

// TGM
require get_template_directory() . '/inc/TGM/tgm.php';