<?php
/**
 * expert-movers: Customizer
 *
 * @subpackage expert-movers
 * @since 1.0
 */

function expert_movers_customize_register( $wp_customize ) {

	$wp_customize->add_setting('expert_movers_logo_size',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('expert_movers_logo_size',array(
		'type' => 'range',
		'label' => __('Logo Size','expert-movers'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('expert_movers_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('expert_movers_logo_padding',array(
		'label' => __('Logo Padding','expert-movers'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('expert_movers_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','expert-movers'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('expert_movers_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','expert-movers'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('expert_movers_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','expert-movers'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('expert_movers_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','expert-movers'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('expert_movers_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'expert_movers_sanitize_checkbox'
	));
	$wp_customize->add_control('expert_movers_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','expert-movers'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('expert_movers_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','expert-movers'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('expert_movers_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'expert_movers_sanitize_checkbox'
	));
	$wp_customize->add_control('expert_movers_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','expert-movers'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('expert_movers_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','expert-movers'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_panel( 'expert_movers_panel_id', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'theme_supports' => '',
		'title' => __( 'Theme Settings', 'expert-movers' ),
		'description' => __( 'Description of what this panel does.', 'expert-movers' ),
	) );

	$wp_customize->add_section( 'expert_movers_theme_options_section', array(
    	'title'      => __( 'General Settings', 'expert-movers' ),
		'priority'   => 30,
		'panel' => 'expert_movers_panel_id'
	) );

	// Add Settings and Controls for Layout
	$wp_customize->add_setting('expert_movers_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'expert_movers_sanitize_choices'	        
	));
	$wp_customize->add_control('expert_movers_theme_options',array(
		'type' => 'radio',
		'label' => __('Do you want this section','expert-movers'),
		'section' => 'expert_movers_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','expert-movers'),
		   'Right Sidebar' => __('Right Sidebar','expert-movers'),
		   'One Column' => __('One Column','expert-movers'),
		   'Three Columns' => __('Three Columns','expert-movers'),
		   'Four Columns' => __('Four Columns','expert-movers'),
		   'Grid Layout' => __('Grid Layout','expert-movers')
		),
	));

	$wp_customize->add_setting( 'expert_movers_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'expert_movers_sanitize_choices'
	));
	
	$wp_customize->add_control( 'expert_movers_boxfull_width', array(
		'label'    => __( 'Section Width', 'expert-movers' ),
		'section'  => 'expert_movers_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'expert-movers'),
			'container-fluid' => __('Full Width', 'expert-movers'),
			'none' => __('None', 'expert-movers')
		),
	));

	$wp_customize->add_setting( 'expert_movers_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'expert_movers_sanitize_choices'
	));
	$wp_customize->add_control( 'expert_movers_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'expert-movers' ),
		'section'  => 'expert_movers_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'expert-movers'),
			'fadeInUp' => __('fadeInUp', 'expert-movers'),
			'zoomIn'    => __('zoomIn', 'expert-movers'),
			'None'    => __('None', 'expert-movers')
		),
	));

	// Top Bar
	$wp_customize->add_section( 'expert_movers_contact_details', array(
    	'title'      => __( 'Top Bar', 'expert-movers' ),
		'priority'   => null,
		'panel' => 'expert_movers_panel_id'
	) );

	$wp_customize->add_setting('expert_movers_hide_show_topbar',array(
    	'default' => false,
    	'sanitize_callback'	=> 'expert_movers_sanitize_checkbox'
	));
	$wp_customize->add_control('expert_movers_hide_show_topbar',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Topbar','expert-movers'),
   	'section' => 'expert_movers_contact_details',
	));

	$wp_customize->add_setting('expert_movers_call1',array(
		'default'=> '',
		'sanitize_callback'	=> 'expert_movers_sanitize_phone_number'
	));	
	$wp_customize->add_control('expert_movers_call1',array(
		'label'	=> __('Phone Number','expert-movers'),
		'section'=> 'expert_movers_contact_details',
		'setting'=> 'expert_movers_call1',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_movers_email1',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_email'
	));	
	$wp_customize->add_control('expert_movers_email1',array(
		'label'	=> __('Email Us','expert-movers'),
		'section'=> 'expert_movers_contact_details',
		'setting'=> 'expert_movers_email1',
		'type'=> 'text'
	));

	$wp_customize->add_setting( 'expert_movers_topicon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_topicon_color', array(
		'label' => 'Top Icon Color',
		'section' => 'expert_movers_contact_details',
	)));

	$wp_customize->add_setting( 'expert_movers_toptext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_toptext_color', array(
		'label' => 'Top Text Color',
		'section' => 'expert_movers_contact_details',
	)));

	$wp_customize->add_setting( 'expert_movers_topbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_topbg_color', array(
		'label' => 'Top Background Color',
		'section' => 'expert_movers_contact_details',
	)));

	$wp_customize->add_setting( 'expert_movers_header_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_header_color', array(
		'label' => 'Header Menus Color',
		'section' => 'expert_movers_contact_details',
	)));

	$wp_customize->add_setting( 'expert_movers_header_hovertext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_header_hovertext_color', array(
		'label' => 'Header Menus Hover Text Color',
		'section' => 'expert_movers_contact_details',
	)));

	$wp_customize->add_setting( 'expert_movers_header_hoverbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_header_hoverbg_color', array(
		'label' => 'Header Menus Hover BG Color',
		'section' => 'expert_movers_contact_details',
	)));

	$wp_customize->add_setting( 'expert_movers_headerbg_color1', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_headerbg_color1', array(
		'label' => 'Header Background Color 1',
		'section' => 'expert_movers_contact_details',
	)));

	$wp_customize->add_setting( 'expert_movers_headerbg_color2', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_headerbg_color2', array(
		'label' => 'Header Background Color 2',
		'section' => 'expert_movers_contact_details',
	)));

	//home page slider
	$wp_customize->add_section( 'expert_movers_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'expert-movers' ),
		'priority'   => null,
		'panel' => 'expert_movers_panel_id'
	) );

	$wp_customize->add_setting('expert_movers_slider_hide_show',array(
       	'default' => false,
       	'sanitize_callback'	=> 'expert_movers_sanitize_checkbox'
	));
	$wp_customize->add_control('expert_movers_slider_hide_show',array(
	   	'type' => 'checkbox',
	   	'label' => __('Show / Hide slider','expert-movers'),
	   	'description' => __('Image Size ( 1600px x 582px )','expert-movers'),
	   	'section' => 'expert_movers_slider_section',
	));

	$wp_customize->add_setting( 'expert_movers_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'expert_movers_sanitize_choices'
	));
	$wp_customize->add_control( 'expert_movers_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'expert-movers' ),
		'section'  => 'expert_movers_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'expert-movers'),
			'bounceInRight' => __('bounceInRight', 'expert-movers'),
			'bounceInUp'    => __('bounceInUp', 'expert-movers'),
			'bounceInDown'    => __('bounceInDown', 'expert-movers'),
			'zoomIn'  => __('zoomIn', 'expert-movers'),
			'zoomOut' => __('zoomOut', 'expert-movers'),
			'fadeInDown'    => __('fadeInDown', 'expert-movers'),
			'fadeInUp'    => __('fadeInUp', 'expert-movers'),
			'fadeInLeft'  => __('fadeInLeft', 'expert-movers'),
			'fadeInRight' => __('fadeInRight', 'expert-movers'),
			'flip-up'    => __('flip-up', 'expert-movers'),
			'none'    => __('none', 'expert-movers')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'expert_movers_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'expert_movers_sanitize_dropdown_pages'
		) );
		$wp_customize->add_control( 'expert_movers_slider' . $count, array(
			'label'   => __( 'Select Slide Image Page', 'expert-movers' ),
			'section' => 'expert_movers_slider_section',
			'type'    => 'dropdown-pages'
		) );
	}

	$wp_customize->add_setting('expert_movers_slider_excerpt_length',array(
		'default' => '20',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','expert-movers'),
		'section' => 'expert_movers_slider_section',
	));

	$wp_customize->add_setting('expert_movers_slider_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_slider_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','expert-movers'),
		'section' => 'expert_movers_slider_section',
	));

	$wp_customize->add_setting('expert_movers_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','expert-movers'),
		'section' => 'expert_movers_slider_section',
	));

	$wp_customize->add_setting('expert_movers_slider_opacity',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_slider_opacity',array(
		'type' => 'range',
		'label' => __('Image Opacity','expert-movers'),
		'section' => 'expert_movers_slider_section',
		'input_attrs' => array(
			'min'  => 0,
			'max'  => 1,
			'step' => 0.1,
		),
	));

	$wp_customize->add_setting( 'expert_movers_slider_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_slider_color', array(
		'label' => 'Title Color',
		'section' => 'expert_movers_slider_section',
	)));

	$wp_customize->add_setting( 'expert_movers_slidertext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_slidertext_color', array(
		'label' => 'Text Color',
		'section' => 'expert_movers_slider_section',
	)));

	$wp_customize->add_setting( 'expert_movers_sliderbtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_sliderbtn_color', array(
		'label' => 'Button Text Color',
		'section' => 'expert_movers_slider_section',
	)));

	$wp_customize->add_setting( 'expert_movers_sliderbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_sliderbtnbg_color', array(
		'label' => 'Button Background Color',
		'section' => 'expert_movers_slider_section',
	)));

	$wp_customize->add_setting( 'expert_movers_slidernpbtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_slidernpbtn_color', array(
		'label' => 'Next/Pre Arrow Text Color',
		'section' => 'expert_movers_slider_section',
	)));

	$wp_customize->add_setting( 'expert_movers_slidernpbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_slidernpbtnbg_color', array(
		'label' => 'Next/Pre Arrow Background Color',
		'section' => 'expert_movers_slider_section',
	)));

	//	Our Features
	$wp_customize->add_section('expert_movers_service',array(
		'title'	=> __('Our Features','expert-movers'),
		'description'=> __('<b>Note</b> : This section will appear below the slider.','expert-movers'),
		'panel' => 'expert_movers_panel_id',
	));
	
	$wp_customize->add_setting('expert_movers_title',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('expert_movers_title',array(
		'label'	=> __('Section Title','expert-movers'),
		'section'	=> 'expert_movers_service',
		'setting'	=> 'expert_movers_title',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('expert_movers_features_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_features_font_size',array(
		'type' => 'number',
		'label' => __('Font Size','expert-movers'),
		'section' => 'expert_movers_service',
	));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_pst[]= 'select';
	foreach($categories as $category){
		if($i==0){
			$default = $category->slug;
			$i++;
		}
		$cat_pst[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('expert_movers_cat',array(
		'default'	=> 'select',
		'sanitize_callback' => 'expert_movers_sanitize_choices',
	));
	$wp_customize->add_control('expert_movers_cat',array(
		'type'    => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','expert-movers'),
		'section' => 'expert_movers_service',
	));

	$wp_customize->add_setting('expert_movers_features_img_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_features_img_size',array(
		'type' => 'number',
		'label' => __('Image Size','expert-movers'),
		'section' => 'expert_movers_service',
	));

	$wp_customize->add_setting('expert_movers_features_post_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_features_post_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','expert-movers'),
		'section' => 'expert_movers_service',
	));

	$wp_customize->add_setting('expert_movers_features_post_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_features_post_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','expert-movers'),
		'section' => 'expert_movers_service',
	));

	$wp_customize->add_setting('expert_movers_features_section_padding',array(
      'default' => '',
      'sanitize_callback'	=> 'expert_movers_sanitize_float'
	));
	$wp_customize->add_control('expert_movers_features_section_padding',array(
		'type' => 'number',
		'label' => __('Section Top Bottom Padding','expert-movers'),
		'section' => 'expert_movers_service',
	));

   $wp_customize->add_setting( 'expert_movers_feature_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
   ));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_feature_color', array(
		'label' => 'Heading Color',
		'section' => 'expert_movers_service',
	)));

	$wp_customize->add_setting( 'expert_movers_featuretitle_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
   ));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_featuretitle_color', array(
		'label' => 'Title Color',
		'section' => 'expert_movers_service',
	)));

	$wp_customize->add_setting( 'expert_movers_featuretext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
   ));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_featuretext_color', array(
		'label' => 'Text Color',
		'section' => 'expert_movers_service',
	)));

	$wp_customize->add_setting( 'expert_movers_featurebg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
   ));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_featurebg_color', array(
		'label' => 'Background Color',
		'section' => 'expert_movers_service',
	)));

	//Footer
   $wp_customize->add_section( 'expert_movers_footer', array(
    	'title'      => __( 'Footer Setting', 'expert-movers' ),
		'priority'   => null,
		'panel' => 'expert_movers_panel_id'
	) );

	$wp_customize->add_setting('expert_movers_show_back_totop',array(
 		'default' => true,
		'sanitize_callback'	=> 'expert_movers_sanitize_checkbox'
	));
	$wp_customize->add_control('expert_movers_show_back_totop',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Back to Top','expert-movers'),
   	'section' => 'expert_movers_footer'
	));

   $wp_customize->add_setting('expert_movers_footer_copy',array(
		'default'	=> 'Expert Movers WordPress Theme',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('expert_movers_footer_copy',array(
		'label'	=> __('Copyright Text','expert-movers'),
		'section'	=> 'expert_movers_footer',
		'setting'	=> 'expert_movers_footer_copy',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('expert_movers_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'expert_movers_sanitize_float'
 	));
 	$wp_customize->add_control('expert_movers_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','expert-movers'),
		'section' => 'expert_movers_footer',
	));

	$wp_customize->add_setting( 'expert_movers_footer_widgets_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_footer_widgets_color', array(
		'label' => 'Widgets Title Color',
		'section' => 'expert_movers_footer',
	)));

	$wp_customize->add_setting( 'expert_movers_footer_widgets_menus_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_footer_widgets_menus_color', array(
		'label' => 'Widgets Menus Color',
		'section' => 'expert_movers_footer',
	)));

	$wp_customize->add_setting( 'expert_movers_footerbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_footerbg_color', array(
		'label' => 'Footer Bg Color',
		'section' => 'expert_movers_footer',
	)));

	$wp_customize->add_setting( 'expert_movers_footer_copyright_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_footer_copyright_text_color', array(
		'label' => 'Copyright Text Color',
		'section' => 'expert_movers_footer',
	)));

	$wp_customize->add_setting( 'expert_movers_footer_copyrightbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'expert_movers_footer_copyrightbg_color', array(
		'label' => 'Copyright Bg Color',
		'section' => 'expert_movers_footer',
	)));

	$wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';

	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.site-title a',
		'render_callback' => 'expert_movers_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'expert_movers_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'expert_movers_customize_register' );

