<?php 
	$dairy_farming_custom_css ='';

/*----------------Related Product show/hide -------------------*/

$dairy_farming_enable_related_product = get_theme_mod('dairy_farming_enable_related_product',1);

	if($dairy_farming_enable_related_product == 0){
		$dairy_farming_custom_css .='.related.products{';
			$dairy_farming_custom_css .='display: none;';
		$dairy_farming_custom_css .='}';
	}

/*----------------blog post content alignment -------------------*/

$dairy_farming_blog_Post_content_layout = get_theme_mod( 'dairy_farming_blog_Post_content_layout','Left');
    if($dairy_farming_blog_Post_content_layout == 'Left'){
		$dairy_farming_custom_css .='.ct-post-wrapper .card-item {';
			$dairy_farming_custom_css .='text-align:start;';
		$dairy_farming_custom_css .='}';
	}else if($dairy_farming_blog_Post_content_layout == 'Center'){
		$dairy_farming_custom_css .='.ct-post-wrapper .card-item {';
			$dairy_farming_custom_css .='text-align:center;';
		$dairy_farming_custom_css .='}';
	}else if($dairy_farming_blog_Post_content_layout == 'Right'){
		$dairy_farming_custom_css .='.ct-post-wrapper .card-item {';
			$dairy_farming_custom_css .='text-align:end;';
		$dairy_farming_custom_css .='}';
	}

	/*--------------------------- Footer background image -------------------*/

    $dairy_farming_footer_bg_image = get_theme_mod('dairy_farming_footer_bg_image');
    if($dairy_farming_footer_bg_image != false){
        $dairy_farming_custom_css .='.footer-top{';
            $dairy_farming_custom_css .='background: url('.esc_attr($dairy_farming_footer_bg_image).');';
        $dairy_farming_custom_css .='}';
    }

	/*--------------------------- Go to top positions -------------------*/

    $dairy_farming_go_to_top_position = get_theme_mod( 'dairy_farming_go_to_top_position','Right');
    if($dairy_farming_go_to_top_position == 'Right'){
        $dairy_farming_custom_css .='.footer-go-to-top{';
            $dairy_farming_custom_css .='right: 20px;';
        $dairy_farming_custom_css .='}';
    }else if($dairy_farming_go_to_top_position == 'Left'){
        $dairy_farming_custom_css .='.footer-go-to-top{';
            $dairy_farming_custom_css .='left: 20px;';
        $dairy_farming_custom_css .='}';
    }else if($dairy_farming_go_to_top_position == 'Center'){
        $dairy_farming_custom_css .='.footer-go-to-top{';
            $dairy_farming_custom_css .='right: 50%;left: 50%;';
        $dairy_farming_custom_css .='}';
    }

    /*--------------------------- Woocommerce Product Sale Positions -------------------*/

    $dairy_farming_product_sale = get_theme_mod( 'dairy_farming_woocommerce_product_sale','Right');
    if($dairy_farming_product_sale == 'Right'){
        $dairy_farming_custom_css .='.woocommerce ul.products li.product .onsale{';
            $dairy_farming_custom_css .='left: auto; ';
        $dairy_farming_custom_css .='}';
    }else if($dairy_farming_product_sale == 'Left'){
        $dairy_farming_custom_css .='.woocommerce ul.products li.product .onsale{';
            $dairy_farming_custom_css .='right: auto;left:0;';
        $dairy_farming_custom_css .='}';
    }else if($dairy_farming_product_sale == 'Center'){
        $dairy_farming_custom_css .='.woocommerce ul.products li.product .onsale{';
            $dairy_farming_custom_css .='right: 50%; left: 50%; ';
        $dairy_farming_custom_css .='}';
    }

    /*-------------------- Primary Color -------------------*/

	$dairy_farming_primary_color = get_theme_mod('dairy_farming_primary_color', '#3c3531'); // Add a fallback if the color isn't set

	if ($dairy_farming_primary_color) {
		$dairy_farming_custom_css .= ':root {';
		$dairy_farming_custom_css .= '--primary-color: ' . esc_attr($dairy_farming_primary_color) . ';';
		$dairy_farming_custom_css .= '}';
	}

    /*-------------------- Secondary Color -------------------*/

	$dairy_farming_secondary_color = get_theme_mod('dairy_farming_secondary_color', '#5b8c51'); // Add a fallback if the color isn't set

	if ($dairy_farming_secondary_color) {
		$dairy_farming_custom_css .= ':root {';
		$dairy_farming_custom_css .= '--secondary-color: ' . esc_attr($dairy_farming_secondary_color) . ';';
		$dairy_farming_custom_css .= '}';
	}

    /*----------------Enable/Disable Breadcrumbs -------------------*/

    $dairy_farming_enable_breadcrumbs = get_theme_mod('dairy_farming_enable_breadcrumbs',1);

    if($dairy_farming_enable_breadcrumbs == 0){
        $dairy_farming_custom_css .='.dairy-farming-breadcrumbs, nav.woocommerce-breadcrumb{';
            $dairy_farming_custom_css .='display: none;';
        $dairy_farming_custom_css .='}';
    }