<?php
/**
 * chalak-driving-school: Customizer
 *
 * @subpackage chalak-driving-school
 * @since 1.0
 */

function chalak_driving_school_customize_register( $wp_customize ) {

	$wp_customize->add_setting('chalak_driving_school_logo_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_logo_size',array(
		'type' => 'range',
		'description' => __('Logo Size (0-100%)','chalak-driving-school'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('chalak_driving_school_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('chalak_driving_school_logo_padding',array(
		'label' => __('Logo Padding','chalak-driving-school'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('chalak_driving_school_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','chalak-driving-school'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('chalak_driving_school_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','chalak-driving-school'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('chalak_driving_school_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','chalak-driving-school'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('chalak_driving_school_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','chalak-driving-school'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('chalak_driving_school_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_checkbox'
	));
	$wp_customize->add_control('chalak_driving_school_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','chalak-driving-school'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('chalak_driving_school_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','chalak-driving-school'),
		'section' => 'title_tagline',
	));

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

	$wp_customize->add_setting('chalak_driving_school_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_checkbox'
	));
	$wp_customize->add_control('chalak_driving_school_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','chalak-driving-school'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('chalak_driving_school_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','chalak-driving-school'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting( 'chalak_driving_school_site_tagline_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'chalak_driving_school_site_tagline_color', array(
		'label' => 'Tagline Color',
		'section' => 'title_tagline',
	)));

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

	$wp_customize->add_section( 'chalak_driving_school_theme_options_section', array(
    	'title'      => __( 'General Settings', 'chalak-driving-school' ),
		'priority'   => 30,
		'panel' => 'chalak_driving_school_panel_id'
	) );

	$wp_customize->add_setting('chalak_driving_school_theme_color', array(
		'default' => '#f6c504',
		'sanitize_callback' => 'sanitize_hex_color',
	));
	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'chalak_driving_school_theme_color', array(
		'label' => __('Theme Primary Color', 'chalak-driving-school'),
		'section' => 'chalak_driving_school_theme_options_section',
	)));

	// Add Settings and Controls for Layout
	$wp_customize->add_setting('chalak_driving_school_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'chalak_driving_school_sanitize_choices'	        
	));

	$wp_customize->add_control('chalak_driving_school_theme_options',array(
		'type' => 'radio',
		'label' => __('Sidebar Settings','chalak-driving-school'),
		'section' => 'chalak_driving_school_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','chalak-driving-school'),
		   'Right Sidebar' => __('Right Sidebar','chalak-driving-school'),
		   'One Column' => __('One Column','chalak-driving-school'),
		   'Three Columns' => __('Three Columns','chalak-driving-school'),
		   'Four Columns' => __('Four Columns','chalak-driving-school'),
		   'Grid Layout' => __('Grid Layout','chalak-driving-school')
		),
	));

	$wp_customize->add_setting( 'chalak_driving_school_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'chalak_driving_school_sanitize_choices'
	));
	
	$wp_customize->add_control( 'chalak_driving_school_boxfull_width', array(
		'label'    => __( 'Section Width', 'chalak-driving-school' ),
		'section'  => 'chalak_driving_school_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'chalak-driving-school'),
			'container-fluid' => __('Full Width', 'chalak-driving-school'),
			'none' => __('None', 'chalak-driving-school')
		),
	));

	$wp_customize->add_setting( 'chalak_driving_school_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'chalak_driving_school_sanitize_choices'
	));
	$wp_customize->add_control( 'chalak_driving_school_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'chalak-driving-school' ),
		'section'  => 'chalak_driving_school_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'chalak-driving-school'),
			'fadeInUp' => __('fadeInUp', 'chalak-driving-school'),
			'zoomIn'    => __('zoomIn', 'chalak-driving-school'),
			'None'    => __('None', 'chalak-driving-school')
		),
	));

	// Contact Details
	$wp_customize->add_section( 'chalak_driving_school_contact_details', array(
    	'title'      => __( 'Header Contact Details Setting', 'chalak-driving-school' ),
		'priority'   => null,
		'panel' => 'chalak_driving_school_panel_id'
	) );

	$wp_customize->add_setting('chalak_driving_school_hide_show_topbar',array(
    	'default' => false,
    	'sanitize_callback'	=> 'chalak_driving_school_sanitize_checkbox'
	));
	$wp_customize->add_control('chalak_driving_school_hide_show_topbar',array(
	   	'type' => 'checkbox',
	   	'label' => __('Show / Hide Topbar','chalak-driving-school'),
	   	'section' => 'chalak_driving_school_contact_details',
	));

	$wp_customize->add_setting('chalak_driving_school_call',array(
		'default'=> '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_phone_number'
	));	
	$wp_customize->add_control('chalak_driving_school_call',array(
		'label'	=> __('Contact Number','chalak-driving-school'),
		'section'=> 'chalak_driving_school_contact_details',
		'setting'=> 'chalak_driving_school_call',
		'type'=> 'text'
	));

	$wp_customize->add_setting('chalak_driving_school_mail',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_email'
	));	
	$wp_customize->add_control('chalak_driving_school_mail',array(
		'label'	=> __('Email Address','chalak-driving-school'),
		'section'=> 'chalak_driving_school_contact_details',
		'setting'=> 'chalak_driving_school_mail',
		'type'=> 'text'
	));

	$wp_customize->add_setting( 'chalak_driving_school_header_epicon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'chalak_driving_school_header_epicon_color', array(
		'label' => 'Email/Phone Icon Color',
		'section' => 'chalak_driving_school_contact_details',
	)));

	$wp_customize->add_setting( 'chalak_driving_school_header_eptext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'chalak_driving_school_header_eptext_color', array(
		'label' => 'Email/Phone Text Color',
		'section' => 'chalak_driving_school_contact_details',
	)));

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

	$wp_customize->add_setting( 'chalak_driving_school_header_menuhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'chalak_driving_school_header_menuhvr_color', array(
		'label' => 'Menus Hover Color',
		'section' => 'chalak_driving_school_contact_details',
	)));

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

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

	//social icons
	$wp_customize->add_section('chalak_driving_school_topbar_header',array(
		'title'	=> __('Social Icons','chalak-driving-school'),
		'description'	=> __('<b>Note</b> : Add Header Content here','chalak-driving-school'),
		'priority'	=> null,
		'panel' => 'chalak_driving_school_panel_id',
	));

	$wp_customize->add_setting('chalak_driving_school_facebook_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('chalak_driving_school_facebook_url',array(
		'label'	=> __('Add Facebook Link','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_topbar_header',
		'setting'	=> 'chalak_driving_school_facebook_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('chalak_driving_school_twitter_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('chalak_driving_school_twitter_url',array(
		'label'	=> __('Add Twitter Link','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_topbar_header',
		'setting'	=> 'chalak_driving_school_twitter_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('chalak_driving_school_youtube_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('chalak_driving_school_youtube_url',array(
		'label'	=> __('Add Youtube Link','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_topbar_header',
		'setting'	=> 'chalak_driving_school_youtube_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('chalak_driving_school_linkedin_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('chalak_driving_school_linkedin_url',array(
		'label'	=> __('Add Linkedin Link','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_topbar_header',
		'setting'	=> 'chalak_driving_school_linkedin_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('chalak_driving_school_insta_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('chalak_driving_school_insta_url',array(
		'label'	=> __('Add Instagram link','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_topbar_header',
		'setting'	=> 'chalak_driving_school_insta_url',
		'type'	=> 'url'
	));

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

	//home page slider
	$wp_customize->add_section( 'chalak_driving_school_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'chalak-driving-school' ),
		'priority'   => null,
		'panel' => 'chalak_driving_school_panel_id'
	) );

	$wp_customize->add_setting('chalak_driving_school_slider_hide_show',array(
		'default' => false,
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_checkbox'
	));
	$wp_customize->add_control('chalak_driving_school_slider_hide_show',array(
	   'type' => 'checkbox',
	   'label' => __('Show / Hide slider','chalak-driving-school'),
	   'section' => 'chalak_driving_school_slider_section',
	));

	$wp_customize->add_setting( 'chalak_driving_school_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'chalak_driving_school_sanitize_choices'
	));
	$wp_customize->add_control( 'chalak_driving_school_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'chalak-driving-school' ),
		'section'  => 'chalak_driving_school_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'chalak-driving-school'),
			'bounceInRight' => __('bounceInRight', 'chalak-driving-school'),
			'bounceInUp'    => __('bounceInUp', 'chalak-driving-school'),
			'bounceInDown'    => __('bounceInDown', 'chalak-driving-school'),
			'zoomIn'  => __('zoomIn', 'chalak-driving-school'),
			'zoomOut' => __('zoomOut', 'chalak-driving-school'),
			'fadeInDown'    => __('fadeInDown', 'chalak-driving-school'),
			'fadeInUp'    => __('fadeInUp', 'chalak-driving-school'),
			'fadeInLeft'  => __('fadeInLeft', 'chalak-driving-school'),
			'fadeInRight' => __('fadeInRight', 'chalak-driving-school'),
			'flip-up'    => __('flip-up', 'chalak-driving-school'),
			'none'    => __('none', 'chalak-driving-school')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'chalak_driving_school_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'chalak_driving_school_sanitize_dropdown_pages'
		) );
		$wp_customize->add_control( 'chalak_driving_school_slider' . $count, array(
			'label'    => __( 'Select Slide Image Page', 'chalak-driving-school' ),
			'section'  => 'chalak_driving_school_slider_section',
			'type'     => 'dropdown-pages'
		) );
	}

	$wp_customize->add_setting('chalak_driving_school_slider_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_slider_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','chalak-driving-school'),
		'section' => 'chalak_driving_school_slider_section',
	));

	$wp_customize->add_setting('chalak_driving_school_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','chalak-driving-school'),
		'section' => 'chalak_driving_school_slider_section',
	));

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

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

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

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

	$wp_customize->add_setting( 'chalak_driving_school_sliderbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'chalak_driving_school_sliderbg_color', array(
		'label' => 'Content BG Color',
		'section' => 'chalak_driving_school_slider_section',
	)));

	//	Our Services
	$wp_customize->add_section('chalak_driving_school_service',array(
		'title'	=> __('Our Services','chalak-driving-school'),
		'description'=> __('<b>Note :</b> This section will appear below the slider.','chalak-driving-school'),
		'panel' => 'chalak_driving_school_panel_id',
	));

	$wp_customize->add_setting('chalak_driving_school_our_services_title',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('chalak_driving_school_our_services_title',array(
		'label'	=> __('Section Title','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_service',
		'setting'	=> 'chalak_driving_school_our_services_title',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('chalak_driving_school_our_services_section_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_our_services_section_title_font_size',array(
		'type' => 'number',
		'label' => __('Section Title Font Size','chalak-driving-school'),
		'section' => 'chalak_driving_school_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('chalak_driving_school_category_setting',array(
		'default'	=> 'select',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control('chalak_driving_school_category_setting',array(
		'type'    => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','chalak-driving-school'),
		'section' => 'chalak_driving_school_service',
	));

	$wp_customize->add_setting('chalak_driving_school_our_services_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_our_services_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','chalak-driving-school'),
		'section' => 'chalak_driving_school_service',
	));

	$wp_customize->add_setting('chalak_driving_school_our_services_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_our_services_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','chalak-driving-school'),
		'section' => 'chalak_driving_school_service',
	));

	$wp_customize->add_setting('chalak_driving_school_services_section_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
    ));
    $wp_customize->add_control('chalak_driving_school_services_section_padding',array(
		'type' => 'number',
		'label' => __('Section Top Bottom Padding','chalak-driving-school'),
		'section' => 'chalak_driving_school_service',
    ));

	$wp_customize->add_setting('chalak_driving_school_img_hight',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_img_hight',array(
		'type' => 'number',
		'label' => __('Image Hight','chalak-driving-school'),
		'section' => 'chalak_driving_school_service',
	));

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

	//Footer
   	$wp_customize->add_section( 'chalak_driving_school_footer', array(
    	'title' => __( 'Footer Setting', 'chalak-driving-school' ),
		'priority' => null,
		'panel' => 'chalak_driving_school_panel_id'
	) );

	$wp_customize->add_setting('chalak_driving_school_show_back_totop',array(
 		'default' => true,
   		'sanitize_callback'	=> 'chalak_driving_school_sanitize_checkbox'
	));
	$wp_customize->add_control('chalak_driving_school_show_back_totop',array(
	   	'type' => 'checkbox',
	   	'label' => __('Show / Hide Back to Top','chalak-driving-school'),
	   	'section' => 'chalak_driving_school_footer'
	));

   $wp_customize->add_setting('chalak_driving_school_footer_copy',array(
		'default'	=> 'Driving School WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('chalak_driving_school_footer_copy',array(
		'label'	=> __('Copyright Text','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_footer',
		'setting'	=> 'chalak_driving_school_footer_copy',
		'type'		=> 'text'
	)); 

	$wp_customize->add_setting('chalak_driving_school_footer_copylink',array(
		'default'	=> 'https://www.luzuk.com/products/free-driving-school-wordpress-theme/',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('chalak_driving_school_footer_copylink',array(
		'label'	=> __('Copyright Link','chalak-driving-school'),
		'section'	=> 'chalak_driving_school_footer',
		'setting'	=> 'chalak_driving_school_footer_copylink',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('chalak_driving_school_footer_copy_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
	));
	$wp_customize->add_control('chalak_driving_school_footer_copy_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','chalak-driving-school'),
		'section' => 'chalak_driving_school_footer',
	));

	$wp_customize->add_setting('chalak_driving_school_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'chalak_driving_school_sanitize_float'
 	));
 	$wp_customize->add_control('chalak_driving_school_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','chalak-driving-school'),
		'section' => 'chalak_driving_school_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' => 'chalak_driving_school_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'chalak_driving_school_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'chalak_driving_school_customize_register' );

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

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

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

function chalak_driving_school_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 Chalak_Driving_School_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( 'Chalak_Driving_School_Customize_Section_Pro' );

		// Register sections.
		$manager->add_section(
			new Chalak_Driving_School_Customize_Section_Pro(
				$manager,
				'chalak_driving_school_example_1',
				array(
					'priority' => 9,
					'title'    => esc_html__( 'Driving School Pro', 'chalak-driving-school' ),
					'pro_text' => esc_html__( 'Go Pro','chalak-driving-school' ),
					'pro_url'  => esc_url( 'https://www.luzuk.com/products/driving-school-wordpress-theme/' ),
				)
			)
		);
	}

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

		wp_enqueue_script( 'chalak-driving-school-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'chalak-driving-school-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/css/customize-controls.css' );
	}
}

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