<?php
/**
 * Construction Firm: Customizer-home-page
 *
 * @subpackage Construction Firm
 * @since 1.0
 */

	//  Home Page Panel
	$wp_customize->add_panel( 'construction_firm_custompage_panel', array(
		'title' => esc_html__( 'Custom Page Settings', 'construction-firm' ),
		'priority' => 2,
	));
	// Top Header
    $wp_customize->add_section('construction_firm_top',array(
        'title' => __('Top Header', 'construction-firm'),
        'priority'=> 3,
        'panel' => 'construction_firm_custompage_panel',
    ) );
    $wp_customize->add_setting( 'construction_firm_section_contact_heading', array(
			'default'           => '',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_section_contact_heading', array(
		'label'       => esc_html__( 'top header Settings', 'construction-firm' ),		
		'section'     => 'construction_firm_top',
		'settings'    => 'construction_firm_section_contact_heading',
	) ) );
    $wp_customize->add_setting('construction_firm_top_content',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_top_content',array(
		'label' => esc_html__('Add Top Bar Text','construction-firm'),
		'section' => 'construction_firm_top',
		'setting' => 'construction_firm_top_content',
		'type'    => 'text',
	));
	$wp_customize->selective_refresh->add_partial( 'construction_firm_top_content', array(
		'selector' => '.top_bar p',
		'render_callback' => 'construction_firm_customize_partial_construction_firm_top_content',
	) );
	$wp_customize->add_setting('construction_firm_contact_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_contact_show_hide',
			array(
				'settings'        => 'construction_firm_contact_show_hide',
				'section'         => 'construction_firm_top',
				'label'           => __( 'Show Contact Details', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting('construction_firm_timing_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_timing_text',array(
		'label' => esc_html__('Add Text','construction-firm'),
		'section' => 'construction_firm_top',
		'setting' => 'construction_firm_timing_text',
		'type'    => 'text',
	));
	$wp_customize->selective_refresh->add_partial( 'construction_firm_timing_text', array(
		'selector' => '.info-box i',
		'render_callback' => 'construction_firm_customize_partial_construction_firm_timing_text',
	) );
	$wp_customize->add_setting('construction_firm_timing',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_timing',array(
		'label' => esc_html__('Add Timing','construction-firm'),
		'section' => 'construction_firm_top',
		'setting' => 'construction_firm_timing',
		'type'    => 'text',
	));
	$wp_customize->add_setting('construction_firm_timimg_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Construction_Firm_Fontawesome_Icon_Chooser(
        $wp_customize,'construction_firm_timimg_icon',array(
		'label'	=> __('Add Timing Icon','construction-firm'),
		'transport' => 'refresh',
		'section'	=> 'construction_firm_top',
		'setting'	=> 'construction_firm_timimg_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('construction_firm_call_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_call_text',array(
		'label' => esc_html__('Add Text','construction-firm'),
		'section' => 'construction_firm_top',
		'setting' => 'construction_firm_call_text',
		'type'    => 'text',
	));
	$wp_customize->add_setting('construction_firm_call',array(
		'default' => '',
		'sanitize_callback' => 'construction_firm_sanitize_phone_number'
	));
	$wp_customize->add_control('construction_firm_call',array(
		'label' => esc_html__('Add Phone Number','construction-firm'),
		'section' => 'construction_firm_top',
		'setting' => 'construction_firm_call',
		'type'    => 'text',
	));
	$wp_customize->add_setting('construction_firm_call_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Construction_Firm_Fontawesome_Icon_Chooser(
        $wp_customize,'construction_firm_call_icon',array(
		'label'	=> __('Add Phone Icon','construction-firm'),
		'transport' => 'refresh',
		'section'	=> 'construction_firm_top',
		'setting'	=> 'construction_firm_call_icon',
		'type'		=> 'icon'
	)));
    $wp_customize->add_setting('construction_firm_email_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_email_text',array(
		'label' => esc_html__('Add Text','construction-firm'),
		'section' => 'construction_firm_top',
		'setting' => 'construction_firm_email_text',
		'type'    => 'text',
	));
	$wp_customize->add_setting('construction_firm_email',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_email'
	));
	$wp_customize->add_control('construction_firm_email',array(
		'label' => esc_html__('Add Email Address','construction-firm'),
		'section' => 'construction_firm_top',
		'setting' => 'construction_firm_email',
		'type'    => 'text',
	));
	$wp_customize->add_setting('construction_firm_email_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Construction_Firm_Fontawesome_Icon_Chooser(
        $wp_customize,'construction_firm_email_icon',array(
		'label'	=> __('Add Email Icon','construction-firm'),
		'transport' => 'refresh',
		'section'	=> 'construction_firm_top',
		'setting'	=> 'construction_firm_email_icon',
		'type'		=> 'icon'
	)));

	// Social Media
    $wp_customize->add_section('construction_firm_urls',array(
        'title' => __('Social Media', 'construction-firm'),
        'priority'       => 3,
        'panel' => 'construction_firm_custompage_panel',
    ) );
    $wp_customize->add_setting( 'construction_firm_section_social_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_section_social_heading', array(
		'label'       => esc_html__( 'Social Media Settings', 'construction-firm' ),
		'description' => __( 'Add social media links in the below feilds', 'construction-firm' ),			
		'section'     => 'construction_firm_urls',
		'settings'    => 'construction_firm_section_social_heading',
	) ) );
	$wp_customize->add_setting(
		'construction_firm_social_enable',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_social_enable',
			array(
				'settings'        => 'construction_firm_social_enable',
				'section'         => 'construction_firm_urls',
				'label'           => __( 'Check to show social fields', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->selective_refresh->add_partial( 'construction_firm_social_enable', array(
		'selector' => '.links a i',
		'render_callback' => 'construction_firm_customize_partial_construction_firm_social_enable',
	) );
	$wp_customize->add_setting( 'construction_firm_facebook_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_facebook_heading', array(
		'label'       => esc_html__( 'Facebook Settings', 'construction-firm' ),
		'section'     => 'construction_firm_urls',
		'settings'    => 'construction_firm_facebook_heading',
	) ) );
	$wp_customize->add_setting('construction_firm_facebook_icon',array(
		'default'	=> 'fab fa-facebook',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Construction_Firm_Fontawesome_Icon_Chooser(
        $wp_customize,'construction_firm_facebook_icon',array(
		'label'	=> __('Add Icon','construction-firm'),
		'transport' => 'refresh',
		'section'	=> 'construction_firm_urls',
		'setting'	=> 'construction_firm_facebook_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('construction_firm_facebook',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('construction_firm_facebook',array(
		'label' => esc_html__('Add URL','construction-firm'),
		'section' => 'construction_firm_urls',
		'setting' => 'construction_firm_facebook',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'construction_firm_header_facebook_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_header_facebook_target',
			array(
				'settings'        => 'construction_firm_header_facebook_target',
				'section'         => 'construction_firm_urls',
				'label'           => __( 'Open link in a new tab', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting( 'construction_firm_twitter_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_twitter_heading', array(
		'label'       => esc_html__( 'Twitter Settings', 'construction-firm' ),
		'section'     => 'construction_firm_urls',
		'settings'    => 'construction_firm_twitter_heading',
	) ) );
	$wp_customize->add_setting('construction_firm_twitter_icon',array(
		'default'	=> 'fab fa-x-twitter',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Construction_Firm_Fontawesome_Icon_Chooser(
        $wp_customize,'construction_firm_twitter_icon',array(
		'label'	=> __('Add Icon','construction-firm'),
		'transport' => 'refresh',
		'section'	=> 'construction_firm_urls',
		'setting'	=> 'construction_firm_twitter_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->selective_refresh->add_partial( 'construction_firm_twitter', array(
		'selector' => '.social-icon a i',
		'render_callback' => 'construction_firm_customize_partial_construction_firm_twitter',
	) );
	$wp_customize->add_setting('construction_firm_twitter',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('construction_firm_twitter',array(
		'label' => esc_html__('Add URL','construction-firm'),
		'section' => 'construction_firm_urls',
		'setting' => 'construction_firm_twitter',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'construction_firm_header_twt_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_header_twt_target',
			array(
				'settings'        => 'construction_firm_header_twt_target',
				'section'         => 'construction_firm_urls',
				'label'           => __( 'Open link in a new tab', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting( 'construction_firm_linkedin_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_linkedin_heading', array(
		'label'       => esc_html__( 'Linkedin Settings', 'construction-firm' ),
		'section'     => 'construction_firm_urls',
		'settings'    => 'construction_firm_linkedin_heading',
	) ) );
	$wp_customize->add_setting('construction_firm_linkedin_icon',array(
		'default'	=> 'fab fa-linkedin',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Construction_Firm_Fontawesome_Icon_Chooser(
        $wp_customize,'construction_firm_linkedin_icon',array(
		'label'	=> __('Add Icon','construction-firm'),
		'transport' => 'refresh',
		'section'	=> 'construction_firm_urls',
		'setting'	=> 'construction_firm_linkedin_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('construction_firm_linkedin',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('construction_firm_linkedin',array(
		'label' => esc_html__('Add URL','construction-firm'),
		'section' => 'construction_firm_urls',
		'setting' => 'construction_firm_linkedin',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'construction_firm_header_linkedin_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_header_linkedin_target',
			array(
				'settings'        => 'construction_firm_header_linkedin_target',
				'section'         => 'construction_firm_urls',
				'label'           => __( 'Open link in a new tab', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting( 'construction_firm_pinterest_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_pinterest_heading', array(
		'label'       => esc_html__( 'Pinterest Settings', 'construction-firm' ),
		'section'     => 'construction_firm_urls',
		'settings'    => 'construction_firm_pinterest_heading',
	) ) );
	$wp_customize->add_setting('construction_firm_pinterest_icon',array(
		'default'	=> 'fab fa-pinterest-p',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Construction_Firm_Fontawesome_Icon_Chooser(
        $wp_customize,'construction_firm_pinterest_icon',array(
		'label'	=> __('Add Icon','construction-firm'),
		'transport' => 'refresh',
		'section'	=> 'construction_firm_urls',
		'setting'	=> 'construction_firm_pinterest_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('construction_firm_pinterest',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('construction_firm_pinterest',array(
		'label' => esc_html__('Add URL','construction-firm'),
		'section' => 'construction_firm_urls',
		'setting' => 'construction_firm_pinterest',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'construction_firm_header_pinterest_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_header_pinterest_target',
			array(
				'settings'        => 'construction_firm_header_pinterest_target',
				'section'         => 'construction_firm_urls',
				'label'           => __( 'Open link in a new tab', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);

    //Slider
	$wp_customize->add_section( 'construction_firm_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'construction-firm' ),
    	'priority'   => 3,
    	'panel' => 'construction_firm_custompage_panel',
	) );
	$wp_customize->add_setting( 'construction_firm_section_slide_heading', array(
			'default'           => '',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_section_slide_heading', array(
		'label'       => esc_html__( 'Slider Settings', 'construction-firm' ),
		'description' => __( 'Slider Image Dimension ( 600px x 700px )', 'construction-firm' ),		
		'section'     => 'construction_firm_slider_section',
		'settings'    => 'construction_firm_section_slide_heading',
		'priority'   => 1,
	) ) );
	$wp_customize->add_setting(
		'construction_firm_slider_arrows',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_slider_arrows',
			array(
				'settings'        => 'construction_firm_slider_arrows',
				'section'         => 'construction_firm_slider_section',
				'label'           => __( 'Check To show Slider', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
				'priority'   => 1,
			)
		)
	);
	$wp_customize->add_setting('construction_firm_slide_heading',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_slide_heading',array(
		'label' => esc_html__('Slider Text','construction-firm'),
		'section' => 'construction_firm_slider_section',
		'setting' => 'construction_firm_slide_heading',
		'type'    => 'text',
		'priority'   => 1,
	));

	$wp_customize->add_setting('construction_firm_slider_count',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_slider_count',array(
		'label'	=> esc_html__('Slider Count','construction-firm'),
		'section'	=> 'construction_firm_slider_section',
		'description' => __( 'After increasing/decreasing counter refresh site for changes to be applied.', 'construction-firm' ),
		'type'		=> 'number',
		'priority'   => 1,
	));

	$construction_firm_slider_count = get_theme_mod('construction_firm_slider_count');
	
	$construction_firm_args = array('numberposts' => -1);
	$post_list = get_posts($construction_firm_args);
	$construction_firm_i = 0;
	$pst_sls[]= __('Select','construction-firm');
	foreach ($post_list as $key => $p_post) {
		$pst_sls[$p_post->ID]=$p_post->post_title;
	}
	for ( $construction_firm_i = 1; $construction_firm_i <= $construction_firm_slider_count; $construction_firm_i++ ) {
		$wp_customize->add_setting('construction_firm_post_setting'.$construction_firm_i,array(
			'sanitize_callback' => 'construction_firm_sanitize_choices',
		));
		$wp_customize->add_control('construction_firm_post_setting'.$construction_firm_i,array(
			'type'    => 'select',
			'choices' => $pst_sls,
			'label' => __('Select post','construction-firm'),
			'section' => 'construction_firm_slider_section',
			'priority'   => 1,
		));
	}
	wp_reset_postdata();

	$wp_customize->add_setting('construction_firm_slider_heading_color', array(
	    'default' => '#ffffff',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'construction_firm_slider_heading_color', array(
	    'section' => 'construction_firm_slider_section',
	    'label' => esc_html__('Slider Title Color', 'construction-firm'),
	 	'priority'    => 2,
	)));

	$wp_customize->add_setting(
		'construction_firm_slider_excerpt_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_slider_excerpt_show_hide',
			array(
				'settings'        => 'construction_firm_slider_excerpt_show_hide',
				'section'         => 'construction_firm_slider_section',
				'label'           => __( 'Show Hide excerpt', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'priority'   => 3,
			)
		)
	);
	$wp_customize->add_setting('construction_firm_slider_excerpt_count',array(
		'default'=> 20,
		'transport' => 'refresh',
		'sanitize_callback' => 'construction_firm_sanitize_integer'
	));
	$wp_customize->add_control(new Construction_Firm_Slider_Custom_Control( $wp_customize, 'construction_firm_slider_excerpt_count',array(
		'label' => esc_html__( 'Excerpt Limit','construction-firm' ),
		'section'=> 'construction_firm_slider_section',
		'settings'=>'construction_firm_slider_excerpt_count',
		'input_attrs' => array(
			'reset'			   => 20,
            'step'             => 1,
			'min'              => 0,
			'max'              => 50,
        ),
        'priority'   => 3,
	)));
	$wp_customize->add_setting('construction_firm_slider_excerpt_color', array(
	    'default' => '#ffffff',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'construction_firm_slider_excerpt_color', array(
	    'section' => 'construction_firm_slider_section',
	    'label' => esc_html__('Slider Excerpt Color', 'construction-firm'),
	 	'priority'    => 4,
	)));
	$wp_customize->add_setting(
		'construction_firm_slider_button_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_slider_button_show_hide',
			array(
				'settings'        => 'construction_firm_slider_button_show_hide',
				'section'         => 'construction_firm_slider_section',
				'label'           => __( 'Show Hide Button', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'priority'   => 5,
			)
		)
	);
	$wp_customize->add_setting('construction_firm_slider_read_more',array(
		'default' => 'READ MORE',
		'sanitize_callback' => 'sanitize_text_field'
	)); 
	$wp_customize->add_control('construction_firm_slider_read_more',array(
		'label' => esc_html__('Button Text','construction-firm'),
		'section' => 'construction_firm_slider_section',
		'setting' => 'construction_firm_slider_read_more',
		'type'    => 'text',
		'priority'   => 5,
	));

	$wp_customize->add_setting('construction_firm_slider_content_alignment',array(
        'default' => 'LEFT-ALIGN',
        'sanitize_callback' => 'construction_firm_sanitize_choices'
	));
	$wp_customize->add_control('construction_firm_slider_content_alignment',array(
		'type' => 'radio',
		'label'     => __('Slider Content Alignment', 'construction-firm'),
		'section' => 'construction_firm_slider_section',
		'type' => 'select',
		'choices' => array(
			'LEFT-ALIGN' => __('LEFT','construction-firm'),
            'CENTER-ALIGN' => __('CENTER','construction-firm'),
            'RIGHT-ALIGN' => __('RIGHT','construction-firm'),
		),
		'priority'   => 6,
	) );

	$wp_customize->add_setting('construction_firm_slider_overlay', array(
	    'default' => '#383a46',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'construction_firm_slider_overlay', array(
	    'section' => 'construction_firm_slider_section',
	    'label' => esc_html__('Slider Overlay Color', 'construction-firm'),
	 	'priority'    => 7,
	)));

	$wp_customize->add_setting('construction_firm_slider_opacity',array(
        'default' => '0.3',
        'sanitize_callback' => 'construction_firm_sanitize_choices'
	));
	$wp_customize->add_control('construction_firm_slider_opacity',array(
		'type' => 'radio',
		'label'     => __('Slider Opacity', 'construction-firm'),
		'section' => 'construction_firm_slider_section',
		'type' => 'select',
		'choices' => array(
			'0' => __('0','construction-firm'),
			'0.1' => __('0.1','construction-firm'),
			'0.2' => __('0.2','construction-firm'),
			'0.3' => __('0.3','construction-firm'),
			'0.4' => __('0.4','construction-firm'),
			'0.5' => __('0.5','construction-firm'),
			'0.6' => __('0.6','construction-firm'),
			'0.7' => __('0.7','construction-firm'),
			'0.8' => __('0.8','construction-firm'),
			'0.9' => __('0.9','construction-firm'),
			'1' => __('1','construction-firm')
		),
	) );

	//Middle Section
	$wp_customize->add_section( 'construction_firm_middle_section' , array(
    	'title'      => __( 'Services Settings', 'construction-firm' ),
		'priority'   => 4,
		'panel' => 'construction_firm_custompage_panel',
	) );
	$wp_customize->add_setting( 'construction_firm_section_middle_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_section_middle_heading', array(
		'label'       => esc_html__( 'Services Settings', 'construction-firm' ),	
		'section'     => 'construction_firm_middle_section',
		'settings'    => 'construction_firm_section_middle_heading',
	) ) );
	$wp_customize->add_setting(
		'construction_firm_services_enable',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_services_enable',
			array(
				'settings'        => 'construction_firm_services_enable',
				'section'         => 'construction_firm_middle_section',
				'label'           => __( 'Check To Show services', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);

	$construction_firm_args = array('numberposts' => -1);
	$post_list = get_posts($construction_firm_args);
	$s = 0;
	$pst_sls[]= __('Select','construction-firm');
	foreach ($post_list as $key => $p_post) {
		$pst_sls[$p_post->ID]=$p_post->post_title;
	}
	for ( $s = 1; $s <= 4; $s++ ) {
		$wp_customize->add_setting('construction_firm_middle_sec_settigs'.$s,array(
			'sanitize_callback' => 'construction_firm_sanitize_choices',
		));
		$wp_customize->add_control('construction_firm_middle_sec_settigs'.$s,array(
			'type'    => 'select',
			'choices' => $pst_sls,
			'label' => __('Select post','construction-firm'),
			'section' => 'construction_firm_middle_section',
		));

		$wp_customize->selective_refresh->add_partial( 'construction_firm_services_enable', array(
		'selector' => '.inner-box h4 a',
		'render_callback' => 'construction_firm_customize_partial_construction_firm_services_enable',
		) );
	}
	wp_reset_postdata();

	// Project Section
	$wp_customize->add_section( 'construction_firm_project_box_section' , array(
    	'title'      => __( 'Project Settings', 'construction-firm' ),
		'priority'   => 4,
		'panel' => 'construction_firm_custompage_panel',
	) );
	$wp_customize->add_setting( 'construction_firm_section_project_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_section_project_heading', array(
		'label'       => esc_html__( 'Project Settings', 'construction-firm' ),	
		'section'     => 'construction_firm_project_box_section',
		'settings'    => 'construction_firm_section_project_heading',
		'priority'	  => 1,
	) ) );
	$wp_customize->add_setting(
		'construction_firm_project_enable',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_project_enable',
			array(
				'settings'        => 'construction_firm_project_enable',
				'section'         => 'construction_firm_project_box_section',
				'label'           => __( 'Check To Show Product Settings', 'construction-firm' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'priority'        => 1,
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting('construction_firm_project_section_title',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_project_section_title',array(
		'label' => esc_html__('Section Title','construction-firm'),
		'section' => 'construction_firm_project_box_section',
		'setting' => 'construction_firm_project_section_title',
		'type'    => 'text',
		'priority'        => 1,
	));

	$wp_customize->selective_refresh->add_partial( 'construction_firm_project_section_title', array(
		'selector' => '#projects-box h3',
		'render_callback' => 'construction_firm_customize_partial_construction_firm_project_section_title',
	) );

	$wp_customize->add_setting('construction_firm_project_count',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_project_count',array(
		'label'	=> esc_html__('Project Count','construction-firm'),
		'section'	=> 'construction_firm_project_box_section',
		'type'		=> 'number',
		'input_attrs' => array(
			'step'             => 1,
			'min'              => 0,
			'max'              => 10,
		)
	));

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

	$wp_customize->add_setting('construction_firm_category_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'construction_firm_sanitize_select',
	));
	$wp_customize->add_control('construction_firm_category_setting',array(
		'type'    => 'select',
		'choices' => $cat_post,
		'label' => esc_html__('Select Category to display Post','construction-firm'),
		'section' => 'construction_firm_project_box_section',
		'priority'        => 1,
	));

	$wp_customize->add_setting('construction_firm_project_order_type',array(
        'default' => 'descending',
        'sanitize_callback' => 'construction_firm_sanitize_choices'
	));
	$wp_customize->add_control('construction_firm_project_order_type',array(
        'type' => 'select',
        'label' => __('Post Order','construction-firm'),
        'section' => 'construction_firm_project_box_section',
        'choices' => array(
            'ascending' => __('Oldest to Newest','construction-firm'),
            'descending' => __('Newest to Oldest','construction-firm'),
            'a-to-z' => __('A&rarr;Z','construction-firm'),
            'z-to-a' => __('Z&rarr;A','construction-firm'),
        ),
	) );

	//Footer
    $wp_customize->add_section( 'construction_firm_footer_copyright', array(
    	'title'      => esc_html__( 'Footer Text', 'construction-firm' ),
    	'priority'       => 5,
    	'panel' => 'construction_firm_custompage_panel',
	) );
	$wp_customize->add_setting( 'construction_firm_section_footer_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Construction_Firm_Customizer_Customcontrol_Section_Heading( $wp_customize, 'construction_firm_section_footer_heading', array(
		'label'       => esc_html__( 'Footer Settings', 'construction-firm' ),		
		'section'     => 'construction_firm_footer_copyright',
		'settings'    => 'construction_firm_section_footer_heading',
		'priority'       => 1,
	) ) );
    $wp_customize->add_setting('construction_firm_footer_text',array(
			'default'	=> 'Construction WordPress Theme',
			'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('construction_firm_footer_text',array(
			'label'	=> esc_html__('Copyright Text','construction-firm'),
			'section'	=> 'construction_firm_footer_copyright',
			'type'		=> 'textarea'
	));
	$wp_customize->selective_refresh->add_partial( 'construction_firm_footer_text', array(
			'selector' => '.site-info a',
			'render_callback' => 'construction_firm_customize_partial_construction_firm_footer_text',
	) );
	$wp_customize->add_setting('construction_firm_footer_content_alignment',array(
        'default' => 'CENTER-ALIGN',
        'sanitize_callback' => 'construction_firm_sanitize_choices'
	));
	$wp_customize->add_control('construction_firm_footer_content_alignment',array(
		'type' => 'radio',
		'label'     => __('Footer Content Alignment', 'construction-firm'),
		'section' => 'construction_firm_footer_copyright',
		'type' => 'select',
		'choices' => array(
			'LEFT-ALIGN' => __('LEFT','construction-firm'),
            'CENTER-ALIGN' => __('CENTER','construction-firm'),
            'RIGHT-ALIGN' => __('RIGHT','construction-firm'),
		),
	) );

	$wp_customize->add_setting(
		'construction_firm_footer_widgets_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'construction_firm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Construction_Firm_Customizer_Customcontrol_Switch(
			$wp_customize,
			'construction_firm_footer_widgets_show_hide',
			array(
				'settings'        => 'construction_firm_footer_widgets_show_hide',
				'section'         => 'construction_firm_footer_copyright',
				'label'           => __( 'Check To show Footer Widgets', 'construction-firm' ),
				'choices'		  => array(
					'1'      => __( 'On', 'construction-firm' ),
					'off'    => __( 'Off', 'construction-firm' ),
				),
				'active_callback' => '',
			)
		)
	);

	$wp_customize->add_setting('construction_firm_footer_widget',array(
        'default' => '4',
        'sanitize_callback' => 'construction_firm_sanitize_choices'
	));
	$wp_customize->add_control('construction_firm_footer_widget',array(
		'type' => 'radio',
		'label'     => __('Footer Per Column', 'construction-firm'),
		'section' => 'construction_firm_footer_copyright',
		'type' => 'select',
		'choices' => array(
			'1' => __('1','construction-firm'),
            '2' => __('2','construction-firm'),
            '3' => __('3','construction-firm'),
            '4' => __('4','construction-firm'),
		)
	) );