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

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

			// Global Color Setting

			if ( id === 'recipe_maker_global_color' || id === 'recipe_maker_heading_color' || id === 'recipe_maker_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-recipe_maker_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'recipe_maker_scroll_hide' || id === 'recipe_maker_preloader_hide' || id === 'recipe_maker_sticky_header' || id === 'recipe_maker_products_per_row' || id === 'recipe_maker_scroll_top_position' || id === 'recipe_maker_products_per_row' || id === 'recipe_maker_width_option' || id === 'recipe_maker_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-recipe_maker_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Header Image

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

			// Social Icon

			if ( id === 'recipe_maker_facebook_icon' || id === 'recipe_maker_twitter_icon' || id === 'recipe_maker_intagram_icon'|| id === 'recipe_maker_linkedin_icon'|| id === 'recipe_maker_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-recipe_maker_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header
			
			if ( id === 'recipe_maker_top_header_about_us_button_text' || id === 'recipe_maker_topbar_text' || id === 'recipe_maker_topbar_phone_number' || id === 'recipe_maker_topbar1_wishlist_url' || id === 'recipe_maker_topbar_location' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-recipe_maker_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}


			// Slider

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

			// Products

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

			// Footer

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

			// Post Settings

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

			// Single Post Settings

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

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

		// Global Color Setting
		recipe_maker_customizer_label( 'recipe_maker_global_color', 'Global Color' );
		recipe_maker_customizer_label( 'recipe_maker_heading_color', 'Heading Typography' );
		recipe_maker_customizer_label( 'recipe_maker_paragraph_color', 'Paragraph Typography' );

		// General Setting
		recipe_maker_customizer_label( 'recipe_maker_preloader_hide', 'Preloader' );
		recipe_maker_customizer_label( 'recipe_maker_scroll_hide', 'Scroll To Top' );
		recipe_maker_customizer_label( 'recipe_maker_sticky_header', 'Sticky Header' );
		recipe_maker_customizer_label( 'recipe_maker_scroll_top_position', 'Scroll to top Position' );
		recipe_maker_customizer_label( 'recipe_maker_products_per_row', 'woocommerce Setting' );
		recipe_maker_customizer_label( 'recipe_maker_width_option', 'Site Width Layouts' );
		recipe_maker_customizer_label( 'recipe_maker_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		recipe_maker_customizer_label( 'recipe_maker_theme_color', 'Theme Color' );
		recipe_maker_customizer_label( 'background_color', 'Colors' );
		recipe_maker_customizer_label( 'background_image', 'Image' );

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

		recipe_maker_customizer_label( 'recipe_maker_post_layout', 'Post Layouts Settings' );

		recipe_maker_customizer_label( 'recipe_maker_404_page_main_heading', '404 Page Settings' );

		// Social Icon
		recipe_maker_customizer_label( 'recipe_maker_facebook_icon', 'Facebook' );
		recipe_maker_customizer_label( 'recipe_maker_twitter_icon', 'Twitter' );
		recipe_maker_customizer_label( 'recipe_maker_intagram_icon', 'Intagram' );
		recipe_maker_customizer_label( 'recipe_maker_linkedin_icon', 'Linkedin' );
		recipe_maker_customizer_label( 'recipe_maker_pintrest_icon', 'Pintrest' );

		// Header 
		recipe_maker_customizer_label( 'recipe_maker_top_header_about_us_button_text', 'Topbar Buttons' );
		recipe_maker_customizer_label( 'recipe_maker_topbar_text', 'Topbar Text' );
		recipe_maker_customizer_label( 'recipe_maker_topbar_phone_number', 'Phone Number' );
		recipe_maker_customizer_label( 'recipe_maker_topbar_location', 'Location' );
		recipe_maker_customizer_label( 'recipe_maker_topbar1_wishlist_url', 'Wishlist Url' );

		//Slider
		recipe_maker_customizer_label( 'recipe_maker_slider_section_setting', 'Slider' );

		//Products
		recipe_maker_customizer_label( 'recipe_maker_activities_section_setting', 'Flash Sale' );

		//Footer
		recipe_maker_customizer_label( 'recipe_maker_footer_widget_content_alignment', 'Footer' );
		recipe_maker_customizer_label( 'recipe_maker_show_hide_copyright', 'Copyright' );

		//Post setting
		recipe_maker_customizer_label( 'recipe_maker_post_page_title', 'Post Settings' );

		//Single post setting
		recipe_maker_customizer_label( 'recipe_maker_single_post_thumb', 'Single Post Settings' );
	

	});

})( jQuery );
