<?php 
    $butcher_meatshop_custom_css = '';

    /*--------------------------- Menu Text Transform -------------------*/

    $butcher_meatshop_footer_attachment = get_theme_mod( 'butcher_meatshop_menu_text_transform','capitalize');
    if($butcher_meatshop_footer_attachment == 'uppercase'){
        $butcher_meatshop_custom_css .='.main-navigation ul#primary-menu>li>a, .main-navigation div#primary-menu>ul>li>a{';
            $butcher_meatshop_custom_css .='text-transform: uppercase;';
        $butcher_meatshop_custom_css .='}';
    }elseif ($butcher_meatshop_footer_attachment == 'capitalize'){
        $butcher_meatshop_custom_css .='.main-navigation ul#primary-menu>li>a, .main-navigation div#primary-menu>ul>li>a{';
            $butcher_meatshop_custom_css .='text-transform: capitalize;';
        $butcher_meatshop_custom_css .='}';
    }elseif ($butcher_meatshop_footer_attachment == 'lowercase'){
        $butcher_meatshop_custom_css .='.main-navigation ul#primary-menu>li>a, .main-navigation div#primary-menu>ul>li>a{';
            $butcher_meatshop_custom_css .='text-transform: lowercase;';
        $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-image:url(' . esc_url($butcher_meatshop_footer_bg_image) . ');';
        $butcher_meatshop_custom_css .= 'background-size: cover;';
        $butcher_meatshop_custom_css .= 'background-repeat:no-repeat;';
        $butcher_meatshop_custom_css .= '}';
    }

    /*--------------------------- Footer Background Image Attachment -------------------*/

    $butcher_meatshop_footer_attachment = get_theme_mod( 'butcher_meatshop_background_attachment','scroll');
    if($butcher_meatshop_footer_attachment == 'fixed'){
        $butcher_meatshop_custom_css .='.footer-top{';
            $butcher_meatshop_custom_css .='background-attachment: fixed;';
        $butcher_meatshop_custom_css .='}';
    }elseif ($butcher_meatshop_footer_attachment == 'scroll'){
        $butcher_meatshop_custom_css .='.footer-top{';
            $butcher_meatshop_custom_css .='background-attachment: scroll;';
        $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 .='}';
    }