<?php 
	$carpets_and_rugs_custom_css ='';

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

    $carpets_and_rugs_footer_attachment = get_theme_mod( 'carpets_and_rugs_menu_text_transform','capitalize');
    if($carpets_and_rugs_footer_attachment == 'uppercase'){
        $carpets_and_rugs_custom_css .='.main-navigation ul#primary-menu>li>a, .main-navigation div#primary-menu>ul>li>a{';
            $carpets_and_rugs_custom_css .='text-transform: uppercase;';
        $carpets_and_rugs_custom_css .='}';
    }elseif ($carpets_and_rugs_footer_attachment == 'capitalize'){
        $carpets_and_rugs_custom_css .='.main-navigation ul#primary-menu>li>a, .main-navigation div#primary-menu>ul>li>a{';
            $carpets_and_rugs_custom_css .='text-transform: capitalize;';
        $carpets_and_rugs_custom_css .='}';
    }elseif ($carpets_and_rugs_footer_attachment == 'lowercase'){
        $carpets_and_rugs_custom_css .='.main-navigation ul#primary-menu>li>a, .main-navigation div#primary-menu>ul>li>a{';
            $carpets_and_rugs_custom_css .='text-transform: lowercase;';
        $carpets_and_rugs_custom_css .='}';
    }

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

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

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

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

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

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

    $carpets_and_rugs_footer_bg_image = get_theme_mod('carpets_and_rugs_footer_bg_image');
    if($carpets_and_rugs_footer_bg_image != false){
        $carpets_and_rugs_custom_css .= '.footer-top{';
        $carpets_and_rugs_custom_css .= 'background-image:url(' . esc_url($carpets_and_rugs_footer_bg_image) . ');';
        $carpets_and_rugs_custom_css .= 'background-size: cover;';
        $carpets_and_rugs_custom_css .= 'background-repeat:no-repeat;';
        $carpets_and_rugs_custom_css .= '}';
    }

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

    $carpets_and_rugs_footer_attachment = get_theme_mod( 'carpets_and_rugs_background_attachment','scroll');
    if($carpets_and_rugs_footer_attachment == 'fixed'){
        $carpets_and_rugs_custom_css .='.footer-top{';
            $carpets_and_rugs_custom_css .='background-attachment: fixed;';
        $carpets_and_rugs_custom_css .='}';
    }elseif ($carpets_and_rugs_footer_attachment == 'scroll'){
        $carpets_and_rugs_custom_css .='.footer-top{';
            $carpets_and_rugs_custom_css .='background-attachment: scroll;';
        $carpets_and_rugs_custom_css .='}';
    }

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

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

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

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

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

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

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

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

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

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

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

    if($carpets_and_rugs_enable_breadcrumbs == 0){
        $carpets_and_rugs_custom_css .='.carpets-and-rugs-breadcrumbs, nav.woocommerce-breadcrumb{';
            $carpets_and_rugs_custom_css .='display: none;';
        $carpets_and_rugs_custom_css .='}';
    }