<?php
/**
 * Prime Beauty Salon functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package Prime Beauty Salon
 */

if ( ! defined( 'PRIME_BEAUTY_SALON_URL' ) ) {
    define( 'PRIME_BEAUTY_SALON_URL', esc_url( 'https://www.themeignite.com/products/salon-wordpress-theme', 'prime-beauty-salon') );
}
if ( ! defined( 'PRIME_BEAUTY_SALON_FREE_DOC_URL' ) ) {
    define( 'PRIME_BEAUTY_SALON_FREE_DOC_URL', esc_url( 'https://demo.themeignite.com/documentation/prime-beauty-salon-free', 'prime-beauty-salon') );
}
if ( ! defined( 'PRIME_BEAUTY_SALON_PRO_DOC_URL' ) ) {
    define( 'PRIME_BEAUTY_SALON_PRO_DOC_URL', esc_url( 'https://demo.themeignite.com/documentation/prime-beauty-salon-pro/', 'prime-beauty-salon') );
}
if ( ! defined( 'PRIME_BEAUTY_SALON_DEMO_URL' ) ) {
    define( 'PRIME_BEAUTY_SALON_DEMO_URL', esc_url( 'https://demo.themeignite.com/prime-beauty-salon/', 'prime-beauty-salon') );
}
if ( ! defined( 'PRIME_BEAUTY_SALON_REVIEW_URL' ) ) {
    define( 'PRIME_BEAUTY_SALON_REVIEW_URL', esc_url( 'https://wordpress.org/support/theme/prime-beauty-salon/reviews/#new-post', 'prime-beauty-salon') );
}
if ( ! defined( 'PRIME_BEAUTY_SALON_SUPPORT_URL' ) ) {
    define( 'PRIME_BEAUTY_SALON_SUPPORT_URL', esc_url( 'https://wordpress.org/support/theme/prime-beauty-salon', 'prime-beauty-salon') );
}
if ( ! defined( 'PRIME_BEAUTY_SALON_BUNDLE_URL' ) ) {
    define( 'PRIME_BEAUTY_SALON_BUNDLE_URL', esc_url( 'https://www.themeignite.com/products/wp-theme-bundle', 'prime-beauty-salon') );
}

$prime_beauty_salon_theme_data = wp_get_theme();
if( ! defined( 'PRIME_BEAUTY_SALON_THEME_VERSION' ) ) define ( 'PRIME_BEAUTY_SALON_THEME_VERSION', $prime_beauty_salon_theme_data->get( 'Version' ) );
if( ! defined( 'PRIME_BEAUTY_SALON_THEME_NAME' ) ) define( 'PRIME_BEAUTY_SALON_THEME_NAME', $prime_beauty_salon_theme_data->get( 'Name' ) );
if( ! defined( 'PRIME_BEAUTY_SALON_THEME_TEXTDOMAIN' ) ) define( 'PRIME_BEAUTY_SALON_THEME_TEXTDOMAIN', $prime_beauty_salon_theme_data->get( 'TextDomain' ) );

if ( ! function_exists( 'prime_beauty_salon_setup' ) ) :
/**
 * Sets up theme defaults and registers support for various WordPress features.
 *
 * Note that this function is hooked into the after_setup_theme hook, which
 * runs before the init hook. The init hook is too late for some features, such
 * as indicating support for post thumbnails.
 */