function expert_movers_customize_partial_blogname() {
	bloginfo( 'name' );
}

function expert_movers_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

function expert_movers_is_static_front_page() {
	return ( is_front_page() && ! is_home() );
}

function expert_movers_is_view_with_layout_option() {
	// This option is available on all pages. It's also available on archives when there isn't a sidebar.
	return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );
}

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class Expert_Movers_Customize {

	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function get_instance() {

		static $instance = null;

		if ( is_null( $instance ) ) {
			$instance = new self;
			$instance->setup_actions();
		}

		return $instance;
	}

	/**
	 * Constructor method.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function __construct() {}

	/**
	 * Sets up initial actions.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function setup_actions() {

		// Register panels, sections, settings, controls, and partials.
		add_action( 'customize_register', array( $this, 'sections' ) );

		// Register scripts and styles for the controls.
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
	}

	/**
	 * Sets up the customizer sections.
	 *
	 * @since  1.0.0
	 * @access public
	 * @param  object  $manager
	 * @return void
	 */
	public function sections( $manager ) {

		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/inc/section-pro.php' );

		// Register custom section types.
		$manager->register_section_type( 'Expert_Movers_Customize_Section_Pro' );

		// Register sections.
		$manager->add_section(
			new Expert_Movers_Customize_Section_Pro(
				$manager,
				'expert_movers_example_1',
				array(
					'priority' => 9,
					'title'    => esc_html__( 'Expert Movers Pro', 'expert-movers' ),
					'pro_text' => esc_html__( 'Go Pro','expert-movers' ),
					'pro_url'  => esc_url( 'https://www.luzuk.com/products/movers-wordpress-theme/' ),
				)
			)
		);
	}

	/**
	 * Loads theme customizer CSS.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function enqueue_control_scripts() {

		wp_enqueue_script( 'expert-movers-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'expert-movers-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/css/customize-controls.css' );
	}
}

// Doing this customizer thang!
Expert_Movers_Customize::get_instance();