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

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

			// General Setting

			if ( id === 'cinematic_videos_scroll_hide' || id === 'cinematic_videos_preloader_hide' || id === 'cinematic_videos_sticky_header' || id === 'cinematic_videos_products_per_row')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cinematic_videos_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Header Image

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

			//  Header

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

			// Slider

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

			// About Us

			if ( id === 'cinematic_videos_about_us_section_setting' || id === 'cinematic_videos_about_us_list_heading1' || id === 'cinematic_videos_about_us_button_text'  ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cinematic_videos_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

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

			// Post Setting

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

			// Single Post Setting

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

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

		// General Setting
		cinematic_videos_customizer_label( 'cinematic_videos_preloader_hide', 'Preloader' );
		cinematic_videos_customizer_label( 'cinematic_videos_sticky_header', 'Sticky Header' );
		cinematic_videos_customizer_label( 'cinematic_videos_scroll_hide', 'Scroll To Top' );
		cinematic_videos_customizer_label( 'cinematic_videos_products_per_row', 'woocommerce Setting' );

		// Colors
		cinematic_videos_customizer_label( 'cinematic_videos_first_color', 'Global Color' );
		cinematic_videos_customizer_label( 'background_color', 'Colors' );
		cinematic_videos_customizer_label( 'background_image', 'Image' );
		cinematic_videos_customizer_label( 'cinematic_videos_heading_color', 'Heading Typography' );
		cinematic_videos_customizer_label( 'cinematic_videos_paragraph_color', 'Paragraph Typography' );

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

		cinematic_videos_customizer_label( 'cinematic_videos_post_layout', 'Post Layouts Settings' );

		cinematic_videos_customizer_label( 'cinematic_videos_404_page_main_heading', '404 Page Settings' );

		// Header
		cinematic_videos_customizer_label( 'cinematic_videos_header_phone_number', 'Phone Number' );

		//Slider
		cinematic_videos_customizer_label( 'cinematic_videos_slider_section_setting', 'Slider' );
		cinematic_videos_customizer_label( 'cinematic_videos_banner_counter_number_1', 'Counter Box' );

		//About Us
		cinematic_videos_customizer_label( 'cinematic_videos_about_us_section_setting', 'About Us' );
		cinematic_videos_customizer_label( 'cinematic_videos_about_us_list_heading1', 'Lists' );
		cinematic_videos_customizer_label( 'cinematic_videos_about_us_button_text', 'About Button' );

		//Footer
		cinematic_videos_customizer_label( 'cinematic_videos_footer_bg_image', 'Footer' );
	
		// Post Setting
		cinematic_videos_customizer_label( 'cinematic_videos_post_page_title', 'Post Setting' );

		//Single Post Setting
		cinematic_videos_customizer_label( 'cinematic_videos_single_post_thumb', 'Single Post Setting' );

	});

})( jQuery );
