(function( $ ) {
	wp.customize.bind( 'ready', function() {

		var optPrefix = '#customize-control-ecommerce_zone_options-';
		
		// Label
		function ecommerce_zone_customizer_label( id, title ) {

			// Colors

			if ( id === 'ecommerce_zone_theme_color' || id === 'background_color' || id === 'background_image' || id === 'ecommerce_zone_heading_color' || id === 'ecommerce_zone_paragraph_color' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Site Identity

			if ( id === 'custom_logo' || id === 'site_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Top Header

			if ( id === 'retailer_market_free_delivery_text' || id === 'retailer_market_privacy_policy_text' || id === 'retailer_market_sale_btn_text') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'ecommerce_zone_preloader_hide' || id === 'ecommerce_zone_sticky_header' || id === 'ecommerce_zone_scroll_hide' || id === 'ecommerce_zone_woocommerce_shop_page_sidebar') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Woocommerce product sale Setting

			if ( id === 'ecommerce_zone_woocommerce_product_sale' || id === 'ecommerce_zone_woo_product_border_radius') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Social Icon

			if ( id === 'retailer_market_facebook_icon' || id === 'retailer_market_twitter_icon' || id === 'retailer_market_instagram_icon'|| id === 'retailer_market_linkedin_icon'|| id === 'retailer_market_pinterest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-retailer_market_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Slider

			if ( id === 'ecommerce_zone_top_slider_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Header Image

			if ( id === 'header_image' || id === 'ecommerce_zone_post_layout' || id === 'ecommerce_zone_404_page_main_heading' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
			// Category Product

			if ( id === 'ecommerce_zone_category_product_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Home Product Category

			if ( id === 'ecommerce_zone_home_product_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Blog

			if ( id === 'ecommerce_zone_blog_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

			if ( id === 'ecommerce_zone_show_hide_footer' || id === 'ecommerce_zone_show_hide_copyright') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Setting

			if ( id === 'ecommerce_zone_single_post_thumb' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Comment Setting

			if ( id === 'ecommerce_zone_single_post_comment_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Post Setting

			if ( id === 'ecommerce_zone_post_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Page Setting

			if ( id === 'ecommerce_zone_single_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ecommerce_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
		}


		// Colors
		ecommerce_zone_customizer_label( 'ecommerce_zone_theme_color', 'Theme Color' );
		ecommerce_zone_customizer_label( 'background_color', 'Colors' );
		ecommerce_zone_customizer_label( 'background_image', 'Image' );

		// Site Identity
		ecommerce_zone_customizer_label( 'custom_logo', 'Logo Setup' );
		ecommerce_zone_customizer_label( 'site_icon', 'Favicon' );

		// Top Header
		ecommerce_zone_customizer_label( 'retailer_market_free_delivery_text', 'Free Delivery' );
		ecommerce_zone_customizer_label( 'retailer_market_privacy_policy_text', 'Privacy Policy' );
		ecommerce_zone_customizer_label( 'retailer_market_sale_btn_text', 'Sale Button' );

		// General Setting
		ecommerce_zone_customizer_label( 'ecommerce_zone_preloader_hide', 'Preloader' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_sticky_header', 'Sticky Header' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_scroll_hide', 'Scroll To Top' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_woocommerce_shop_page_sidebar', 'Woocommerce Settings' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_woocommerce_product_sale', 'Woocommerce Product Sale' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_woo_product_border_radius', 'Woocommerce Product Border Radius' );

		// Social Icon
		ecommerce_zone_customizer_label( 'retailer_market_facebook_icon', 'Facebook' );
		ecommerce_zone_customizer_label( 'retailer_market_twitter_icon', 'Twitter' );
		ecommerce_zone_customizer_label( 'retailer_market_instagram_icon', 'Intagram' );
		ecommerce_zone_customizer_label( 'retailer_market_linkedin_icon', 'Linkedin' );
		ecommerce_zone_customizer_label( 'retailer_market_pinterest_icon', 'Pintrest' );


		//Slider
		ecommerce_zone_customizer_label( 'ecommerce_zone_top_slider_setting', 'Product Slider' );

		//Header Image
		ecommerce_zone_customizer_label( 'header_image', 'Header Image' );

		ecommerce_zone_customizer_label( 'ecommerce_zone_heading_color', 'Heading Typography' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_paragraph_color', 'Paragraph Typography' );

		ecommerce_zone_customizer_label( 'ecommerce_zone_post_layout', 'Post Layouts Settings' );

		ecommerce_zone_customizer_label( 'ecommerce_zone_404_page_main_heading', '404 Page Settings' );

		//Top Category Product
		ecommerce_zone_customizer_label( 'ecommerce_zone_category_product_setting', 'Category Product' );

		//Home Product Category
		ecommerce_zone_customizer_label( 'ecommerce_zone_home_product_setting', 'Home Product Category' );

		//Blog
		ecommerce_zone_customizer_label( 'ecommerce_zone_blog_setting', 'Blog Settings' );

		//Footer
		ecommerce_zone_customizer_label( 'ecommerce_zone_show_hide_footer', 'Footer' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_show_hide_copyright', 'Copyright' );

		//Single Post Setting
		ecommerce_zone_customizer_label( 'ecommerce_zone_single_post_thumb', 'Single Post Setting' );
		ecommerce_zone_customizer_label( 'ecommerce_zone_single_post_comment_title', 'Single Post Comment' );

		// Post Setting
		ecommerce_zone_customizer_label( 'ecommerce_zone_post_page_title', 'Post Setting' );

		// Page Setting
		ecommerce_zone_customizer_label( 'ecommerce_zone_single_page_title', 'Page Setting' );
	

	}); 

})( jQuery );
