<?php 
    $handyman_agency_custom_css = '';

    /*----------------Related Product show/hide -------------------*/
    $handyman_agency_enable_related_product = get_theme_mod('handyman_agency_enable_related_product', 1);
    if ($handyman_agency_enable_related_product == 0) {
        $handyman_agency_custom_css .= '.related.products{';
        $handyman_agency_custom_css .= 'display: none;';
        $handyman_agency_custom_css .= '}';
    }

    /*----------------blog post content alignment -------------------*/
    $handyman_agency_blog_Post_content_layout = get_theme_mod('handyman_agency_blog_Post_content_layout', 'Left');
    if ($handyman_agency_blog_Post_content_layout == 'Left') {
        $handyman_agency_custom_css .= '.ct-post-wrapper .card-item {';
        $handyman_agency_custom_css .= 'text-align:start;';
        $handyman_agency_custom_css .= '}';
    } elseif ($handyman_agency_blog_Post_content_layout == 'Center') {
        $handyman_agency_custom_css .= '.ct-post-wrapper .card-item {';
        $handyman_agency_custom_css .= 'text-align:center;';
        $handyman_agency_custom_css .= '}';
    } elseif ($handyman_agency_blog_Post_content_layout == 'Right') {
        $handyman_agency_custom_css .= '.ct-post-wrapper .card-item {';
        $handyman_agency_custom_css .= 'text-align:end;';
        $handyman_agency_custom_css .= '}';
    }

    /*--------------------------- Footer background image -------------------*/
    $handyman_agency_footer_bg_image = get_theme_mod('handyman_agency_footer_bg_image');
    if ($handyman_agency_footer_bg_image) {
        $handyman_agency_custom_css .= '.footer-top{';
        $handyman_agency_custom_css .= 'background: url(' . esc_attr($handyman_agency_footer_bg_image) . ');';
        $handyman_agency_custom_css .= '}';
    }

    /*--------------------------- Go to top positions -------------------*/
    $handyman_agency_go_to_top_position = get_theme_mod('handyman_agency_go_to_top_position', 'Right');
    if ($handyman_agency_go_to_top_position == 'Right') {
        $handyman_agency_custom_css .= '.footer-go-to-top{';
        $handyman_agency_custom_css .= 'right: 20px;';
        $handyman_agency_custom_css .= '}';
    } elseif ($handyman_agency_go_to_top_position == 'Left') {
        $handyman_agency_custom_css .= '.footer-go-to-top{';
        $handyman_agency_custom_css .= 'left: 20px;';
        $handyman_agency_custom_css .= '}';
    } elseif ($handyman_agency_go_to_top_position == 'Center') {
        $handyman_agency_custom_css .= '.footer-go-to-top{';
        $handyman_agency_custom_css .= 'right: 50%; left: 50%;';
        $handyman_agency_custom_css .= '}';
    }

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

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

    /*-------------------- Primary Color -------------------*/
    $handyman_agency_primary_color = get_theme_mod('handyman_agency_primary_color', '#008BF9');
    if ($handyman_agency_primary_color) {
        $handyman_agency_custom_css .= ':root {';
        $handyman_agency_custom_css .= '--primary-color: ' . esc_attr($handyman_agency_primary_color) . ';';
        $handyman_agency_custom_css .= '}';
    }

    /*-------------------- Secondary Color -------------------*/
    $handyman_agency_secondary_color = get_theme_mod('handyman_agency_secondary_color', '#000');
    if ($handyman_agency_secondary_color) {
        $handyman_agency_custom_css .= ':root {';
        $handyman_agency_custom_css .= '--secondary-color: ' . esc_attr($handyman_agency_secondary_color) . ';';
        $handyman_agency_custom_css .= '}';
    }


    /*-------------------- Secondary Color -------------------*/
    $handyman_agency_third_color = get_theme_mod('handyman_agency_third_color', '#FFC527');
    if ($handyman_agency_third_color) {
        $handyman_agency_custom_css .= ':root {';
        $handyman_agency_custom_css .= '--tertiary-color: ' . esc_attr($handyman_agency_third_color) . ';';
        $handyman_agency_custom_css .= '}';
    }

    /*--------------------------- Slider -------------------*/
    $handyman_agency_enable_slider = get_theme_mod('handyman_agency_enable_slider', false);
    if ($handyman_agency_enable_slider == false) {
        $handyman_agency_custom_css .= '.page-template-revolution-home .headermain{';
        $handyman_agency_custom_css .= 'position:static; background-color:#000;';
        $handyman_agency_custom_css .= '}';
    }

    // Output custom CSS if any
    if (!empty($handyman_agency_custom_css)) {
        wp_add_inline_style('handyman-agency-style', $handyman_agency_custom_css);
    }

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

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

    if($handyman_agency_enable_breadcrumbs == 0){
        $handyman_agency_custom_css .='.handyman-agency-breadcrumbs, nav.woocommerce-breadcrumb{';
            $handyman_agency_custom_css .='display: none;';
        $handyman_agency_custom_css .='}';
    }