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

if ( ! function_exists( 'onlineflowershop_header_style' ) ) :

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

  	$banner_disable_section = esc_attr(get_theme_mod('banner_disable_section','YES'));
	$topheader_logowidth = esc_attr(get_theme_mod('topheader_logowidth','50'));
	$featuredproduct_disable_section = esc_attr(get_theme_mod('featuredproduct_disable_section','YES'));


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


		<?php 
		
		?>

		.site-logo img {
			width: <?php echo apply_filters('onlineflowershop_topheader', $topheader_logowidth); ?>%;
			height: 100%;
		}


		header.site-header .site-title {
			color: <?php echo esc_attr(get_theme_mod('topheader_sitetitlecol')); ?>;

		}

		header.site-header .site-logo a {
			text-decoration-color: <?php echo esc_attr(get_theme_mod('topheader_sitetitlecol')); ?> !important;
		}

		p.site-description {
			color: <?php echo esc_attr(get_theme_mod('topheader_taglinecol')); ?>;
		}
		


		
	 
	
		

	

		header #formButton:after {
			color: <?php echo esc_attr(get_theme_mod('header_searchiconcolor')); ?>;
		}

		.searchbx {
			background: <?php echo esc_attr(get_theme_mod('header_searchiconbgcolor')); ?>;
		}
		

		.tpf-head .social-icon li i:hover {
			color: <?php echo esc_attr(get_theme_mod('header_topheadiconshvrcolor')); ?>;
		}
		
		
		
		.primary-menu a {
			color: <?php echo esc_attr(get_theme_mod('header_menuscolor')); ?>;
		}

		.primary-menu a:hover, .primary-menu a:focus, .primary-menu .current_page_ancestor,
		.primary-menu li.current-menu-item > a, .primary-menu li.current-menu-item > .link-icon-wrapper > a {
			color: <?php echo esc_attr(get_theme_mod('header_menushovercolor')); ?>;
		}

		.primary-menu li ul li a {
			color: <?php echo esc_attr(get_theme_mod('header_submenutextcolor')); ?>;
		}

		.primary-menu ul {
			background: <?php echo esc_attr(get_theme_mod('header_submenusbgcolor')); ?>;
		}

		.primary-menu ul::after {
			border-bottom-color: <?php echo esc_attr(get_theme_mod('header_submenusbgcolor')); ?>;
		}

		.primary-menu > li > .icon {
			color: <?php echo esc_attr(get_theme_mod('header_submenusiconcolor')); ?>;
		}

		.primary-menu li ul li a:hover{
			color: <?php echo esc_attr(get_theme_mod('header_submenustxthovercolor')); ?> !important;
		}

		.bpf-head .icon li i {
			color: <?php echo esc_attr(get_theme_mod('header_iconscolor')); ?> !important;
		}

		.bpf-head .icon li i:hover {
			color: <?php echo esc_attr(get_theme_mod('header_iconhover_color')); ?> !important;
		}
	




		

		.hero-style .slide-title h2 {
			color: <?php echo esc_attr(get_theme_mod('slider_titlecolor')); ?> !important;
		}

		.hero-style .slide-text p {
			color: <?php echo esc_attr(get_theme_mod('slider_descriptioncolor')); ?>;
		}

		.hero-style .slide-btns a {
			background: <?php echo esc_attr(get_theme_mod('slider_btnbgcolor')); ?>;
		}

		.hero-style .slide-btns a:before {
			border-color: <?php echo esc_attr(get_theme_mod('slider_btnbrdcolor')); ?>;
		}

		.hero-style .slide-btns a {
			color: <?php echo esc_attr(get_theme_mod('slider_btntxt1color')); ?> !important;
			border-color: <?php echo esc_attr(get_theme_mod('slider_btntxt1color')); ?> !important;
		}

		.hero-style .slide-btns a:hover {
			color: <?php echo esc_attr(get_theme_mod('slider_btntxthovercolor')); ?> !important;
		}

		#slider-section .social-icon a i {
			color: <?php echo esc_attr(get_theme_mod('slider_socialiconscolor')); ?> !important;
		}

		#slider-section .social-icon a:hover i {
			color: <?php echo esc_attr(get_theme_mod('slider_socialiconshovercolor')); ?> !important;
		}

		#slider-section .socialbx {
			background: <?php echo esc_attr(get_theme_mod('slider_socialiconsbgcolor')); ?> !important;
		}

		#slider-section .online_flower_shopswiper-pagination,
		#slider-section .online_flower_shopswiper-pagination span {
			color: <?php echo esc_attr(get_theme_mod('slider_prevnextnumberscolor')); ?> !important;
		}

		#slider-section .online_flower_shopswiper-pagination:after{
		color: <?php echo esc_attr(get_theme_mod('slider_prevnexticoncolor')); ?>;
	}

		#slider-section .online_flower_shopswiper-pagination {
			background: <?php echo esc_attr(get_theme_mod('slider_prevnextnumbersbgcolor')); ?> !important;
		}

		#slider-section .online_flower_shopswiper-pagination:before {
			border-color: <?php echo esc_attr(get_theme_mod('slider_prevnextnumbersboxbrdcolor')); ?> !important;
		}


		
		#banner-section .banner-content h2 {
			color: <?php echo esc_attr(get_theme_mod('banner_offertext1color')); ?>;
		}

		#banner-section .banner-content h2 {
			background: <?php echo esc_attr(get_theme_mod('banner_offertext1bgcolor')); ?>;
		}

		#banner-section .banner-content h2 {
			border-color: <?php echo esc_attr(get_theme_mod('banner_offertext1brdcolor')); ?>;
		}

		#banner-section .banner-contentrhs h2 {
			color: <?php echo esc_attr(get_theme_mod('banner_offertext2color')); ?>;
		}

		#banner-section .banner-contentrhs h2 {
			background: <?php echo esc_attr(get_theme_mod('banner_offertext2bgcolor')); ?>;
		}

		#banner-section .banner-content h3,
		#banner-section .banner-contentrhs h3 {
			color: <?php echo esc_attr(get_theme_mod('banner_titlecolor')); ?>;
		}

		#banner-section .banner-content h5 {
			color: <?php echo esc_attr(get_theme_mod('banner_descriptioncolor')); ?>;
		}
		
		#banner-section .banner-button a,
		#banner-section .banner-contentrhs .banner-button a {
			color: <?php echo esc_attr(get_theme_mod('banner_buttntextcolor')); ?>;
		}
		
		#banner-section .banner-button a,
		#banner-section .banner-contentrhs .banner-button a {
			background: <?php echo esc_attr(get_theme_mod('banner_buttonbgcolor')); ?>;
		}

		#banner-section .banner-button a,
		#banner-section .banner-contentrhs .banner-button a {
			border-color: <?php echo esc_attr(get_theme_mod('banner_buttonbrdcolor')); ?>;
		}
		
		#banner-section .banner-button a:hover,
		#banner-section .banner-contentrhs .banner-button a:hover {
			background: <?php echo esc_attr(get_theme_mod('banner_buttonbghovercolor')); ?>;
		}

		#banner-section .banner-button a:hover,
		#banner-section .banner-contentrhs .banner-button a:hover {
			color: <?php echo esc_attr(get_theme_mod('banner_buttonTexthovercolor')); ?>;
		}
		#banner-section .banner-button a:hover,
		#banner-section .banner-contentrhs .banner-button a:hover {
			border-color: <?php echo esc_attr(get_theme_mod('banner_buttonborderhovercolor')); ?>;
		}

		#banner-section {
			padding-top: <?php echo esc_attr(get_theme_mod('onlineflowershop_banner_top_padding')); ?>em !important;
		}

		#banner-section {
			padding-bottom: <?php echo esc_attr(get_theme_mod('onlineflowershop_banner_bottom_padding')); ?>em !important;
		}


		#slider-section {
			padding-top: <?php echo esc_attr(get_theme_mod('onlineflowershop_slider_top_padding')); ?>em !important;
		}

		#slider-section {
			padding-bottom: <?php echo esc_attr(get_theme_mod('onlineflowershop_slider_bottom_padding')); ?>em !important;
		}





		#featuredproduct-product-section .section-title h2 {
			color: <?php echo esc_attr(get_theme_mod('featuredproduct_headingcolor')); ?>;
		}

		#featuredproduct-product-section .pcontent h3  {
			color: <?php echo esc_attr(get_theme_mod('featuredproduct_titlecolor')); ?>;
		}

		#featuredproduct-product-section .regular-price,#featuredproduct-product-section .regular-price .woocommerce-Price-amount.amount{
			color: <?php echo esc_attr(get_theme_mod('featuredproduct_regularpricecolor')); ?>;
		}

		#featuredproduct-product-section .sale-price .woocommerce-Price-amount.amount{
			color: <?php echo esc_attr(get_theme_mod('featuredproduct_salepricecolor')); ?>;
		}

		#featuredproduct-product-section .imgicn {
			color: <?php echo esc_attr(get_theme_mod('featuredproduct_saleiconcolor')); ?>;
		}

		#featuredproduct-product-section .imgicn {
			background: <?php echo esc_attr(get_theme_mod('featuredproduct_saleiconbgcolor')); ?>;
		}

		#featuredproduct-product-section .imgicn:hover {
			background: <?php echo esc_attr(get_theme_mod('featuredproduct_saleiconbghovercolor')); ?>;
		}

		#featuredproduct-product-section {
			padding-top: <?php echo esc_attr(get_theme_mod('onlineflowershop_featuredproduct_top_padding')); ?>em !important;
		}

		#featuredproduct-product-section {
			padding-bottom: <?php echo esc_attr(get_theme_mod('onlineflowershop_featuredproduct_bottom_padding')); ?>em !important;
		}




		.copy-right,.footer-area .f-oly {
			background: <?php echo esc_attr(get_theme_mod('footer_copyrightbgcolor')); ?>;
		}

		.copy-right p,.copy-right p a {
			color: <?php echo esc_attr(get_theme_mod('footer_copyrightcolor')); ?>;
		}

		.copy-right {
			border-color: <?php echo esc_attr(get_theme_mod('footer_bordercolor')); ?>;
		}

		.footer-area .widget_text, .footer-area .widget_text p, .wp-block-latest-comments__comment-excerpt p, .wp-block-latest-comments__comment-date, .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt, .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta,.footer-area .widget_block h1, .footer-area .widget_block h2, .footer-area .widget_block h3, .footer-area .widget_block h4, .footer-area .widget_block h5, .footer-area .widget_block h6,.footer-area .footer-widget .widget:not(.widget_social_widget):not(.widget_tag_cloud) li a {
			color: <?php echo esc_attr(get_theme_mod('footer_textcolor')); ?>;
		}

		.footer-area .footer-widget .widget:not(.widget_social_widget):not(.widget_tag_cloud) li a:hover {
			color: <?php echo esc_attr(get_theme_mod('footer_listhovercolor')); ?>;
		}

		.scroll-top {
			color: <?php echo esc_attr(get_theme_mod('footer_scrolltotopiconcolor')); ?>;
		}

		.scroll-top {
			background: <?php echo esc_attr(get_theme_mod('footer_scrolltotopbgcolor')); ?>;
		}

		.scroll-top:hover {
			background: <?php echo esc_attr(get_theme_mod('footer_scrolltotopbghrvcolor')); ?>;
		}

		
	<?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 ($banner_disable_section == 1):
	?>
		#banner-section {
			display: none;
		}
	<?php
		else :
	?>
		#banner-section {
			display: block;
		}
	<?php endif; ?>


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


	</style>
	<?php
}
endif;
