<?php 
	$forest_safari_custom_css ='';

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

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

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

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

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

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

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

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

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

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

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

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

	$forest_safari_primary_color = get_theme_mod('forest_safari_primary_color', '#057357'); // Add a fallback if the color isn't set

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

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

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

    if($forest_safari_enable_breadcrumbs == 0){
        $forest_safari_custom_css .='.forest-safari-breadcrumbs, nav.woocommerce-breadcrumb{';
            $forest_safari_custom_css .='display: none;';
        $forest_safari_custom_css .='}';
    }