<?php
/**
 * nirman-construction: Customizer
 *
 * @subpackage nirman-construction
 * @since 1.0
 */

function nirman_construction_customize_register( $wp_customize ) {

	$wp_customize->add_setting('nirman_construction_logo_size',array(
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_logo_size',array(
		'type' => 'range',
		'label' => __('Logo Size','nirman-construction'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('nirman_construction_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('nirman_construction_logo_padding',array(
		'label' => __('Logo Padding','nirman-construction'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('nirman_construction_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','nirman-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nirman_construction_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','nirman-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nirman_construction_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','nirman-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nirman_construction_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','nirman-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nirman_construction_show_site_title',array(
      'default' => true,
      'sanitize_callback'	=> 'nirman_construction_sanitize_checkbox'
   ));
   $wp_customize->add_control('nirman_construction_show_site_title',array(
      'type' => 'checkbox',
      'label' => __('Show / Hide Site Title','nirman-construction'),
      'section' => 'title_tagline'
   ));

	$wp_customize->add_setting('nirman_construction_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','nirman-construction'),
		'section' => 'title_tagline',
	));

 	$wp_customize->add_setting('nirman_construction_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'nirman_construction_sanitize_checkbox'
	));
 	$wp_customize->add_control('nirman_construction_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','nirman-construction'),
		'section' => 'title_tagline'
 	));

	$wp_customize->add_setting('nirman_construction_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','nirman-construction'),
		'section' => 'title_tagline',
	));

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

	$wp_customize->add_section( 'nirman_construction_theme_options_section', array(
    	'title'      => __( 'General Settings', 'nirman-construction' ),
		'priority'   => 30,
		'panel' => 'nirman_construction_panel_id'
	) );

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

	$wp_customize->add_setting( 'nirman_construction_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'nirman_construction_sanitize_choices'
	));
	
	$wp_customize->add_control( 'nirman_construction_boxfull_width', array(
		'label'    => __( 'Section Width', 'nirman-construction' ),
		'section'  => 'nirman_construction_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'nirman-construction'),
			'container-fluid' => __('Full Width', 'nirman-construction'),
			'none' => __('None', 'nirman-construction')
		),
	));

	$wp_customize->add_setting( 'nirman_construction_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'nirman_construction_sanitize_choices'
	));
	$wp_customize->add_control( 'nirman_construction_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'nirman-construction' ),
		'section'  => 'nirman_construction_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'nirman-construction'),
			'fadeInUp' => __('fadeInUp', 'nirman-construction'),
			'zoomIn'    => __('zoomIn', 'nirman-construction'),
			'None'    => __('None', 'nirman-construction')
		),
	));

	// Top Bar
	$wp_customize->add_section( 'nirman_construction_contact_details', array(
    	'title'      => __( 'Top Bar', 'nirman-construction' ),
		'priority'   => null,
		'panel' => 'nirman_construction_panel_id'
	) );

	$wp_customize->add_setting('nirman_construction_hide_show_topbar',array(
    	'default' => false,
    	'sanitize_callback'	=> 'nirman_construction_sanitize_checkbox'
	));
	$wp_customize->add_control('nirman_construction_hide_show_topbar',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Topbar','nirman-construction'),
   	'section' => 'nirman_construction_contact_details',
	));

	$wp_customize->add_setting('nirman_construction_call1_text',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nirman_construction_call1_text',array(
		'label'	=> __('Phone Text','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_call1_text',
		'type'	=> 'text'
	));
	
	$wp_customize->add_setting('nirman_construction_call1',array(
		'default'=> '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_phone_number'
	));	
	$wp_customize->add_control('nirman_construction_call1',array(
		'label'	=> __('Phone Number','nirman-construction'),
		'section'=> 'nirman_construction_contact_details',
		'setting'=> 'nirman_construction_call1',
		'type'=> 'text'
	));

	//social icons
	$wp_customize->add_setting('nirman_construction_facebook_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nirman_construction_facebook_url',array(
		'label'	=> __('Add Facebook link','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_facebook_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('nirman_construction_twitter_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nirman_construction_twitter_url',array(
		'label'	=> __('Add Twitter link','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_twitter_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('nirman_construction_linkedin_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('nirman_construction_linkedin_url',array(
		'label'	=> __('Add Linkedin link','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_linkedin_url',
		'type'	=> 'url'
	));
	
	$wp_customize->add_setting('nirman_construction_insta_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nirman_construction_insta_url',array(
		'label'	=> __('Add Instagram link','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_insta_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('nirman_construction_pintrest_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nirman_construction_pintrest_url',array(
		'label'	=> __('Add Pinterest link','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_pintrest_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('nirman_construction_btn_text',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nirman_construction_btn_text',array(
		'label'	=> __('Add Button Text','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_btn_text',
		'type'	=> 'text'
	));

	$wp_customize->add_setting('nirman_construction_btn_link',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nirman_construction_btn_link',array(
		'label'	=> __('Add Button Link','nirman-construction'),
		'section'	=> 'nirman_construction_contact_details',
		'setting'	=> 'nirman_construction_btn_link',
		'type'	=> 'url'
	));

	$wp_customize->add_setting( 'nirman_construction_toptext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_toptext_color', array(
		'label' => 'Phone Number Color',
		'section' => 'nirman_construction_contact_details',
	)));

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

	$wp_customize->add_setting( 'nirman_construction_topsocial_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_topsocial_color', array(
		'label' => 'Social Icon Color',
		'section' => 'nirman_construction_contact_details',
	)));

	$wp_customize->add_setting( 'nirman_construction_topsocialhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_topsocialhvr_color', array(
		'label' => 'Social Icon Hover Color',
		'section' => 'nirman_construction_contact_details',
	)));

	$wp_customize->add_setting( 'nirman_construction_topbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_topbg_color', array(
		'label' => 'Top Bg Color',
		'section' => 'nirman_construction_contact_details',
	)));

	$wp_customize->add_setting( 'nirman_construction_hmenu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_hmenu_color', array(
		'label' => 'Menu Color',
		'section' => 'nirman_construction_contact_details',
	)));

	$wp_customize->add_setting( 'nirman_construction_hmenuhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_hmenuhvr_color', array(
		'label' => 'Menu Hover Color',
		'section' => 'nirman_construction_contact_details',
	)));

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

	$wp_customize->add_setting( 'nirman_construction_hbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_hbtnbg_color', array(
		'label' => 'Button Bg Color',
		'section' => 'nirman_construction_contact_details',
	)));

	$wp_customize->add_setting( 'nirman_construction_hbg_color1', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_hbg_color1', array(
		'label' => 'Bottom Bg Color 1',
		'section' => 'nirman_construction_contact_details',
	)));

	$wp_customize->add_setting( 'nirman_construction_hbg_color2', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_hbg_color2', array(
		'label' => 'Bottom Bg Color 2',
		'section' => 'nirman_construction_contact_details',
	)));
	
	//home page slider
	$wp_customize->add_section( 'nirman_construction_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'nirman-construction' ),
		'priority'   => null,
		'panel' => 'nirman_construction_panel_id'
	) );

	$wp_customize->add_setting('nirman_construction_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'nirman_construction_sanitize_checkbox'
	));
	$wp_customize->add_control('nirman_construction_slider_hide_show',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide slider','nirman-construction'),
   	'description' => __('Image Size ( 1600px x 582px )','nirman-construction'),
   	'section' => 'nirman_construction_slider_section',
	));

	$wp_customize->add_setting( 'nirman_construction_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'nirman_construction_sanitize_choices'
	));
	$wp_customize->add_control( 'nirman_construction_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'nirman-construction' ),
		'section'  => 'nirman_construction_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'nirman-construction'),
			'bounceInRight' => __('bounceInRight', 'nirman-construction'),
			'bounceInUp'    => __('bounceInUp', 'nirman-construction'),
			'bounceInDown'    => __('bounceInDown', 'nirman-construction'),
			'zoomIn'  => __('zoomIn', 'nirman-construction'),
			'zoomOut' => __('zoomOut', 'nirman-construction'),
			'fadeInDown'    => __('fadeInDown', 'nirman-construction'),
			'fadeInUp'    => __('fadeInUp', 'nirman-construction'),
			'fadeInLeft'  => __('fadeInLeft', 'nirman-construction'),
			'fadeInRight' => __('fadeInRight', 'nirman-construction'),
			'flip-up'    => __('flip-up', 'nirman-construction'),
			'none'    => __('none', 'nirman-construction')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'nirman_construction_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'nirman_construction_sanitize_dropdown_pages'
		) );
		$wp_customize->add_control( 'nirman_construction_slider' . $count, array(
			'label'    => __( 'Select Slide Image Page', 'nirman-construction' ),
			'section'  => 'nirman_construction_slider_section',
			'type'     => 'dropdown-pages'
		) );
	}

	$wp_customize->add_setting('nirman_construction_slider_excerpt_length',array(
		'default' => '15',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','nirman-construction'),
		'section' => 'nirman_construction_slider_section',
	));

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

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

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

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

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

	$wp_customize->add_setting( 'nirman_construction_sliderbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_sliderbtnbg_color', array(
		'label' => 'Button Bg Color',
		'section' => 'nirman_construction_slider_section',
	)));

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

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


	//	Our Topics
	$wp_customize->add_section('nirman_construction_service',array(
		'title'	=> __('Our Services','nirman-construction'),
		'description'=> __('<b>Note :</b> This section will appear below the slider.','nirman-construction'),
		'panel' => 'nirman_construction_panel_id',
	));
	
	$wp_customize->add_setting('nirman_construction_title',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nirman_construction_title',array(
		'label'	=> __('Section Title','nirman-construction'),
		'section'	=> 'nirman_construction_service',
		'setting'	=> 'nirman_construction_title',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('nirman_construction_subtitle',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nirman_construction_subtitle',array(
		'label'	=> __('Section Subtitle','nirman-construction'),
		'section'	=> 'nirman_construction_service',
		'setting'	=> 'nirman_construction_subtitle',
		'type'		=> 'text'
	));

	$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('nirman_construction_cat',array(
		'default'	=> 'select',
		'sanitize_callback' => 'nirman_construction_sanitize_choices',
	));
	$wp_customize->add_control('nirman_construction_cat',array(
		'type'    => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','nirman-construction'),
		'section' => 'nirman_construction_service',
	));

	$wp_customize->add_setting('nirman_construction_service_img_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_service_img_size',array(
		'type' => 'number',
		'label' => __('Image Size','nirman-construction'),
		'section' => 'nirman_construction_service',
	));

	$wp_customize->add_setting('nirman_construction_service_section_padding',array(
      'default' => '',
      'sanitize_callback'	=> 'nirman_construction_sanitize_float'
	));
	$wp_customize->add_control('nirman_construction_service_section_padding',array(
		'type' => 'number',
		'label' => __('Section Top Bottom Padding','nirman-construction'),
		'section' => 'nirman_construction_service',
	));

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

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

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

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

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

	$wp_customize->add_setting( 'nirman_construction_servicebtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_servicebtnbg_color', array(
		'label' => 'Button Bg Color',
		'section' => 'nirman_construction_service',
	)));

	//Footer
   $wp_customize->add_section( 'nirman_construction_footer', array(
    	'title'      => __( 'Footer Setting', 'nirman-construction' ),
		'priority'   => null,
		'panel' => 'nirman_construction_panel_id'
	) );

	$wp_customize->add_setting('nirman_construction_show_back_totop',array(
 		'default' => true,
		'sanitize_callback'	=> 'nirman_construction_sanitize_checkbox'
	));
	$wp_customize->add_control('nirman_construction_show_back_totop',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Back to Top','nirman-construction'),
   	'section' => 'nirman_construction_footer'
	));

 	$wp_customize->add_setting('nirman_construction_footer_copy',array(
		'default'	=> 'Construction WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	 
	$wp_customize->add_control('nirman_construction_footer_copy',array(
		'label'	=> __('Copyright Text','nirman-construction'),
		'section'	=> 'nirman_construction_footer',
		'setting'	=> 'nirman_construction_footer_copy',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('nirman_construction_footer_copylink',array(
		'default'	=> 'https://www.luzuk.com/products/free-construction-wordpress-theme/',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nirman_construction_footer_copylink',array(
		'label'	=> __('Copyright Link','nirman-construction'),
		'section'	=> 'nirman_construction_footer',
		'setting'	=> 'nirman_construction_footer_copylink',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('nirman_construction_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nirman_construction_sanitize_float'
 	));
 	$wp_customize->add_control('nirman_construction_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','nirman-construction'),
		'section' => 'nirman_construction_footer',
	));

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

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

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

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

	$wp_customize->add_setting( 'nirman_construction_footerbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nirman_construction_footerbg_color', array(
		'label' => 'Footer Background Color',
		'section' => 'nirman_construction_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' => 'nirman_construction_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'nirman_construction_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'nirman_construction_customize_register' );

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

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

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

function nirman_construction_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 Nirman_Construction_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( 'Nirman_Construction_Customize_Section_Pro' );

		// Register sections.
		$manager->add_section(
			new Nirman_Construction_Customize_Section_Pro(
				$manager,
				'nirman_construction_example_1',
				array(
					'priority' => 9,
					'title'    => esc_html__( 'Construction Pro Theme', 'nirman-construction' ),
					'pro_text' => esc_html__( 'Go Pro','nirman-construction' ),
					'pro_url'  => esc_url( 'https://www.luzuk.com/products/construction-wordpress-theme/' ),
				)
			)
		);
	}

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

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

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

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