<?php

  $home_gadget_theme_custom_setting_css = '';

    // Global Color
    $home_gadget_first_theme_color = get_theme_mod('home_gadget_first_theme_color', '#129DB5');
    $home_gadget_second_theme_color = get_theme_mod('home_gadget_second_theme_color', '#DAE5E7');
    $home_gadget_third_theme_color = get_theme_mod('home_gadget_third_theme_color', '#1A1A1A');

    $home_gadget_theme_custom_setting_css .=':root {';
        $home_gadget_theme_custom_setting_css .='--primary-theme-color: '.esc_attr($home_gadget_first_theme_color ).'!important;';
        $home_gadget_theme_custom_setting_css .='--secondary-theme-color: '.esc_attr($home_gadget_second_theme_color ).'!important;';
        $home_gadget_theme_custom_setting_css .='--tertiary-theme-color: '.esc_attr($home_gadget_third_theme_color ).'!important;';
    $home_gadget_theme_custom_setting_css .='}';

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

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

    // Woocommerce Sale Position
    $home_gadget_sale_badge_position = get_theme_mod( 'home_gadget_sale_badge_position','right');
    if($home_gadget_sale_badge_position == 'left'){
        $home_gadget_theme_custom_setting_css .='.woocommerce ul.products li.product .onsale{';
            $home_gadget_theme_custom_setting_css .='left: 10px; right: auto;';
        $home_gadget_theme_custom_setting_css .='}';
    }else if($home_gadget_sale_badge_position == 'right'){
        $home_gadget_theme_custom_setting_css .='.woocommerce ul.products li.product .onsale{';
            $home_gadget_theme_custom_setting_css .='left: auto; right: 10px;';
        $home_gadget_theme_custom_setting_css .='}';
    }

    // Featured Image Hover Effect
    $home_gadget_show_featured = get_theme_mod('home_gadget_featured_image_hide_show', 1);
    $home_gadget_hover_effect = get_theme_mod('home_gadget_single_post_featured_image_hover','none');

    if ( $home_gadget_show_featured && $home_gadget_hover_effect !== 'none' ) {

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

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

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

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

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

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

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

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

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

// Product Featured Image Hover Effect
    $home_gadget_show_featured = get_theme_mod('home_gadget_featured_image_hide_show', 1);
    $home_gadget_hover_effect = get_theme_mod('home_gadget_product_featured_image_hover','none');

    if ( $home_gadget_show_featured && $home_gadget_hover_effect !== 'none' ) {

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

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

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

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

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

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

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

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

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