<?php
	
	$appliances_store_tp_theme_css = '';

	// Initialize CSS variable
	$appliances_store_tp_theme_css = '';

	// Global Colors with Fallbacks
	$appliances_store_tp_color_option_first = get_theme_mod('appliances_store_tp_color_option_first', '#3F5FFF') ?: '#3F5FFF';
	$appliances_store_tp_color_option_second = get_theme_mod('appliances_store_tp_color_option_second', '#FF0000') ?: '#FF0000';
	$appliances_store_tp_color_option_third = get_theme_mod('appliances_store_tp_color_option_third', '#000') ?: '#000';

	// Consolidate all color variables in a single :root block
	$appliances_store_tp_theme_css .= ':root {';
	$appliances_store_tp_theme_css .= '--color-primary1: ' . esc_attr($appliances_store_tp_color_option_first) . ';';
	$appliances_store_tp_theme_css .= '--color-primary2: ' . esc_attr($appliances_store_tp_color_option_second) . ';';
	$appliances_store_tp_theme_css .= '--color-primary3: ' . esc_attr($appliances_store_tp_color_option_third) . ';';
	$appliances_store_tp_theme_css .= '}';

	// Phone Number
	$appliances_store_header_call_no = get_theme_mod('appliances_store_header_call_no', '');

	if ($appliances_store_header_call_no) {
	    $appliances_store_tp_theme_css .= '.headerbox {';
	    $appliances_store_tp_theme_css .= 'background: linear-gradient(to right, var(--color-primary1) 73%, var(--color-primary3) 73% 93%, var(--color-primary1) 93% 100%);';
	    $appliances_store_tp_theme_css .= '}';

	    // Media Query for 768px to 999px
	    $appliances_store_tp_theme_css .= '@media (min-width: 768px) and (max-width: 999px) {';
	    $appliances_store_tp_theme_css .= '.headerbox {';
	    $appliances_store_tp_theme_css .= 'background: linear-gradient(to right, var(--color-primary1) 45%, var(--color-primary3) 45% 85%, var(--color-primary1) 85% 100%);';
	    $appliances_store_tp_theme_css .= '}';
	    $appliances_store_tp_theme_css .= '}';

	    // Media Query for 1000px to 1025px
	    $appliances_store_tp_theme_css .= '@media (min-width: 1000px) and (max-width: 1025px) {';
	    $appliances_store_tp_theme_css .= '.headerbox {';
	    $appliances_store_tp_theme_css .= 'background: linear-gradient(to right, var(--color-primary1) 69%, var(--color-primary3) 69% 92%, var(--color-primary1) 92% 100%);';
	    $appliances_store_tp_theme_css .= '}';
	    $appliances_store_tp_theme_css .= '}';
	}
	if (!empty($appliances_store_tp_theme_css)) {
	    echo '<style>' . $appliances_store_tp_theme_css . '</style>';
	}

	// preloader
	$appliances_store_tp_preloader_color1_option = get_theme_mod('appliances_store_tp_preloader_color1_option');

	if($appliances_store_tp_preloader_color1_option != false){
	$appliances_store_tp_theme_css .='.center1{';
		$appliances_store_tp_theme_css .='border-color: '.esc_attr($appliances_store_tp_preloader_color1_option).' !important;';
	$appliances_store_tp_theme_css .='}';
	}
	if($appliances_store_tp_preloader_color1_option != false){
	$appliances_store_tp_theme_css .='.center1 .ring::before{';
		$appliances_store_tp_theme_css .='background: '.esc_attr($appliances_store_tp_preloader_color1_option).' !important;';
	$appliances_store_tp_theme_css .='}';
	}

	$appliances_store_tp_preloader_color2_option = get_theme_mod('appliances_store_tp_preloader_color2_option');

	if($appliances_store_tp_preloader_color2_option != false){
	$appliances_store_tp_theme_css .='.center2{';
		$appliances_store_tp_theme_css .='border-color: '.esc_attr($appliances_store_tp_preloader_color2_option).' !important;';
	$appliances_store_tp_theme_css .='}';
	}
	if($appliances_store_tp_preloader_color2_option != false){
	$appliances_store_tp_theme_css .='.center2 .ring::before{';
		$appliances_store_tp_theme_css .='background: '.esc_attr($appliances_store_tp_preloader_color2_option).' !important;';
	$appliances_store_tp_theme_css .='}';
	}

	$appliances_store_tp_preloader_bg_color_option = get_theme_mod('appliances_store_tp_preloader_bg_color_option');

	if($appliances_store_tp_preloader_bg_color_option != false){
	$appliances_store_tp_theme_css .='.loader{';
		$appliances_store_tp_theme_css .='background: '.esc_attr($appliances_store_tp_preloader_bg_color_option).';';
	$appliances_store_tp_theme_css .='}';
	}

	$appliances_store_tp_footer_bg_color_option = get_theme_mod('appliances_store_tp_footer_bg_color_option');


	if($appliances_store_tp_footer_bg_color_option != false){
	$appliances_store_tp_theme_css .='#footer{';
		$appliances_store_tp_theme_css .='background: '.esc_attr($appliances_store_tp_footer_bg_color_option).';';
	$appliances_store_tp_theme_css .='}';
	}

	// logo tagline color
	$appliances_store_site_tagline_color = get_theme_mod('appliances_store_site_tagline_color');

	if($appliances_store_site_tagline_color != false){
	$appliances_store_tp_theme_css .='.logo h1 a, .logo p a, .logo p.site-title a{';
	$appliances_store_tp_theme_css .='color: '.esc_attr($appliances_store_site_tagline_color).';';
	$appliances_store_tp_theme_css .='}';
	}

	$appliances_store_logo_tagline_color = get_theme_mod('appliances_store_logo_tagline_color');
	if($appliances_store_logo_tagline_color != false){
	$appliances_store_tp_theme_css .='p.site-description{';
	$appliances_store_tp_theme_css .='color: '.esc_attr($appliances_store_logo_tagline_color).';';
	$appliances_store_tp_theme_css .='}';
	}

	// footer widget title color
	$appliances_store_footer_widget_title_color = get_theme_mod('appliances_store_footer_widget_title_color');
	if($appliances_store_footer_widget_title_color != false){
	$appliances_store_tp_theme_css .='#footer h3, #footer h2.wp-block-heading{';
	$appliances_store_tp_theme_css .='color: '.esc_attr($appliances_store_footer_widget_title_color).';';
	$appliances_store_tp_theme_css .='}';
	}

	// copyright text color
	$appliances_store_footer_copyright_text_color = get_theme_mod('appliances_store_footer_copyright_text_color');
	if($appliances_store_footer_copyright_text_color != false){
	$appliances_store_tp_theme_css .='#footer .site-info p, #footer .site-info a {';
	$appliances_store_tp_theme_css .='color: '.esc_attr($appliances_store_footer_copyright_text_color).'!important;';
	$appliances_store_tp_theme_css .='}';
	}

	// header image title color
	$appliances_store_header_image_title_text_color = get_theme_mod('appliances_store_header_image_title_text_color');
	if($appliances_store_header_image_title_text_color != false){
	$appliances_store_tp_theme_css .='.box-text h2{';
	$appliances_store_tp_theme_css .='color: '.esc_attr($appliances_store_header_image_title_text_color).';';
	$appliances_store_tp_theme_css .='}';
	}

	// menu color
	$appliances_store_menu_color = get_theme_mod('appliances_store_menu_color');
	if($appliances_store_menu_color != false){
	$appliances_store_tp_theme_css .='.main-navigation a{';
	$appliances_store_tp_theme_css .='color: '.esc_attr($appliances_store_menu_color).';';
	$appliances_store_tp_theme_css .='}';
}


//Footer Font Weight
$appliances_store_footer_copyright_title_font_weight = get_theme_mod( 'appliances_store_footer_copyright_title_font_weight','');
if($appliances_store_footer_copyright_title_font_weight == '100'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 100;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '200'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 200;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '300'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 300;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '400'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 400;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '500'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 500;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '600'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 600;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '700'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 700;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '800'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 800;';
$appliances_store_tp_theme_css .='}';
}else if($appliances_store_footer_copyright_title_font_weight == '900'){
$appliances_store_tp_theme_css .='#footer .site-info p {';
    $appliances_store_tp_theme_css .='font-weight: 900;';
$appliances_store_tp_theme_css .='}';
}