<?php
/**
 * celebshine Redux Color Customization
 *
 * @package celebshine
 * @subpackage celebshine
 * @since celebshine 1.0
 */

/**
 * Redux Color Customization Function
 */
function celebshine_color_customization() {

	$celebshine_options = get_option( 'celebshine_options' );
	$custom_css = '';

	$primary_color   = $celebshine_options['primery-color'];
	$secondary_color = $celebshine_options['secondary-color'];
	$border_color  = $celebshine_options['border-color'];
	if( ! empty( $celebshine_options['opt-palette-color'] ) ){
		$color_palette = $celebshine_options['opt-palette-color'];
		if( $color_palette == "palettes-1" ){
			$primary_color   = "#a55e3f";
			$secondary_color = "#222222";	
		}elseif( $color_palette == "palettes-2" ){
			$primary_color   = "#da6647";
			$secondary_color = "#222222";
		}elseif( $color_palette == "palettes-3" ){
			$primary_color   = "#5b8567";
			$secondary_color = "#222222";	
		}elseif( $color_palette == "palettes-4" ){
			$primary_color   = "#567284";
			$secondary_color = "#222222";
		}elseif( $color_palette == "palettes-5" ){
			$primary_color   = "#e48531";
			$secondary_color = "#222222";
		}elseif( $color_palette == "palettes-6" ){																				
			$primary_color   = "#202220";
			$secondary_color = "#383b38";
		}
	}

	// Primary Color.
	if ( ! empty( $primary_color ) ) {

		$custom_css .= "
		.back-to-top:hover::after, .woocommerce-account .woocommerce .woocommerce-MyAccount-content h3 span a, .woocommerce-account .woocommerce a, .woocommerce-account #primary .woocommerce .woocommerce-MyAccount-navigation ul li.is-active a, .woocommerce-account #primary .woocommerce .woocommerce-MyAccount-navigation ul li a:hover, .woocommerce-account .woocommerce .woocommerce-MyAccount-content h3 strong, body .tt-section-title > .tt-section-wrap, body .tt-section-title > .tt-section-wrap > .section-heading, .tt-post-details .tt-post-title h2 a:hover, #gallary_tabs .category-name-wrap li.category-name.active a, .right-header .mini-cart .dropdown-menu-mini-cart .widget_shopping_cart_content .total .amount, .right-header .mini-cart .dropdown-menu-mini-cart .widget_shopping_cart_content .quantity .total, .right-header .mini-cart .dropdown-menu-mini-cart .widget_shopping_cart_content .total strong, .order_details .woocommerce-table__line-item .product-name a:hover, .right-header .mini-cart .dropdown-menu-mini-cart .widget_shopping_cart_content .quantity .total, .category-item-02 .cat_desc .wpcat-content .cat_total_product, .product .price, .single-product .entry-summary .product_title, footer .main-footer a:hover, .tt-feature-box:hover .tt-feature-box-containt .tt-feature-box-title, .tt-post-meta-wrap div a:hover,.nav-ticker p,.home-13.cms .tt-cms-block .cms-block-text .wpcms-block-content .button-cms-block .cms-block-button:hover,.blog-style .tt-post-details .tt-post-title a,.category-style5.style-2 .cat_desc:hover .wpcat-content .cat_name,.cms-17 .tt-section-sab,.home18-banner .tt-banner .banner-text a.banner-button,.blog-style.blog-style-6 .tt-post-more a,#page .blog-style .tt-post-title a:hover,.category-style8 .cat_desc .wpcat-content .cat_name:hover,.category-style7 .cat_desc .wpcat-content .cat_name:hover,.product-layout-morden .product .product-button-wrap .compare a.added::before,.product-layout-morden .product .product-button-wrap .btn-hv:hover a::before,.elementor-widget-blog-by-categories .blogs.style-2 .tt-post-wrapper .tt-post-title h6 a:hover,.elementor-widget-blog-by-categories .tt-post-wrapper .tt-post-title h6 a:hover,.elementor-widget-blog-by-categories .blogs.style-2 .cat-img .cat-name:hover span::before, .elementor-widget-blog-by-categories .blogs.style-2 .cat-img .cat-name:hover span::after, .elementor-widget-blog-by-categories .cat-img .cat-name:hover,product .wishlist.btn-hv a.yith-wcwl-add-to-wishlist-button--added::before, .product-layout-morden .product .wishlist.btn-hv .wishlist-fragment.exists a::before,.product-layout-morden .product .wishlist.btn-hv a.yith-wcwl-add-to-wishlist-button--added::before, .product-layout-morden .product .product-button-wrap .compare a.added::before
		{
            color: $primary_color;
		}";


		$custom_css .= "
		
		.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation ul li a::after, .single-product .stickycart-popup .cart-wrap .product-button, .category-grid.product-category .swiper-wrapper .swiper-slide > a .wpcat-content .cat_name::after, #yith-quick-view-modal .single-product .summary .cart .single_add_to_cart_button, .header-top-content, .pagination .page-numbers li .current, .pagination .page-numbers li > a:hover, .pagination .page-numbers li > a:active, .pagination .page-numbers li > a:focus, .woocommerce-active #primary .wc-block-attribute-filter ul li:hover label .wc-filter-element-label-list-count, .product-layout-classic .product .product-button-wrap .btn-hv::after, .header-top-content, .product-layout-classic .product .product-button-wrap .btn-hv::after, .header-top-content, .slider-buttom-04 .elementor-button::after, .woocommerce-checkout .woocommerce .checkout .order_review-wrap .order_review-bg #payment .place-order .button, .page .cart-content-right .checkout-button, footer.footer-style-2 .footer-top-section, .product-layout-morden .product .product-button::after, .tt-banner .banner-tag a, .header-swiper, .product-layout-classic .product .product-button-wrap .btn-hv a::after, .product-layout-classic .product .thumbnail-wrap .cart-quick-wrap .product-button-quickview .button::after, .list-view .product .cart-button-list .product-button-wrap .btn-hv::after, .short-view .product .list-content-wrap .list-cart-wrap .cart-button-list .product-button-wrap .btn-hv a::after, .header_style.site-header.header-style-2 #site-navigation ul.nav-menu > li.menu-item > a::after, .header_style.site-header.header-style-2 #site-navigation ul.nav-menu > li.menu-item:hover > a, .header_style.site-header.header-style-3 #site-navigation ul.nav-menu > li.menu-item > a::after, .header_style.site-header.header-style-3 #site-navigation ul.nav-menu > li.menu-item:hover > a, .right-header .mini-cart .dropdown-back .basket-item-count #mini-cart-count, .celebshine-sale span, .footer-style-3 .footer-top .footer-newsletter .news-title::before, .celebshine-sale span.label, .pagination .page-numbers li .current, .pagination .page-numbers li > a:hover, .pagination .page-numbers li > a:active, .pagination .page-numbers li > a:focus, .section-back-to-top:hover, footer .widget_block input[type='submit']:hover, input[type='submit']:hover, .tt-post-more a:hover::before, .tt-post-more a:focus::before, .tt-post-more a:active::before, .right-header .mini-cart .dropdown-menu-mini-cart .widget_shopping_cart_content .buttons .button.checkout,.nav-ticker p::before,footer.footer-style-3 .footer-top-section,.product-trending.tab-morden .ui-tabs-nav .ui-tabs-tab a::before,.product .product-button-wrap .compare a.added::before,.home18-banner .tt-banner .banner-text a.banner-button::after,.category-style7 .cat_desc:hover .wpcat-content::after,.coming-soon-page .footer-newsletter .newsletter-form [type='submit']:hover,.blog-style .tt-post-cat-title a,.blogBy-category-wrap .tt-post-cat-title a,.news-blog.news-blog-light .mc4wp-form .mc4wp-form-fields .news_letter button::after,.blogs.style-4 .tt-post-wrapper .tt-post-cat-title a,.news-blog .mc4wp-form .mc4wp-form-fields .news_letter button::after,footer .newsletter-form input[type='submit']:hover, .product .wishlist.btn-hv .wishlist-fragment.exists a::before,.wp-block-button__link,.woocommerce-active.archive .products.list-view .product .list-cart-wrap .product-button::after,.woocommerce-active.archive .products.short-view .product .list-cart-wrap .cart-wrap .product-button, .woocommerce-active.archive .products.list-view .product .list-cart-wrap .cart-wrap .product-button,.thumbnail-slider-style1 .single-product-thumbnail .images .product-360-slider-wrap .slider.nslick-slider i.nslick-arrow:hover,.thumbnail-slider-style1 .left-slider .single-product-thumbnail #nickx-gallery i.thumb_arrow.btn-next:hover, .single-product-thumbnail #nickx-gallery i.thumb_arrow.btn-next:hover, .thumbnail-slider-style1 .left-slider .single-product-thumbnail #nickx-gallery i.thumb_arrow.btn-prev:hover, .single-product-thumbnail #nickx-gallery i.thumb_arrow.btn-prev:hover,.single-product .summary .single_variation_wrap .woocommerce-variation-add-to-cart .single_add_to_cart_button,.btn.btn-primary, .single-product .product .entry-summary .cart-wrap .product-button::after,.single-product .site-main .xs_social_share_widget ul li a:hover,.single-product .prev_next_buttons .product-next-prev:hover a,.single-product .prev_next_buttons a:hover,.return-to-shop .btn.btn-secondary::after,.btn.btn-secondary,table.wishlist_table tbody td .cart-wrap, footer .social-media .btn-primary::after
		{
			background : $primary_color;
		}";

		$custom_css .= "
		.page .blog-style .tt-post-more a:hover, .pagination .page-numbers li .current, .pagination .page-numbers li > a:hover, .pagination .page-numbers li > a:active, .pagination .page-numbers li > a:focus, .pagination .page-numbers li .current, .pagination .page-numbers li > a:hover, .pagination .page-numbers li > a:active, .pagination .page-numbers li > a:focus,.home-13.cms .tt-cms-block .cms-block-text .wpcms-block-content .button-cms-block .cms-block-button:hover,.category-style2 .cat_desc:hover .cat_image_box::after,.category-style5.style-2 .cat_desc:hover .wpcat-content .cat_name,.product-layout-classic .ui-tabs-nav,.product-layout-morden .product .product-button:hover,.single-product .buy-now-wrap .button
		{ 
			  border-color: $primary_color; 
		}";

	}

	// Secondary Color.
	if ( ! empty( $secondary_color ) ) {

		$custom_css .= "
		h1, h2, h3, h4, h5, h6, #page .blog-style .tt-post-title a, .single-product .woocommerce-tabs ul.tabs li a:hover, .single-product .woocommerce-tabs ul.tabs li.active a, .product-layout-classic .product .thumbnail-wrap .cart-quick-wrap .product-button-quickview .button, #gallary_tabs .category-name-wrap li.category-name a, .tt-banner .banner-text a.banner-button, .tt-banner .banner-text, .site-wrap .main-navigation ul li a,.site-header #site-navigation ul.nav-menu li.menu-item a, .head-hamburger-menu svg, .right-header .mini-cart .dropdown-menu-mini-cart .shopping_cart_top .cart-title, .cart-slider .widget_shopping_cart_content p, .tt-post-details .tt-post-title h2 a, .tt-post-meta-wrap div a, .more-comment-wrap .tt-post-more a, .item .wpcat-content a, .tt-feature-box .tt-feature-box-containt .tt-feature-box-title, .ui-tabs-nav .ui-tabs-tab.ui-state-active a, .banner-timer .timer-head, .woocommerce.widget .widget-title, footer .widget-wrap .widget .widget-title, .single-product .product-estimate .delivery-shipping-wrap span, .woocommerce-tabs ul li a, .thumbnail-wrap .timer svg, .thumbnail-wrap .timer p.saleend, .woocommerce-cart .cart-content-left th, .woocommerce-cart .cart-content-left td .amount, .cart-content-right .cart-collaterals .cart_totals h2, section.product .product-button, #gallary_tabs .category-name-wrap li a, #gallary_tabs .category-button a, .testimonial-wrap .testimonial-info-wrapper .testimonial-title, .single-product .product-estimate .delivery-shipping-wrap .estimated-delivery::after, .single-product .product-estimate .delivery-shipping-wrap .free-shipping::after,.single-product .product_meta .sku_wrapper, .single-product .product_meta .posted_in, .single-product .product_meta .tagged_as, .single-categories span, .product a, .single-product .site-main .xs_social_share_widget ul li a span, #review_form_wrapper .comment-respond .comment-reply-title, .woocommerce .woocommerce-form-coupon-toggle .woocommerce-info a, .woocommerce-billing-fields h3, woocommerce-additional-fields h3, .order_review-bg #order_review_heading,.home18-banner .tt-banner .banner-text a.banner-button:hover,.category-style7 .cat_desc .wpcat-content .cat-svg svg,.marquee-20 .nav-ticker p,.elementor-widget-blog-by-categories .blogs.style-2 .tt-post-wrapper .tt-post-title h6 a,.elementor-widget-blog-by-categories .tt-post-wrapper .tt-post-title h6 a,.blogs.style-4 .tt-post-wrapper .tt-post-title h6 a,.single-product .recent-product .product-section-title, .related.products h3,.single-product .prev_next_buttons a svg,.woocommerce-checkout .woocommerce .checkout .order_review-wrap .shop_table tfoot .cart-subtotal td, .woocommerce-checkout .woocommerce .checkout .order_review-wrap .shop_table tfoot .cart-subtotal th,.woocommerce-checkout .woocommerce .checkout .order_review-wrap .shop_table thead th,.woocommerce-edit-address .woocommerce-Address .title h3,table.wishlist_table thead th .nobr,.wishlist_table .product-price .amount,.woocommerce-grouped-product-list-item__price .amount
		{ 
			color: $secondary_color; 
		}";


		$custom_css .= "
		.single-product .woocommerce-tabs ul.tabs li a::after, .woocommerce-checkout .woocommerce .checkout .order_review-wrap .order_review-bg #payment .place-order .button::after, .page .cart-content-right .checkout-button::after, .tt-banner .banner-tag a::after, .ui-tabs-nav .ui-tabs-tab a::before, .right-header .mini-cart .dropdown-menu-mini-cart .widget_shopping_cart_content .buttons .button.checkout::before, #gallary_tabs .category-button a::after, .single-product .single-product-thumbnail .celebshine-sale span.label,.cms-11 .elementor-button::after,#yith-quick-view-modal .single-product .summary .buy-now-wrap .single_add_to_cart_button,.home18-banner .tt-banner .banner-text a.banner-button:hover::after,.category-style7 .cat_desc .wpcat-content::after,.category-style7 .cat_desc .wpcat-content .cat_total_product,.woocommerce-active.archive .products.short-view .product .list-cart-wrap .product-button::after, .woocommerce-active.archive .products.list-view .product .list-cart-wrap .product-button::after,.single-product-thumbnail #nickx-gallery i.thumb_arrow,.thumbnail-slider-style1 .single-product-thumbnail .images .product-360-slider-wrap .slider.nslick-slider i.nslick-arrow,.single-product .buy-now-wrap .button:hover,.btn-primary::after, .single-product .product .entry-summary .cart-wrap .product-button, .product .product-button::after,.return-to-shop .btn.btn-secondary,table.wishlist_table tbody td .cart-wrap:after
		{
			background : $secondary_color;
		}";

		$custom_css .= "
		.single-product .buy-now-wrap .button:hover
		{
			border-color : $secondary_color;
		}";
	}

	// Border Color.
	if ( ! empty( $border_color ) ) {

		$custom_css .= " 
		.product .product-button-wrap .btn-hv::before
		{
			 background-color: $border_color; 
		} ";

		$custom_css .= " 
		.single-product .entry-summary .list-timer, .tt-post-meta-wrap, .header-style-3 .site-branding-wrap, .search-form input[type='search'], .widget.widget_search input[type='search'], .wp-block-search input[type='search'], .single-product .product .sticky-addToCart .quantity, .variations_form .variations td.value .select_box.attribute_pa_size .select_option span, table.wishlist_table tbody td, table.wishlist_table thead th, .woocommerce-account .woocommerce-MyAccount-content .edit-account fieldset, .woocommerce-account .woocommerce .woocommerce-MyAccount-navigation, .woocommerce-account .woocommerce #customer_login .u-column1, .woocommerce-checkout .woocommerce .checkout .order_review-wrap .shop_table th, .woocommerce-checkout .woocommerce .checkout .order_review-wrap .shop_table td, .woocommerce-cart .cart-content-left th, .woocommerce-cart .cart-content-left td, .woocommerce-cart .woocommerce-cart-form .product-quantity .quantity, .single-product .product .sticky-addToCart .quantity, .single-product.thumbnail-slider-style2 .woocommerce-tabs ul li, .single-product.thumbnail-slider-style3 .woocommerce-tabs ul li, .single-product .product .entry-summary .price, .single-product .product_meta, .single-product .woocommerce-tabs ul.tabs, .single-product .woocommerce-tabs, .woocommerce-active.archive .shop-sidebar .sidebar-filter .widget, .woocommerce-active.archive .shop-nosidebar .widget, .product-top-sorting .select-wrap select, .woocommerce .select2-container--default .select2-selection--single, .widget_block .wc-block-price-filter__title::after, .widget .wc-block-attribute-filter__title::after, .woocommerce.widget .widget-title::after, .widget .wc-block-attribute-filter .components-form-token-field, .product .product-button-wrap, .product .product-button-wrap .btn-hv::before, .right-header .mini-cart .dropdown-menu-mini-cart .cart-slider, .page-links a.post-page-numbers, footer.footer-style-3 .footer-top, footer .site-info .copyright, .pagination .page-numbers li>a, .pagination .page-numbers li>span, .comment-list li.comment .comment-body, #post_sidebar .widget ul li, #post_sidebar .widget ol li, .single-post .tt-post-details ul.wp-block-archives-list li, footer.site-footer, .wp-block-table.is-style-stripes, blockquote, .wp-block-quote.is-style-large, table, table td, table th, .woocommerce-active.single-post .tt-post-wrapper, .widget-area .widget, .blog .format-standard .tt-post-wrapper,.product-layout-morden .product .product-button-wrap
		{
			 border-color: $border_color; 
		} ";
		}


	wp_add_inline_style( 'celebshine-custom', $custom_css );
}
add_action( 'wp_enqueue_scripts', 'celebshine_color_customization', 10 );