function prime_beauty_salon_setup() {
	/*
	 * Make theme available for translation.
	 * Translations can be filed in the /languages/ directory.
	 * If you're building a theme based on Prime Beauty Salon, use a find and replace
	 * to change 'prime-beauty-salon' to the name of your theme in all the template files.
	 */
	load_theme_textdomain( 'prime-beauty-salon', get_template_directory() . '/languages' );

	// Add default posts and comments RSS feed links to head.
	add_theme_support( 'automatic-feed-links' );

	/*
	 * Let WordPress manage the document title.
	 * By adding theme support, we declare that this theme does not use a
	 * hard-coded <title> tag in the document head, and expect WordPress to
	 * provide it for us.
	 */
	add_theme_support( 'title-tag' );

	/*
	 * Enable support for Post Thumbnails on posts and pages.
	 *
	 * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
	 */
	add_theme_support( 'post-thumbnails' );
	
	// This theme uses wp_nav_menu() in one location.
	register_nav_menus( array(
		'primary' => esc_html__( 'Primary', 'prime-beauty-salon' ),
	) );

	// Enable support for custom logo.
	add_theme_support( 'custom-logo' , array(
		'height'		=>45,	
		'width'			=>45,	
		'flex-height'	=>true,	
		'flex-width'	=>true,
	));

	/*
	 * Switch default core markup for search form, comment form, and comments
	 * to output valid HTML5.
	 */
	add_theme_support( 'html5', array(
		'comment-form',
		'comment-list',
		'gallery',
		'caption',
	) );

	// Set up the WordPress core custom background feature.
	add_theme_support( 'custom-background', apply_filters( 'prime_beauty_salon_custom_background_args', array(
		'default-color' => 'fff',
		'default-image' => '',
	) ) );

	// Add theme support for selective refresh for widgets.
	add_theme_support( 'customize-selective-refresh-widgets' );

	/*
	* This theme styles the visual editor to resemble the theme style,
	* specifically font, colors, icons, and column width.
	*/
	$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
	add_editor_style( array( '/assets/css/editor-style' . $min . '.css', prime_beauty_salon_fonts_url() ) );

	// Gutenberg support
	add_theme_support( 'editor-color-palette', array(
       	array(
			'name' => esc_html__( 'Tan', 'prime-beauty-salon' ),
			'slug' => 'tan',
			'color' => '#E6DBAD',
       	),
       	array(
           	'name' => esc_html__( 'Yellow', 'prime-beauty-salon' ),
           	'slug' => 'yellow',
           	'color' => '#FDE64B',
       	),
       	array(
           	'name' => esc_html__( 'Orange', 'prime-beauty-salon' ),
           	'slug' => 'orange',
           	'color' => '#ED7014',
       	),
       	array(
           	'name' => esc_html__( 'Red', 'prime-beauty-salon' ),
           	'slug' => 'red',
           	'color' => '#D0312D',
       	),
       	array(
           	'name' => esc_html__( 'Pink', 'prime-beauty-salon' ),
           	'slug' => 'pink',
           	'color' => '#b565a7',
       	),
       	array(
           	'name' => esc_html__( 'Purple', 'prime-beauty-salon' ),
           	'slug' => 'purple',
           	'color' => '#A32CC4',
       	),
       	array(
           	'name' => esc_html__( 'Blue', 'prime-beauty-salon' ),
           	'slug' => 'blue',
           	'color' => '#3A43BA',
       	),
       	array(
           	'name' => esc_html__( 'Green', 'prime-beauty-salon' ),
           	'slug' => 'green',
           	'color' => '#3BB143',
       	),
       	array(
           	'name' => esc_html__( 'Brown', 'prime-beauty-salon' ),
           	'slug' => 'brown',
           	'color' => '#231709',
       	),
       	array(
           	'name' => esc_html__( 'Grey', 'prime-beauty-salon' ),
           	'slug' => 'grey',
           	'color' => '#6C626D',
       	),
       	array(
           	'name' => esc_html__( 'Black', 'prime-beauty-salon' ),
           	'slug' => 'black',
           	'color' => '#000000',
       	),
   	));

	add_theme_support( 'align-wide' );
	add_theme_support( 'editor-font-sizes', array(
	   	array(
	       	'name' => esc_html__( 'small', 'prime-beauty-salon' ),
	       	'shortName' => esc_html__( 'S', 'prime-beauty-salon' ),
	       	'size' => 12,
	       	'slug' => 'small'
	   	),
	   	array(
	       	'name' => esc_html__( 'regular', 'prime-beauty-salon' ),
	       	'shortName' => esc_html__( 'M', 'prime-beauty-salon' ),
	       	'size' => 16,
	       	'slug' => 'regular'
	   	),
	   	array(
	       	'name' => esc_html__( 'larger', 'prime-beauty-salon' ),
	       	'shortName' => esc_html__( 'L', 'prime-beauty-salon' ),
	       	'size' => 36,
	       	'slug' => 'larger'
	   	),
	   	array(
	       	'name' => esc_html__( 'huge', 'prime-beauty-salon' ),
	       	'shortName' => esc_html__( 'XL', 'prime-beauty-salon' ),
	       	'size' => 48,
	       	'slug' => 'huge'
	   	)
	));
	add_theme_support('editor-styles');
	add_theme_support( 'wp-block-styles' );
	add_theme_support( 'woocommerce' );
	add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-slider' );
    add_theme_support( 'responsive-embeds' );
}
endif;
add_action( 'after_setup_theme', 'prime_beauty_salon_setup' );

