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

		var optPrefix = '#customize-control-villa_estate_zone_options-';
		
		// Label
		function villa_estate_zone_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-villa_estate_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Global Color Setting

			if ( id === 'villa_estate_zone_global_color' || id === 'villa_estate_zone_heading_color' || id === 'villa_estate_zone_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-villa_estate_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'villa_estate_zone_scroll_hide' || id === 'villa_estate_zone_preloader_hide' || id === 'villa_estate_zone_sticky_header' || id === 'villa_estate_zone_products_per_row' || id === 'villa_estate_zone_width_option' || id === 'villa_estate_zone_nav_menu_text_transform' )  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-villa_estate_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Header Image

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

			// Social Icon

			if ( id === 'villa_estate_zone_facebook_icon' || id === 'villa_estate_zone_twitter_icon' || id === 'villa_estate_zone_intagram_icon'|| id === 'villa_estate_zone_linkedin_icon'|| id === 'villa_estate_zone_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-villa_estate_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header

			if ( id === 'villa_estate_zone_header_button_text' || id === 'villa_estate_zone_header_search_setting'  || id === 'villa_estate_zone_topbar_location' || id === 'villa_estate_zone_topbar_email' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-villa_estate_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Slider

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

			// About Us

			if ( id === 'villa_estate_zone_about_us_short_heading' || id === 'villa_estate_zone_about_us_counter_icon' || id === 'villa_estate_zone_about_us_counter_icon_1' || id === 'villa_estate_zone_about_us_counter_icon_2' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-villa_estate_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

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

			// Post Setting

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

			// Single Post Setting

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

		// Social Icon
		villa_estate_zone_customizer_label( 'villa_estate_zone_facebook_icon', 'Facebook' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_twitter_icon', 'Twitter' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_intagram_icon', 'Intagram' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_linkedin_icon', 'Linkedin' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_pintrest_icon', 'Pintrest' );

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

		// Global Color Setting
		villa_estate_zone_customizer_label( 'villa_estate_zone_global_color', 'Global Color' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_heading_color', 'Heading Typography' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_paragraph_color', 'Paragraph Typography' );

		// General Setting
		villa_estate_zone_customizer_label( 'villa_estate_zone_preloader_hide', 'Preloader' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_sticky_header', 'Sticky Header' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_scroll_hide', 'Scroll To Top' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_products_per_row', 'woocommerce Setting' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_width_option', 'Site Width Layouts' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		villa_estate_zone_customizer_label( 'villa_estate_zone_theme_color', 'Theme Color' );
		villa_estate_zone_customizer_label( 'background_color', 'Colors' );
		villa_estate_zone_customizer_label( 'background_image', 'Image' );

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

		villa_estate_zone_customizer_label( 'villa_estate_zone_post_layout', 'Post Layouts Settings' );

		villa_estate_zone_customizer_label( 'villa_estate_zone_404_page_main_heading', '404 Page Settings' );

		// Header
		villa_estate_zone_customizer_label( 'villa_estate_zone_header_button_text', 'Header Button' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_topbar_email', 'Email Id' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_topbar_location', 'Location' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_header_search_setting', 'Header Search' );

		//Slider
		villa_estate_zone_customizer_label( 'villa_estate_zone_slider_short_heading', 'Slider' );

		//About Us
		villa_estate_zone_customizer_label( 'villa_estate_zone_about_us_short_heading', 'About Us' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_about_us_counter_icon', 'Counter Box 1' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_about_us_counter_icon_1', 'Counter Box 2' );
		villa_estate_zone_customizer_label( 'villa_estate_zone_about_us_counter_icon_2', 'Counter Box 3' );

		//Footer
		villa_estate_zone_customizer_label( 'villa_estate_zone_footer_bg_image', 'Footer' );
	
		// Post Setting
		villa_estate_zone_customizer_label( 'villa_estate_zone_post_page_title', 'Post Setting' );

		//Single Post Setting
		villa_estate_zone_customizer_label( 'villa_estate_zone_single_post_thumb', 'Single Post Setting' );

	});

})( jQuery );
