<?php 
    $butcher_meatshop_custom_css = '';

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

    $butcher_meatshop_secondary_color = get_theme_mod('butcher_meatshop_secondary_color', '#001c27'); // Add a fallback if the color isn't set

    if ($butcher_meatshop_secondary_color) {
        $butcher_meatshop_custom_css .= ':root {';
        $butcher_meatshop_custom_css .= '--secondary-color: ' . esc_attr($butcher_meatshop_secondary_color) . ';';
        $butcher_meatshop_custom_css .= '}';
    }
    
    /*----------------Enable/Disable Breadcrumbs -------------------*/

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

    if($butcher_meatshop_enable_breadcrumbs == 0){
        $butcher_meatshop_custom_css .='.butcher-meatshop-breadcrumbs, nav.woocommerce-breadcrumb{';
            $butcher_meatshop_custom_css .='display: none;';
        $butcher_meatshop_custom_css .='}';
    }