/**
 * Set the content width in pixels, based on the theme's design and stylesheet.
 *
 * Priority 0 to make it available to lower priority callbacks.
 *
 * @global int $content_width
 */
function prime_beauty_salon_content_width() {
	$GLOBALS['content_width'] = apply_filters( 'prime_beauty_salon_content_width', 640 );
}
add_action( 'after_setup_theme', 'prime_beauty_salon_content_width', 0 );

/**
 * Register widget area.
 *
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
 */
function prime_beauty_salon_widgets_init() {
	register_sidebar( array(
		'name'          => esc_html__( 'Sidebar Option', 'prime-beauty-salon' ),
		'id'            => 'right-sidebar',
		'description'   => '',
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
	register_sidebar( array(
		'name'          => esc_html__( 'Sidebar Two', 'prime-beauty-salon' ),
		'id'            => 'sidebar-2',
		'description'   => '',
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
	register_sidebar( array(
		'name'          => esc_html__( 'Sidebar Three', 'prime-beauty-salon' ),
		'id'            => 'sidebar-3',
		'description'   => '',
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
		register_sidebar( array(
		'name'          => esc_html__( 'Footer 1', 'prime-beauty-salon' ),
		'id'            => 'footer-1',
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
	register_sidebar( array(
		'name'          => esc_html__( 'Footer 2', 'prime-beauty-salon' ),
		'id'            => 'footer-2',
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
	register_sidebar( array(
		'name'          => esc_html__( 'Footer 3', 'prime-beauty-salon' ),
		'id'            => 'footer-3',
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
	register_sidebar( array(
		'name'          => esc_html__( 'Footer 4', 'prime-beauty-salon' ),
		'id'            => 'footer-4',
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
		'before_title'  => '<h2 class="widget-title">',
		'after_title'   => '</h2>',
	) );
}
add_action( 'widgets_init', 'prime_beauty_salon_widgets_init' );

/**
 * Register custom fonts.
 */
function prime_beauty_salon_fonts_url() {
	$prime_beauty_salon_font_family   = array(
		'Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900',		
	);
	
	$prime_beauty_salon_fonts_url = add_query_arg( array(
		'family' => implode( '&family=', $prime_beauty_salon_font_family ),
		'display' => 'swap',
	), 'https://fonts.googleapis.com/css2' );

	$contents = wptt_get_webfont_url( esc_url_raw( $prime_beauty_salon_fonts_url ) );
	return $contents;
}

/**
 * Enqueue scripts and styles.
 */
function prime_beauty_salon_scripts() {
	$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
	$prime_beauty_salon_fonts_url = prime_beauty_salon_fonts_url();
	$primary_color = prime_beauty_salon_get_option( 'primary_color' );
	if ( ! empty( $prime_beauty_salon_fonts_url ) ) {
		wp_enqueue_style( 'prime-beauty-salon-google-fonts', $prime_beauty_salon_fonts_url, array(), null );
	}

	wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/assets/css/bootstrap.css' );
	
	wp_enqueue_style( 'fontawesome-all', get_template_directory_uri() . '/assets/css/all' . $min . '.css', '', '4.7.0' );
	
	wp_enqueue_style( 'slick-theme-css', get_template_directory_uri() .'/assets/css/slick-theme' . $min . '.css', '', 'v2.2.0');

	wp_enqueue_style( 'slick-css', get_template_directory_uri() .'/assets/css/slick' . $min . '.css', '', 'v1.8.0');

	wp_enqueue_style( 'prime-beauty-salon-blocks', get_template_directory_uri() . '/assets/css/blocks' . $min . '.css' );
	
	wp_enqueue_style( 'prime-beauty-salon-style', get_stylesheet_uri() );

	wp_style_add_data('prime-beauty-salon-style', 'rtl', 'replace');

	require get_parent_theme_file_path( '/inc/css_custom.php' );
	wp_add_inline_style( 'prime-beauty-salon-style',$prime_beauty_salon_custom_css );
	
	wp_enqueue_script( 'jquery-slick', get_template_directory_uri() . '/assets/js/slick' . $min . '.js', array('jquery'), '2017417', true );
	
	wp_enqueue_script( 'prime-beauty-salon-navigation', get_template_directory_uri() . '/assets/js/navigation' . $min . '.js', array(), '20151215', true );

	// Wow script.
	wp_enqueue_script( 'wow-jquery', get_template_directory_uri() . '/assets/js/wow.js', array('jquery'),'' ,true );
	// Animate CSS
	wp_enqueue_style( 'animate-style', get_template_directory_uri() . '/assets/css/animate.css' );

	wp_enqueue_script( 'custom-js', get_template_directory_uri(). '/assets/js/custom.js', array('jquery') ,'',true);

	wp_enqueue_script( 'prime-beauty-salon-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix' . $min . '.js', array(), '20151215', true );
	
	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'prime_beauty_salon_scripts' );

if( ! function_exists( 'prime_beauty_salon_admin_scripts' ) ) :
/**
 * Addmin scripts
*/
function prime_beauty_salon_admin_scripts() {
	wp_enqueue_style( 'prime-beauty-salon-admin-style',get_template_directory_uri().'/assets/css/admin.css', PRIME_BEAUTY_SALON_THEME_VERSION, 'screen' );
}
endif;
add_action( 'admin_enqueue_scripts', 'prime_beauty_salon_admin_scripts' );

/**
 * Enqueue editor styles for Gutenberg
 *
 * @since Prime Beauty Salon 1.0.0
 */
function prime_beauty_salon_block_editor_styles() {
	$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
	// Block styles.
	wp_enqueue_style( 'prime-beauty-salon-block-editor-style', get_theme_file_uri( '/assets/css/editor-blocks' . $min . '.css' ) );
	// Add custom fonts.
	wp_enqueue_style( 'prime-beauty-salon-fonts', prime_beauty_salon_fonts_url(), array(), null );
}
add_action( 'enqueue_block_editor_assets', 'prime_beauty_salon_block_editor_styles' );

// Change number or products per row to 3
add_filter('loop_shop_columns', 'prime_beauty_salon_loop_columns');
	if (!function_exists('prime_beauty_salon_loop_columns')) {
		function prime_beauty_salon_loop_columns() {
		return 3; // 3 products per row
	}
}

//Change number of products that are displayed per page (shop page)
add_filter( 'loop_shop_per_page', 'prime_beauty_salon_products_per_page' );
function prime_beauty_salon_products_per_page( $cols ) {
  	return  9;
}

/**
 * Display the admin notice unless dismissed.
 */
function prime_beauty_salon_dashboard_notice() {
    // Check if the notice is dismissed
    $dismissed = get_user_meta( get_current_user_id(), 'prime_beauty_salon_dismissable_notice', true );

    // Display the notice only if not dismissed
    if ( ! $dismissed ) {

        // Get the theme name dynamically
        $theme_name = wp_get_theme()->get( 'Name' );
        ?>
        <div class="updated notice notice-success is-dismissible notice-get-started-class" data-notice="get-start">
            <div class="notice-details">
                <div class="notice-content">
                    <h2>
                        <?php 
                        /* translators: %s: Theme name */
                        printf(
                            esc_html__( 'Thank you for installing %s.', 'prime-beauty-salon' ),
                            '<strong>' . esc_html( $theme_name ) . '</strong>'
                        );
                        ?>
                    </h2>
                    <p><?php echo esc_html__( 'Your journey to a powerful and stylish website begins here. Let’s get everything set up in just a few clicks!', 'prime-beauty-salon' ); ?></p>
                    <div class="notice-btns">
                        <a class="button button-primary getstart"
                           href="<?php echo esc_url( admin_url( 'themes.php?page=prime-beauty-salon' ) ); ?>">
                           <?php esc_html_e( 'Getting Started', 'prime-beauty-salon' ); ?>
                        </a>                   
                       	<a class="button button-primary premium" target="_blank" href="<?php echo esc_url(PRIME_BEAUTY_SALON_URL); ?>"><?php esc_html_e('Go To Premium', 'prime-beauty-salon') ?></a>
						<a class="button button-primary demo" target="_blank" href="<?php echo esc_url(PRIME_BEAUTY_SALON_DEMO_URL); ?>"><?php esc_html_e('View Demo', 'prime-beauty-salon') ?></a>
		            </div>
        		</div>
                <div class="notice-img">
                    <a href="<?php echo esc_url( PRIME_BEAUTY_SALON_BUNDLE_URL ); ?>" target="_blank"><img src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/notice.png' ); ?>"></a>
                </div>
            </div>
        </div>
        <?php
    }
}

// Hook to display the notice
add_action( 'admin_notices', 'prime_beauty_salon_dashboard_notice' );

/**
 * AJAX handler to dismiss the notice.
 */
function prime_beauty_salon_dismissable_notice() {
    // Set user meta to indicate the notice is dismissed
    update_user_meta(get_current_user_id(), 'prime_beauty_salon_dismissable_notice', true);
    die();
}

// Hook for the AJAX action
add_action('wp_ajax_prime_beauty_salon_dismissable_notice', 'prime_beauty_salon_dismissable_notice');

/**
 * Clear dismissed notice state when switching themes.
 */
function prime_beauty_salon_switch_theme() {
    // Clear the dismissed notice state when switching themes
    delete_user_meta(get_current_user_id(), 'prime_beauty_salon_dismissable_notice');
}

// Hook for switching themes
add_action('after_switch_theme', 'prime_beauty_salon_switch_theme');

function prime_beauty_salon_template_setup() {

/**
 * Load init.
 */
require_once get_template_directory() . '/inc/init.php';

/**
 * Pro Link.
 */
require_once get_template_directory() . '/inc/premium-link/class-button-link.php';

/**
 * Load plugin for right and no sidebar
 */

require get_template_directory() . '/inc/woocommerce-functions.php';

/**
 * Getting Started
*/
require get_template_directory() . '/inc/getting-started/getting-started.php';

/**
 * setup wizard
 */
require get_parent_theme_file_path( '/theme-wizard/config.php' );

}
add_action('after_setup_theme', 'prime_beauty_salon_template_setup');

/**
 *  Webfonts 
 */
require get_template_directory() . '/inc/wptt-webfont-loader.php';


/**
 * Set the number of products displayed per row on WooCommerce archive pages.
 *
 * @param int $columns Number of columns per row.
 * @return int Number of columns to display per row.
 */
function prime_beauty_salon_customize_woocommerce_archive_per_row($prime_beauty_salon_columns) {
    // Set the desired number of columns per row.
    $prime_beauty_salon_columns = prime_beauty_salon_get_option( 'prime_beauty_salon_archive_product_per_row' ); // You can change this to your preferred number.

    return $prime_beauty_salon_columns;
}

// Add a filter to modify the number of columns per row on WooCommerce archive pages.
add_filter('loop_shop_columns', 'prime_beauty_salon_customize_woocommerce_archive_per_row');

/**
 * Set the number of products displayed per page on WooCommerce archive pages.
 *
 * @param int $posts_per_page Number of products per page.
 * @return int Number of products to display per page.
 */
function prime_beauty_salon_customize_woocommerce_archive_per_page($prime_beauty_salon_posts_per_page) {
    // Set the desired number of products per page.
    $prime_beauty_salon_posts_per_page = prime_beauty_salon_get_option( 'prime_beauty_salon_archive_product_per_page' ); // You can change this to your preferred number.

    return $prime_beauty_salon_posts_per_page;
}

// Add a filter to modify the number of products displayed per page on WooCommerce archive pages.
add_filter('loop_shop_per_page', 'prime_beauty_salon_customize_woocommerce_archive_per_page');


function prime_beauty_salon_menu_customizer_css() {
    ?>
    <style type="text/css">
        .main-navigation .nav-menu a {
            font-weight: <?php echo esc_html( get_theme_mod( 'menu_font_weight', '400' ) ); ?>;
            text-transform: <?php echo esc_html( get_theme_mod( 'menu_text_transform', 'capitalize' ) ); ?>;
        }
    </style>
    <?php
}
add_action( 'wp_head', 'prime_beauty_salon_menu_customizer_css' );

function prime_beauty_salon_enqueue_google_fontss() {
    $prime_beauty_salon_heading_font_family = get_theme_mod('prime_beauty_salon_heading_font_family', '');
    $prime_beauty_salon_body_font_family = get_theme_mod('prime_beauty_salon_body_font_family', '');

    // Google Fonts URL builder
    $google_fonts = array(
        'arial'          => '',
        'verdana'        => '',
        'helvetica'      => '',
        'times-new-roman'=> '',
        'georgia'        => '',
        'courier-new'    => '',
        'trebuchet-ms'   => '',
        'tahoma'         => '',
        'palatino'       => '',
        'garamond'       => '',
        'impact'         => '',
        'comic-sans-ms'  => '',
        'lucida-sans'    => '',
        'arial-black'    => '',
        'gill-sans'      => '',
        'segoe-ui'       => '',
        'open-sans'      => 'Open+Sans:wght@400;700',
        'roboto'         => 'Roboto:wght@400;700',
        'lato'           => 'Lato:wght@400;700',
        'montserrat'     => 'Montserrat:wght@400;700',
        'libre-baskerville' => 'Libre+Baskerville:wght@400;700'
    );

    $prime_beauty_salon_google_fonts_url = '';

    if (!empty($google_fonts[$prime_beauty_salon_heading_font_family]) || !empty($google_fonts[$prime_beauty_salon_body_font_family])) {
        $fonts = array();

        if (!empty($google_fonts[$prime_beauty_salon_heading_font_family])) {
            $fonts[] = $google_fonts[$prime_beauty_salon_heading_font_family];
        }

        if (!empty($google_fonts[$prime_beauty_salon_body_font_family])) {
            $fonts[] = $google_fonts[$prime_beauty_salon_body_font_family];
        }

        // Build Google Fonts URL
        $prime_beauty_salon_google_fonts_url = add_query_arg(
            'family',
            implode('|', $fonts),
            'https://fonts.googleapis.com/css2'
        );
    }

    if ($prime_beauty_salon_google_fonts_url) {
        wp_enqueue_style('prime-beauty-salon-google-fonts', $prime_beauty_salon_google_fonts_url, false);
    }
}
add_action('wp_enqueue_scripts', 'prime_beauty_salon_enqueue_google_fontss');


function prime_beauty_salon_apply_typography() {
    $prime_beauty_salon_heading_font_family = get_theme_mod('prime_beauty_salon_heading_font_family');
    $prime_beauty_salon_body_font_family = get_theme_mod('prime_beauty_salon_body_font_family');

    $prime_beauty_salon_custom_css = '';

    if ($prime_beauty_salon_body_font_family) {
        $prime_beauty_salon_custom_css .= "body, a, a:active, a:hover { font-family: " . esc_html($prime_beauty_salon_body_font_family) . " !important; }";
    }

    if ($prime_beauty_salon_heading_font_family) {
        $prime_beauty_salon_custom_css .= "h1, h2, h3, h4, h5, h6 { font-family: " . esc_html($prime_beauty_salon_heading_font_family) . " !important; }";
    }

    if (!empty($prime_beauty_salon_custom_css)) {
        wp_add_inline_style('prime-beauty-salon-style', $prime_beauty_salon_custom_css);
    }
}
add_action('wp_enqueue_scripts', 'prime_beauty_salon_apply_typography');