<?php

  $plumbing_contractor_theme_custom_setting_css = '';

	// Global Color
	$plumbing_contractor_theme_color = get_theme_mod('plumbing_contractor_theme_color', '#ffc527');

	$plumbing_contractor_theme_custom_setting_css .=':root {';
		$plumbing_contractor_theme_custom_setting_css .='--primary-theme-color: '.esc_attr($plumbing_contractor_theme_color ).'!important;';
	$plumbing_contractor_theme_custom_setting_css .='}';

	// Scroll to top alignment
	$plumbing_contractor_scroll_alignment = get_theme_mod('plumbing_contractor_scroll_alignment', 'right');

    if($plumbing_contractor_scroll_alignment == 'right'){
        $plumbing_contractor_theme_custom_setting_css .='.scroll-up{';
            $plumbing_contractor_theme_custom_setting_css .='right: 30px;!important;';
			$plumbing_contractor_theme_custom_setting_css .='left: auto;!important;';
        $plumbing_contractor_theme_custom_setting_css .='}';
    }else if($plumbing_contractor_scroll_alignment == 'center'){
        $plumbing_contractor_theme_custom_setting_css .='.scroll-up{';
            $plumbing_contractor_theme_custom_setting_css .='left: calc(50% - 10px) !important;';
        $plumbing_contractor_theme_custom_setting_css .='}';
    }else if($plumbing_contractor_scroll_alignment == 'left'){
        $plumbing_contractor_theme_custom_setting_css .='.scroll-up{';
            $plumbing_contractor_theme_custom_setting_css .='left: 30px;!important;';
			$plumbing_contractor_theme_custom_setting_css .='right: auto;!important;';
        $plumbing_contractor_theme_custom_setting_css .='}';
    }

	// Related Product

	$plumbing_contractor_show_related_product = get_theme_mod('plumbing_contractor_show_related_product', true );

	if($plumbing_contractor_show_related_product != true){
		$plumbing_contractor_theme_custom_setting_css .='.related.products{';
			$plumbing_contractor_theme_custom_setting_css .='display: none;';
		$plumbing_contractor_theme_custom_setting_css .='}';
	}  
	
	// Featured Image Hover Effect
    $plumbing_contractor_show_featured = get_theme_mod('plumbing_contractor_featured_image_hide_show', 1);
    $plumbing_contractor_hover_effect = get_theme_mod('plumbing_contractor_single_post_featured_image_hover','none');

    if ( $plumbing_contractor_show_featured && $plumbing_contractor_hover_effect !== 'none' ) {

    $plumbing_contractor_theme_custom_setting_css .= '
    .post-img img{
        transition: all 0.4s ease;
    }';

    if ( $plumbing_contractor_hover_effect === 'zoom-in' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img:hover img{
            transform: scale(1.2);
        }';
    }

    if ( $plumbing_contractor_hover_effect === 'zoom-out' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img img{ transform: scale(1.2); }
        .post-img:hover img{ transform: scale(1); }';
    }

    if ( $plumbing_contractor_hover_effect === 'grayscale' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img img{ filter: grayscale(100%); }
        .post-img:hover img{ filter: grayscale(0); }';
    }

    if ( $plumbing_contractor_hover_effect === 'sepia' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img:hover img{ filter: sepia(100%); }';
    }

    if ( $plumbing_contractor_hover_effect === 'blur' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img:hover img{ filter: blur(3px); }';
    }

    if ( $plumbing_contractor_hover_effect === 'bright' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img:hover img{ filter: brightness(1.3); }';
    }

    if ( $plumbing_contractor_hover_effect === 'translate' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img:hover img{ transform: translateY(-10px); }';
    }

    if ( $plumbing_contractor_hover_effect === 'scale' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .post-img:hover img{ transform: scale(1.1); }';
    }
}

// Product Featured Image Hover Effect
    $plumbing_contractor_show_featured = get_theme_mod('plumbing_contractor_featured_image_hide_show', 1);
    $plumbing_contractor_hover_effect = get_theme_mod('plumbing_contractor_product_featured_image_hover','none');

    if ( $plumbing_contractor_show_featured && $plumbing_contractor_hover_effect !== 'none' ) {

    $plumbing_contractor_theme_custom_setting_css .= '
    .product-img img{
        transition: all 0.4s ease;
    }';

    if ( $plumbing_contractor_hover_effect === 'zoom-in' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img:hover img{
            transform: scale(1.2);
        }';
    }

    if ( $plumbing_contractor_hover_effect === 'zoom-out' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img img{ transform: scale(1.2); }
        .product-img:hover img{ transform: scale(1); }';
    }

    if ( $plumbing_contractor_hover_effect === 'grayscale' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img img{ filter: grayscale(100%); }
        .product-img:hover img{ filter: grayscale(0); }';
    }

    if ( $plumbing_contractor_hover_effect === 'sepia' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img:hover img{ filter: sepia(100%); }';
    }

    if ( $plumbing_contractor_hover_effect === 'blur' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img:hover img{ filter: blur(3px); }';
    }

    if ( $plumbing_contractor_hover_effect === 'bright' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img:hover img{ filter: brightness(1.3); }';
    }

    if ( $plumbing_contractor_hover_effect === 'translate' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img:hover img{ transform: translateY(-10px); }';
    }

    if ( $plumbing_contractor_hover_effect === 'scale' ) {
        $plumbing_contractor_theme_custom_setting_css .= '
        .product-img:hover img{ transform: scale(1.1); }';
    }
}   
