<?php
function chargingstation_custom_header_setup() {
	add_theme_support( 'custom-header', apply_filters( 'chargingstation_custom_header_args', array(
		'default-image'          => '',
		'default-text-color'     => '646464',
		'width'                  => 2000, 
		'height'                 => 200,
		'flex-height'            => true,
		'wp-head-callback'       => 'chargingstation_header_style',
	) ) );
}
add_action( 'after_setup_theme', 'chargingstation_custom_header_setup' );

if ( ! function_exists( 'chargingstation_header_style' ) ) :

function chargingstation_header_style() {
	$header_text_color = get_header_textcolor();

	$topheader_logowidth = get_theme_mod('topheader_logowidth','100');
	$topheader_bgcol = get_theme_mod('topheader_bgcol','#ffffff');

	$topheader_sitetitlecol = esc_attr(get_theme_mod('topheader_sitetitlecol','#646464'));
	$topheader_sitetitleborcol = esc_attr(get_theme_mod('topheader_sitetitleborcol','#b6d434'));
	$topheader_taglinecol = esc_attr(get_theme_mod('topheader_taglinecol','#fff'));

	$topheader_btnhovercolor = get_theme_mod('topheader_btnhovercolor','#58b43e');
	$topheader_menucolor = get_theme_mod('topheader_menucolor','#000');
	$topheader_menuarrowcolor = get_theme_mod('topheader_menuarrowcolor','#81c76f');
	$topheader_menuhovercolor = get_theme_mod('topheader_menuhovercolor','#7BC268');
	$topheader_submenutextcolor = get_theme_mod('topheader_submenutextcolor','#fff');
	$topheader_submenubggradientcolor1 = get_theme_mod('topheader_submenubggradientcolor1','#509e39');
	$topheader_submenubggradientcolor2 = get_theme_mod('topheader_submenubggradientcolor2','#283524');
	$topheader_submenutexthovercolor = get_theme_mod('topheader_submenutexthovercolor','#7ac168');
	$topheader_submenubghovercolor = get_theme_mod('topheader_submenubghovercolor','#fff');



	$slider_title_color = esc_attr(get_theme_mod('slider_title_color','#becb01'));
	$slider_description_color = esc_attr(get_theme_mod('slider_description_color','#979b9d'));
	$slider_btntext_color = esc_attr(get_theme_mod('slider_btntext_color','#fff'));
	$slider_Buttonbg_color = esc_attr(get_theme_mod('slider_Buttonbg_color','#becb01'));
	$slider_btnbghover_color = esc_attr(get_theme_mod('slider_btnbghover_color','#58b43e'));
	$slider_contntbg_color = esc_attr(get_theme_mod('slider_contntbg_color','#161415'));
		$slider_contntBorder_color = esc_attr(get_theme_mod('slider_contntBorder_color','#fff'));


	$Service_heading_color = esc_attr(get_theme_mod('Service_heading_color','#bfcc03'));
	$Service_subheading_color = esc_attr(get_theme_mod('Service_subheading_color','#8a8a8a'));
	$Service_title_color = esc_attr(get_theme_mod('Service_title_color','#fff'));
	$Service_border_color = esc_attr(get_theme_mod('Service_border_color','#bfcc03'));
	$Service_innerborder_color = esc_attr(get_theme_mod('Service_innerborder_color','#dddddd'));
	$Service_section_t_padding = esc_attr(get_theme_mod('Service_section_t_padding','4'));
	$Service_section_b_padding = esc_attr(get_theme_mod('Service_section_b_padding','5'));

	$slider_section_t_padding = esc_attr(get_theme_mod('slider_section_t_padding','0'));
	$slider_section_b_padding = esc_attr(get_theme_mod('slider_section_b_padding','0'));
	
	$Service_disable_section = esc_attr(get_theme_mod('Service_disable_section','YES'));
	$chargingstation_Service_image_height = esc_attr(get_theme_mod('chargingstation_Service_image_height','340'));


	$footer_bg_color = esc_attr(get_theme_mod('footer_bg_color','#161415'));

	?>
	<style type="text/css">

		<?php 
		
		?>

		h4.site-title {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_sitetitlecol); ?> !important;

		}

		.navbar .logo a {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_sitetitleborcol); ?> !important;

		}

		p.site-description {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_taglinecol); ?>;

		}



		p.site-description {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_taglinecol); ?>;

		}

		.navbar a.contactus:hover {
			background-image: radial-gradient( circle farthest-corner at 10% 20%,<?php echo apply_filters('chargingstation_topheader', $topheader_btnhovercolor); ?> 0%,<?php echo apply_filters('chargingstation_topheader', $topheader_btnhovercolor); ?> 100.3% ) !important;
		}

		.main-header .navbar .navbar-menu ul li a {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_menucolor); ?>;
		}

		.main-header .navbar .navbar-menu ul li.dropdown>a::after {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_menuarrowcolor); ?>;
		}

		.main-header .navbar .navbar-nav > li:hover a {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_menuhovercolor); ?>;
		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu a:not(.remove){
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_submenutextcolor); ?>;
		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu {
			background-image: radial-gradient( circle farthest-corner at 10% 20%,<?php echo apply_filters('chargingstation_topheader', $topheader_submenubggradientcolor1); ?> 0%,<?php echo apply_filters('chargingstation_topheader', $topheader_submenubggradientcolor2); ?> 100.3% ) !important ;
		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu a:hover {
			color: <?php echo apply_filters('chargingstation_topheader', $topheader_submenutexthovercolor); ?>;
		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu a:hover {
			background: <?php echo apply_filters('chargingstation_topheader', $topheader_submenubghovercolor); ?>;
		}

		


		.custom-logo {
			width: <?php echo apply_filters('chargingstation_topheader', $topheader_logowidth); ?>%;
			height: 70%;
		}

		.main-header {
			background: <?php echo apply_filters('chargingstation_topheader', $topheader_bgcol); ?>;
		}

		.main-header.header-fixed {
			background: <?php echo apply_filters('chargingstation_topheader', $topheader_bgcol); ?>;
		}



		.hero-style .slide-title h2 {
			color: <?php echo apply_filters('chargingstation_slider', $slider_title_color); ?>;
		}

		.hero-style .slide-text p {
			color: <?php echo apply_filters('chargingstation_slider', $slider_description_color); ?>;
		}

		.hero-style a.ReadMore {
			color: <?php echo apply_filters('chargingstation_slider', $slider_btntext_color); ?> !important;
		}

		.hero-style a.ReadMore {
			background: <?php echo apply_filters('chargingstation_slider', $slider_Buttonbg_color); ?> !important;
		}

		.hero-style a.ReadMore:hover {
			background: <?php echo apply_filters('chargingstation_slider', $slider_btnbghover_color); ?> !important;
		}

.slider-img-overlay{
		background: <?php echo apply_filters('chargingstation_slider', $slider_contntbg_color); ?>;
}
.slider-img-overlay-outer{
	background: <?php echo apply_filters('chargingstation_slider', $slider_contntBorder_color); ?>;
}
		#service-section .header-section .title {
			color: <?php echo apply_filters('chargingstation_service', $Service_heading_color); ?>;
		}

		#service-section .header-section .description {
			color: <?php echo apply_filters('chargingstation_service', $Service_subheading_color); ?>;
		}

		#service-section .single-service .part-2 h3.title {
			color: <?php echo apply_filters('chargingstation_service', $Service_title_color); ?>;
		}

		#service-section .single-service {
			border-color: <?php echo apply_filters('chargingstation_service', $Service_border_color); ?>;
		}

		#service-section .services-highlightborder {
			background-color: <?php echo apply_filters('chargingstation_service', $Service_innerborder_color); ?>;
		}

		#service-section {
			padding-top: <?php echo apply_filters('chargingstation_service', $Service_section_t_padding); ?>em;
			padding-bottom: <?php echo apply_filters('chargingstation_service', $Service_section_b_padding); ?>em;
		}

		#service-section .single-service .part-1 img {
			height: <?php echo apply_filters('chargingstation_service', $chargingstation_Service_image_height); ?>px;
		}


section#slider-section {
			padding-top: <?php echo apply_filters('chargingstation_service', $slider_section_t_padding); ?>em;
			padding-bottom: <?php echo apply_filters('chargingstation_service', $slider_section_b_padding); ?>em;
		}



		.footer-area {
			background: <?php echo apply_filters('chargingstation_footer', $footer_bg_color); ?>;
		}



		<?php  ?>
	<?php
		if ( ! display_header_text() ) :
	?>
		.site-title,
		.site-description {
			position: absolute;
			clip: rect(1px, 1px, 1px, 1px);
		}
	<?php
		else :
	?>
		h4.site-title{
			color: #<?php echo esc_attr( $header_text_color ); ?>;
		}
	<?php endif; ?>

	<?php
        if ($Service_disable_section == 1):
	?>
		#service-section {
			display: none;
		}
	<?php
		else :
	?>
		#service-section {
			display: block;
		}
	<?php endif; ?>

	</style>
	<?php
}
endif;
