<?php 

	$storecraft_custom_style = '';

	// Logo Size
	$storecraft_logo_top_padding = get_theme_mod('storecraft_logo_top_padding');
	$storecraft_logo_bottom_padding = get_theme_mod('storecraft_logo_bottom_padding');
	$storecraft_logo_left_padding = get_theme_mod('storecraft_logo_left_padding');
	$storecraft_logo_right_padding = get_theme_mod('storecraft_logo_right_padding');

	if( $storecraft_logo_top_padding != '' || $storecraft_logo_bottom_padding != '' || $storecraft_logo_left_padding != '' || $storecraft_logo_right_padding != ''){
		$storecraft_custom_style .=' .logo {';
			$storecraft_custom_style .=' padding-top: '.esc_attr($storecraft_logo_top_padding).'px; padding-bottom: '.esc_attr($storecraft_logo_bottom_padding).'px; padding-left: '.esc_attr($storecraft_logo_left_padding).'px; padding-right: '.esc_attr($storecraft_logo_right_padding).'px;';
		$storecraft_custom_style .=' }';
	}

	$storecraft_logo_size = get_theme_mod('storecraft_logo_size');
	if( $storecraft_logo_size != '') {
		if($storecraft_logo_size == 100) {
			$storecraft_custom_style .=' .custom-logo-link img {';
				$storecraft_custom_style .=' width: 350px;';
			$storecraft_custom_style .=' }';
		} else if($storecraft_logo_size >= 10 && $storecraft_logo_size < 100) {
			$storecraft_custom_style .=' .custom-logo-link img {';
				$storecraft_custom_style .=' width: '.esc_attr($storecraft_logo_size).'%;';
			$storecraft_custom_style .=' }';
		}
	}

	// Header Image
	$storecraft_header_image_url = storecraft_banner_image( '' );
	if( $storecraft_header_image_url != ''){
		$storecraft_custom_style .=' #inner-pages-header {';
			$storecraft_custom_style .=' background-image: url('. esc_url( $storecraft_header_image_url ).') !important; background-size: cover; background-repeat: no-repeat; background-attachment: fixed;';
		$storecraft_custom_style .=' }';

		$storecraft_custom_style .='  #header .top-head {';
			$storecraft_custom_style .=' background: none ';
		$storecraft_custom_style .=' }';
	} else {
		$storecraft_custom_style .=' #inner-pages-header {';
			$storecraft_custom_style .=' background: #ffffff; ';
		$storecraft_custom_style .=' }';
	}

	// Header & sidebar colors
	$storecraft_topbar_bg_color = get_theme_mod( 'storecraft_topbar_bg_color' );
	if ( $storecraft_topbar_bg_color != '' ) {
		$storecraft_custom_style .=' #header .hbs-topbar {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_topbar_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_topbar_text_color = get_theme_mod( 'storecraft_topbar_text_color' );
	if ( $storecraft_topbar_text_color != '' ) {
		$storecraft_custom_style .=' #header .hbs-topbar, #header .hbs-topbar-text {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_topbar_text_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_header_bg_color = get_theme_mod( 'storecraft_header_bg_color' );
	if ( $storecraft_header_bg_color != '' ) {
		$storecraft_custom_style .=' #header.hbs-header.hbs-header--solid, #header.hbs-header.is-scrolled .hbs-header-bar {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_header_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_headeraccicon_col = get_theme_mod( 'storecraft_headeraccicon_col' );
	if ( $storecraft_headeraccicon_col != '' ) {
		$storecraft_custom_style .=' #header .hbs-action-item, #header .hbs-currency-label, #header .hbs-mobile-toggle {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_headeraccicon_col ).';';
		$storecraft_custom_style .=' }';
		$storecraft_custom_style .=' #header .hbs-hamburger span {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_headeraccicon_col ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_header_title_color = get_theme_mod( 'storecraft_header_title_color' );
	if ( $storecraft_header_title_color != '' ) {
		$storecraft_custom_style .=' #header .hbs-site-name.site-title, #header h1.site-title {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_header_title_color ).' !important;';
		$storecraft_custom_style .=' }';
	}

	$storecraft_header_menu_color = get_theme_mod( 'storecraft_header_menu_color' );
	if ( $storecraft_header_menu_color != '' ) {
		$storecraft_custom_style .=' #header .hbs-primary-nav .hbs-nav-menu > li > a {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_header_menu_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_header_menu_hover_color = get_theme_mod( 'storecraft_header_menu_hover_color' );
	if ( $storecraft_header_menu_hover_color != '' ) {
		$storecraft_custom_style .=' #header .hbs-primary-nav .hbs-nav-menu > li:hover > a, #header .hbs-primary-nav .hbs-nav-menu > li.focus > a, #header .hbs-primary-nav .hbs-nav-menu > li.current-menu-item > a, #header .hbs-primary-nav .hbs-nav-menu > li.current_page_item > a {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_header_menu_hover_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_headercartnum_col = get_theme_mod( 'storecraft_headercartnum_col' );
	if ( $storecraft_headercartnum_col != '' ) {
		$storecraft_custom_style .=' #header .hbs-badge.count {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_headercartnum_col ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_headercartnumbg_col = get_theme_mod( 'storecraft_headercartnumbg_col' );
	if ( $storecraft_headercartnumbg_col != '' ) {
		$storecraft_custom_style .=' #header .hbs-badge.count {';
			$storecraft_custom_style .=' background-color:'.esc_attr( $storecraft_headercartnumbg_col ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_sidebar_bg_color = get_theme_mod( 'storecraft_sidebar_bg_color' );
	if ( $storecraft_sidebar_bg_color != '' ) {
		$storecraft_custom_style .=' .menu-modal.hbs-sidebar-menu .menu-modal-inner, .hbs-sidebar-panel {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_sidebar_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_sidebar_menu_color = get_theme_mod( 'storecraft_sidebar_menu_color' );
	if ( $storecraft_sidebar_menu_color != '' ) {
		$storecraft_custom_style .=' .hbs-sidebar-menu-list a, .hbs-sidebar-currency-label, .hbs-sidebar-currency-value, .hbs-sidebar-site-title, .hbs-sidebar-site-tagline, .hbs-sidebar-close {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_sidebar_menu_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_sidebar_menu_active_bg_color = get_theme_mod( 'storecraft_sidebar_menu_active_bg_color' );
	if ( $storecraft_sidebar_menu_active_bg_color != '' ) {
		$storecraft_custom_style .=' .hbs-sidebar-menu-list .current-menu-item > a, .hbs-sidebar-menu-list .current_page_item > a, .hbs-sidebar-menu-list .current-menu-ancestor > a {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_sidebar_menu_active_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_sidebar_social_color = get_theme_mod( 'storecraft_sidebar_social_color' );
	if ( $storecraft_sidebar_social_color != '' ) {
		$storecraft_custom_style .=' .hbs-sidebar-social a, .hbs-sidebar-social-icon {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_sidebar_social_color ).';';
		$storecraft_custom_style .=' }';
	}

	/* ---------- Homepage section colors ---------- */
	$storecraft_slider_title_color = get_theme_mod( 'storecraft_slider_title_color' );
	if ( $storecraft_slider_title_color != '' ) {
		$storecraft_custom_style .=' #slider .hbs-slider-title {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_slider_title_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_slider_subheading_color = get_theme_mod( 'storecraft_slider_subheading_color' );
	if ( $storecraft_slider_subheading_color != '' ) {
		$storecraft_custom_style .=' #slider .hbs-slider-subheading {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_slider_subheading_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_slider_text_color = get_theme_mod( 'storecraft_slider_text_color' );
	if ( $storecraft_slider_text_color != '' ) {
		$storecraft_custom_style .=' #slider .hbs-slider-description, #slider .content p.hbs-slider-description {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_slider_text_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_slider_btn_color = get_theme_mod( 'storecraft_slider_btn_color' );
	if ( $storecraft_slider_btn_color != '' ) {
		$storecraft_custom_style .=' #slider .sbtn1 {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_slider_btn_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_slider_btn_border_color = get_theme_mod( 'storecraft_slider_btn_border_color' );
	if ( $storecraft_slider_btn_border_color != '' ) {
		$storecraft_custom_style .=' #slider .sbtn1 {';
			$storecraft_custom_style .=' border-color:'.esc_attr( $storecraft_slider_btn_border_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_category_bg_color = get_theme_mod( 'storecraft_category_bg_color' );
	if ( $storecraft_category_bg_color != '' ) {
		$storecraft_custom_style .=' #productcategory-section {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_category_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_category_title_color = get_theme_mod( 'storecraft_category_title_color' );
	if ( $storecraft_category_title_color != '' ) {
		$storecraft_custom_style .=' #productcategory-section .hbs-section-title {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_category_title_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_category_name_color = get_theme_mod( 'storecraft_category_name_color' );
	if ( $storecraft_category_name_color != '' ) {
		$storecraft_custom_style .=' #productcategory-section .hbs-cat-name {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_category_name_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_products_bg_color = get_theme_mod( 'storecraft_products_bg_color' );
	if ( $storecraft_products_bg_color != '' ) {
		$storecraft_custom_style .=' #products-section {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_products_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_products_title_color = get_theme_mod( 'storecraft_products_title_color' );
	if ( $storecraft_products_title_color != '' ) {
		$storecraft_custom_style .=' #products-section .hbs-section-title {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_products_title_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_products_link_color = get_theme_mod( 'storecraft_products_link_color' );
	if ( $storecraft_products_link_color != '' ) {
		$storecraft_custom_style .=' #products-section .hbs-view-all-link {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_products_link_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_products_item_title_color = get_theme_mod( 'storecraft_products_item_title_color' );
	if ( $storecraft_products_item_title_color != '' ) {
		$storecraft_custom_style .=' #products-section .woocommerce-loop-product__title {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_products_item_title_color ).' !important;';
		$storecraft_custom_style .=' }';
	}

	$storecraft_products_price_color = get_theme_mod( 'storecraft_products_price_color' );
	if ( $storecraft_products_price_color != '' ) {
		$storecraft_custom_style .=' #products-section .price, #products-section .price ins {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_products_price_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_banner_bg_color = get_theme_mod( 'storecraft_banner_bg_color' );
	if ( $storecraft_banner_bg_color != '' ) {
		$storecraft_custom_style .=' #banner-section {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_banner_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_banner_kicker_color = get_theme_mod( 'storecraft_banner_kicker_color' );
	if ( $storecraft_banner_kicker_color != '' ) {
		$storecraft_custom_style .=' #banner-section .hbs-banner-kicker {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_banner_kicker_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_banner_title_color = get_theme_mod( 'storecraft_banner_title_color' );
	if ( $storecraft_banner_title_color != '' ) {
		$storecraft_custom_style .=' #banner-section .hbs-banner-title {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_banner_title_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_banner_text_color = get_theme_mod( 'storecraft_banner_text_color' );
	if ( $storecraft_banner_text_color != '' ) {
		$storecraft_custom_style .=' #banner-section .hbs-banner-text {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_banner_text_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_banner_btn_bg_color = get_theme_mod( 'storecraft_banner_btn_bg_color' );
	if ( $storecraft_banner_btn_bg_color != '' ) {
		$storecraft_custom_style .=' #banner-section .hbs-banner-btn--primary {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_banner_btn_bg_color ).'; border-color:'.esc_attr( $storecraft_banner_btn_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_banner_btn_text_color = get_theme_mod( 'storecraft_banner_btn_text_color' );
	if ( $storecraft_banner_btn_text_color != '' ) {
		$storecraft_custom_style .=' #banner-section .hbs-banner-btn--primary {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_banner_btn_text_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_banner_btn2_color = get_theme_mod( 'storecraft_banner_btn2_color' );
	if ( $storecraft_banner_btn2_color != '' ) {
		$storecraft_custom_style .=' #banner-section .hbs-banner-btn--secondary {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_banner_btn2_color ).'; border-color:'.esc_attr( $storecraft_banner_btn2_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_blog_bg_color = get_theme_mod( 'storecraft_blog_bg_color' );
	if ( $storecraft_blog_bg_color != '' ) {
		$storecraft_custom_style .=' #blogposts-section {';
			$storecraft_custom_style .=' background:'.esc_attr( $storecraft_blog_bg_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_blog_title_color = get_theme_mod( 'storecraft_blog_title_color' );
	if ( $storecraft_blog_title_color != '' ) {
		$storecraft_custom_style .=' #blogposts-section .hbs-section-title {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_blog_title_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_blog_link_color = get_theme_mod( 'storecraft_blog_link_color' );
	if ( $storecraft_blog_link_color != '' ) {
		$storecraft_custom_style .=' #blogposts-section .hbs-view-all-link {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_blog_link_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_blog_post_title_color = get_theme_mod( 'storecraft_blog_post_title_color' );
	if ( $storecraft_blog_post_title_color != '' ) {
		$storecraft_custom_style .=' #blogposts-section .hbs-blog-title, #blogposts-section .hbs-blog-title a {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_blog_post_title_color ).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_blog_meta_color = get_theme_mod( 'storecraft_blog_excerpt_color' );
	if ( $storecraft_blog_meta_color != '' ) {
		$storecraft_custom_style .=' #blogposts-section .hbs-blog-excerpt {';
			$storecraft_custom_style .=' color:'.esc_attr( $storecraft_blog_meta_color ).';';
		$storecraft_custom_style .=' }';
	}

	//site title tagline (Site Identity section)
	$storecraft_site_title_color = get_theme_mod('storecraft_site_title_color');
	if ( $storecraft_site_title_color != '') {
		$storecraft_custom_style .=' h1.site-title a, p.site-title a, .hbs-site-name.site-title{';
			$storecraft_custom_style .=' color:'.esc_attr($storecraft_site_title_color).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_site_tagline_color = get_theme_mod('storecraft_site_tagline_color');
	if ( $storecraft_site_tagline_color != '') {
		$storecraft_custom_style .=' p.site-description, .hbs-site-tagline.site-description{';
			$storecraft_custom_style .=' color:'.esc_attr($storecraft_site_tagline_color).';';
		$storecraft_custom_style .=' }';
	}
	
	//footer colors
	$storecraft_footertext_color = get_theme_mod('storecraft_footertext_color');
	if ( $storecraft_footertext_color != '') {
		$storecraft_custom_style .=' #colophon.hbs-footer, #colophon.hbs-footer p, #colophon.hbs-footer .hbs-footer-menu a, #colophon.hbs-footer .hbs-footer-newsletter-text, #colophon.hbs-footer .hbs-newsletter-consent {';
			$storecraft_custom_style .=' color: '.esc_attr($storecraft_footertext_color).';';
		$storecraft_custom_style .=' }';
		$storecraft_custom_style .=' #colophon.hbs-footer .hbs-footer-heading, #colophon.hbs-footer .hbs-footer-logo-name {';
			$storecraft_custom_style .=' color: '.esc_attr($storecraft_footertext_color).';';
		$storecraft_custom_style .=' }';
	}	

	$storecraft_footerbg_color = get_theme_mod('storecraft_footerbg_color');
	if ( $storecraft_footerbg_color != '') {
		$storecraft_custom_style .=' #colophon.hbs-footer:not(.hbs-footer-minimal) {';
			$storecraft_custom_style .=' background: '.esc_attr($storecraft_footerbg_color).';';
		$storecraft_custom_style .=' }';
		$storecraft_custom_style .=' #colophon.hbs-footer.hbs-footer-minimal {';
			$storecraft_custom_style .=' background: '.esc_attr($storecraft_footerbg_color).';';
		$storecraft_custom_style .=' }';
	}


	$storecraft_footercopyright_color = get_theme_mod('storecraft_footercopyright_color');
	if ( $storecraft_footercopyright_color != '') {
		$storecraft_custom_style .=' #colophon.hbs-footer .site-info p, #colophon.hbs-footer .site-info a, #colophon.hbs-footer .hbs-footer-minimal-text {';
			$storecraft_custom_style .=' color: '.esc_attr($storecraft_footercopyright_color).' !important;';
		$storecraft_custom_style .=' }';
	}

	$storecraft_footercopyrightbg_color = get_theme_mod('storecraft_footercopyrightbg_color');
	if ( $storecraft_footercopyrightbg_color != '') {
		$storecraft_custom_style .=' #colophon.hbs-footer .hbs-footer-bottom, #colophon.hbs-footer.hbs-footer-minimal {';
			$storecraft_custom_style .=' background: '.esc_attr($storecraft_footercopyrightbg_color).' !important;';
		$storecraft_custom_style .=' }';
	}

	$storecraft_footerscrolltotoptext_color = get_theme_mod('storecraft_footerscrolltotoptext_color');
	if ( $storecraft_footerscrolltotoptext_color != '') {
		$storecraft_custom_style .=' .back-to-top, .back-to-top .back-to-top-icon {';
			$storecraft_custom_style .=' color: '.esc_attr($storecraft_footerscrolltotoptext_color).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_footerscrolltotopbg_color = get_theme_mod('storecraft_footerscrolltotopbg_color');
	if ( $storecraft_footerscrolltotopbg_color != '') {
		$storecraft_custom_style .=' .back-to-top {';
			$storecraft_custom_style .=' background: '.esc_attr($storecraft_footerscrolltotopbg_color).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_footerscrolltotoptexthover_color = get_theme_mod('storecraft_footerscrolltotoptexthover_color');
	if ( $storecraft_footerscrolltotoptexthover_color != '') {
		$storecraft_custom_style .=' .back-to-top:hover, .back-to-top:focus-visible {';
			$storecraft_custom_style .=' color: '.esc_attr($storecraft_footerscrolltotoptexthover_color).';';
		$storecraft_custom_style .=' }';
	}

	$storecraft_footerscrolltotophover_color = get_theme_mod('storecraft_footerscrolltotophover_color');
	if ( $storecraft_footerscrolltotophover_color != '') {
		$storecraft_custom_style .=' .back-to-top:hover, .back-to-top:focus-visible {';
			$storecraft_custom_style .=' background: '.esc_attr($storecraft_footerscrolltotophover_color).';';
		$storecraft_custom_style .=' }';
	}