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

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

			// Site Identity

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

			// Global Color Setting

			if ( id === 'deep_cleaning_global_color' || id === 'deep_cleaning_heading_color' || id === 'deep_cleaning_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-deep_cleaning_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'deep_cleaning_scroll_hide' || id === 'deep_cleaning_preloader_hide' || id === 'deep_cleaning_sticky_header' || id === 'deep_cleaning_products_per_row' || id === 'deep_cleaning_scroll_top_position' || id === 'deep_cleaning_products_per_row' || id === 'deep_cleaning_width_option' || id === 'deep_cleaning_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-deep_cleaning_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Header Image

			if ( id === 'header_image' || id === 'deep_cleaning_post_layout' || id === 'deep_cleaning_404_page_main_heading' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-deep_cleaning_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Social Icon

			if ( id === 'deep_cleaning_facebook_icon' || id === 'deep_cleaning_twitter_icon' || id === 'deep_cleaning_intagram_icon'|| id === 'deep_cleaning_linkedin_icon'|| id === 'deep_cleaning_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-deep_cleaning_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

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


			// Slider

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

			// Products

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

			// Footer

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

			// Post Settings

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

			// Single Post Settings

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

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

		// Global Color Setting
		deep_cleaning_customizer_label( 'deep_cleaning_global_color', 'Global Color' );
		deep_cleaning_customizer_label( 'deep_cleaning_heading_color', 'Heading Typography' );
		deep_cleaning_customizer_label( 'deep_cleaning_paragraph_color', 'Paragraph Typography' );

		// General Setting
		deep_cleaning_customizer_label( 'deep_cleaning_preloader_hide', 'Preloader' );
		deep_cleaning_customizer_label( 'deep_cleaning_scroll_hide', 'Scroll To Top' );
		deep_cleaning_customizer_label( 'deep_cleaning_scroll_top_position', 'Scroll to top Position' );
		deep_cleaning_customizer_label( 'deep_cleaning_products_per_row', 'woocommerce Setting' );
		deep_cleaning_customizer_label( 'deep_cleaning_width_option', 'Site Width Layouts' );
		deep_cleaning_customizer_label( 'deep_cleaning_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		deep_cleaning_customizer_label( 'deep_cleaning_theme_color', 'Theme Color' );
		deep_cleaning_customizer_label( 'background_color', 'Colors' );
		deep_cleaning_customizer_label( 'background_image', 'Image' );

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

		deep_cleaning_customizer_label( 'deep_cleaning_post_layout', 'Post Layouts Settings' );

		deep_cleaning_customizer_label( 'deep_cleaning_404_page_main_heading', '404 Page Settings' );

		// Social Icon
		deep_cleaning_customizer_label( 'deep_cleaning_facebook_icon', 'Facebook' );
		deep_cleaning_customizer_label( 'deep_cleaning_twitter_icon', 'Twitter' );
		deep_cleaning_customizer_label( 'deep_cleaning_intagram_icon', 'Intagram' );
		deep_cleaning_customizer_label( 'deep_cleaning_linkedin_icon', 'Linkedin' );
		deep_cleaning_customizer_label( 'deep_cleaning_pintrest_icon', 'Pintrest' );

		// Header 
		deep_cleaning_customizer_label( 'deep_cleaning_topbar_phone_number', 'Phone Number' );

		//Slider
		deep_cleaning_customizer_label( 'deep_cleaning_slider_section_setting', 'Slider' );

		//Products
		deep_cleaning_customizer_label( 'deep_cleaning_categories_section_setting', 'Our Team' );

		//Footer
		deep_cleaning_customizer_label( 'deep_cleaning_footer_widget_content_alignment', 'Footer' );
		deep_cleaning_customizer_label( 'deep_cleaning_show_hide_copyright', 'Copyright' );

		//Post setting
		deep_cleaning_customizer_label( 'deep_cleaning_post_page_title', 'Post Settings' );

		//Single post setting
		deep_cleaning_customizer_label( 'deep_cleaning_single_post_thumb', 'Single Post Settings' );
	

	});

})( jQuery );
