<?php
	$wp_customize->add_section('vw_book_store_pro_slider_section',array(
		'title'	=> __('Slider Settings','vw-book-store-pro'),
		'description'	=> __('Add slider images here.','vw-book-store-pro'),
		'priority'	=> null,
		'panel' => 'vw_book_store_pro_panel_id',
	));
	$wp_customize->add_setting('vw_book_store_pro_slider_enabledisable',array(
        'default'=> 'Enable',
        'sanitize_callback' => 'vw_book_store_pro_sanitize_choices'
    ));
	$wp_customize->add_control('vw_book_store_pro_slider_enabledisable', array(
        'type' => 'radio',
        'label' => 'Do you want this section',
        'section' => 'vw_book_store_pro_slider_section',
        'choices' => array(
            'Enable' => 'Enable',
            'Disable' => 'Disable'
        ),
    ));	

    $wp_customize->selective_refresh->add_partial( 'vw_book_store_pro_slider_enabledisable', array(
	    'selector' => '#carouselExampleIndicators .slider-box',
	    'render_callback' => 'vw_kids_pro_customize_partial_vw_book_store_pro_slider_enabledisable',
	));

	$wp_customize->add_setting('vw_book_store_pro_slide_number',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field',
	));
	$wp_customize->add_control('vw_book_store_pro_slide_number',array(
		'label'	=> __('Number of slides to show','vw-book-store-pro'),
		'section'	=> 'vw_book_store_pro_slider_section',
		'type'		=> 'number'
	));
	$count =  get_theme_mod('vw_book_store_pro_slide_number');
		
	for($i=1, $j=1; $i<=$count; $i++, $j++) {
		if($j>=5){ $j=1; }
		$wp_customize->add_setting('vw_book_store_pro_slide_image'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'esc_url_raw',
		));
		$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize,'vw_book_store_pro_slide_image'.$i,
	        array(
	            'label' => __('Slider Image ','vw-book-store-pro').$i.__(' (1600x562)','vw-book-store-pro'),
	            'section' => 'vw_book_store_pro_slider_section',
	            'settings' => 'vw_book_store_pro_slide_image'.$i
		)));
		$wp_customize->add_setting('vw_book_store_pro_slide_sub_heading'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_text_field',
		));
		$wp_customize->add_control('vw_book_store_pro_slide_sub_heading'.$i,array(
			'label' => __('Slide Top Heading','vw-book-store-pro').$i,
			'section' => 'vw_book_store_pro_slider_section',
			'setting'	=> 'vw_book_store_pro_slide_sub_heading'.$i,
			'type'	=> 'text'
		));
		$wp_customize->add_setting('vw_book_store_pro_slide_heading'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_text_field',
		));
		$wp_customize->add_control('vw_book_store_pro_slide_heading'.$i,array(
			'label' => __('Slide Heading Title','vw-book-store-pro').$i,
			'section' => 'vw_book_store_pro_slider_section',
			'setting'	=> 'vw_book_store_pro_slide_heading'.$i,
			'type'	=> 'text'
		));
		$wp_customize->add_setting('vw_book_store_pro_slide_text'.$i,array(
			'default'   => '',
			'capability'         => 'edit_theme_options',
			'sanitize_callback'  => 'wp_kses_post'
		));
		$wp_customize->add_control(new VW_Book_Store_Pro_Editor_Control($wp_customize,'vw_book_store_pro_slide_text'.$i,array(
			'label' => __('Slide Text','vw-book-store-pro').$i,
			'description' => __('Add Text','vw-book-store-pro').$i,
			'section' => 'vw_book_store_pro_slider_section',
			'setting'   => 'vw_book_store_pro_slide_text'.$i,       
		)));
		$wp_customize->add_setting('vw_book_store_pro_slide_btntext'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_textarea_field',
		));
		$wp_customize->add_control('vw_book_store_pro_slide_btntext'.$i,array(
			'label' => __('Slider Button Text','vw-book-store-pro').$i,
			'section' => 'vw_book_store_pro_slider_section',
			'setting'	=> 'vw_book_store_pro_slide_btntext'.$i,
			'type'	=> 'text'
		));
		$wp_customize->add_setting('vw_book_store_pro_slide_btnurl'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'esc_url_raw',
		));
		$wp_customize->add_control('vw_book_store_pro_slide_btnurl'.$i,array(
			'label' => __('Button URL','vw-book-store-pro').$i,
			'section' => 'vw_book_store_pro_slider_section',
			'setting'	=> 'vw_book_store_pro_slide_btnurl'.$i,
			'type'	=> 'text'
		));
	}

	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_other_setting_label',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'vw_book_store_pro_text_sanitization'
	));
	$wp_customize->add_control( new VW_Themes_Seperator_custom_Control( $wp_customize, 'vw_book_store_pro_slider_section_other_setting_label',
	array(
	'label' => __('Other Settings','vw-book-store-pro'),
	'section' => 'vw_book_store_pro_slider_section'
	)));

	$wp_customize->add_setting('vw_book_store_pro_slider_section_opacity_color',array(
      'default'              => '1',
      'sanitize_callback' => 'vw_book_store_pro_sanitize_choices'
	));

	$wp_customize->add_control( 'vw_book_store_pro_slider_section_opacity_color', array(
		'label'       => esc_html__( 'Slider Image Opacity','vw-book-store-pro' ),
		'section'     => 'vw_book_store_pro_slider_section',
		'type'        => 'select',
		'settings'    => 'vw_book_store_pro_slider_section_opacity_color',
		'choices' => array(
	      '0' =>  esc_attr('0','vw-book-store-pro'),
	      '0.1' =>  esc_attr('0.1','vw-book-store-pro'),
	      '0.2' =>  esc_attr('0.2','vw-book-store-pro'),
	      '0.3' =>  esc_attr('0.3','vw-book-store-pro'),
	      '0.4' =>  esc_attr('0.4','vw-book-store-pro'),
	      '0.5' =>  esc_attr('0.5','vw-book-store-pro'),
	      '0.6' =>  esc_attr('0.6','vw-book-store-pro'),
	      '0.7' =>  esc_attr('0.7','vw-book-store-pro'),
	      '0.8' =>  esc_attr('0.8','vw-book-store-pro'),
	      '0.9' =>  esc_attr('0.9','vw-book-store-pro'),
	      '1' =>  esc_attr('1','vw-book-store-pro')
		),
	));
	// Other Settings
	$wp_customize->add_setting('vw_book_store_pro_slide_delay',array(
		'default'	=> '10000',
		'sanitize_callback'	=> 'sanitize_text_field',
	));
	$wp_customize->add_control('vw_book_store_pro_slide_delay',array(
		'label'	=> __('Slide Delay','vw-book-store-pro'),
		'section'	=> 'vw_book_store_pro_slider_section',
		'description' => __('interval is in milliseconds. 1000 = 1 second -> so 1000 * 10 = 10 seconds', 'vw-book-store-pro'),
		'type'		=> 'number'
	));
	$wp_customize->add_setting( 'vw_book_store_pro_slide_remove_fade',
     array(
        'default' => 1,
        'transport' => 'refresh',
        'sanitize_callback' => 'vw_book_store_pro_switch_sanitization'
     )
    );   
    $wp_customize->add_control( new vw_book_store_pro_Toggle_Switch_Custom_control( $wp_customize, 'vw_book_store_pro_slide_remove_fade',
       array(
          'label' => esc_html__( 'Remove Fade Effect', 'vw-book-store-pro' ),
          'section' => 'vw_book_store_pro_slider_section'
       )
    ));

    /* ---------- content layout ------------- */
	
	$wp_customize->add_setting('vw_book_store_pro_slider_section_content_option',array(
        'default' => __('Center','vw-book-store-pro'),
        'sanitize_callback' => 'vw_book_store_pro_sanitize_choices'
	));
	$wp_customize->add_control(new vw_book_store_pro_Image_Radio_Control($wp_customize, 'vw_book_store_pro_slider_section_content_option', array(
        'type' => 'select',
        'label' => __('Slider Content Layouts','vw-book-store-pro'),
        'section' => 'vw_book_store_pro_slider_section',
        'choices' => array(
            'Left' => get_template_directory_uri().'/assets/images/slider-content1.png',
            'Center' => get_template_directory_uri().'/assets/images/slider-content2.png',
            'Right' => get_template_directory_uri().'/assets/images/slider-content3.png',
    ))));
	$wp_customize->add_setting('vw_book_store_pro_slider_section_content_spacing',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('vw_book_store_pro_slider_section_content_spacing',array(
		'label'	=> esc_html__('Slider Content Spacing','vw-book-store-pro'),
		'description'	=> __('Add value in percentage here.','vw-book-store-pro'),
		'section'=> 'vw_book_store_pro_slider_section',
	));

	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_slider_top_spacing', array(
		'default'  => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	) );
	$wp_customize->add_control( 'vw_book_store_pro_slider_section_slider_top_spacing', array(
		'label' => esc_html__( 'Top','vw-book-store-pro' ),
		'section' => 'vw_book_store_pro_slider_section',
		'type'  => 'number',
		'input_attrs' => array(
			'step' => 1,
			'min' => 0,
			'max' => 100,
		),
	) );

	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_slider_bottom_spacing', array(
		'default'  => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	) );
	$wp_customize->add_control( 'vw_book_store_pro_slider_section_slider_bottom_spacing', array(
		'label' => esc_html__( 'Bottom','vw-book-store-pro' ),
		'section' => 'vw_book_store_pro_slider_section',
		'type'  => 'number',
		'input_attrs' => array(
			'step' => 1,
			'min' => 0,
			'max' => 100,
		),
	) );

	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_slider_left_spacing', array(
		'default'  => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	) );
	$wp_customize->add_control( 'vw_book_store_pro_slider_section_slider_left_spacing', array(
		'label' => esc_html__( 'Left','vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'type'  => 'number',
		'input_attrs' => array(
			'step' => 1,
			'min' => 0,
			'max' => 100,
		),
	) );

	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_slider_right_spacing', array(
		'default'  => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	) );
	$wp_customize->add_control( 'vw_book_store_pro_slider_section_slider_right_spacing', array(
		'label' => esc_html__('Right','vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'type'  => 'number',
		'input_attrs' => array(
			'step' => 1,
			'min' => 0,
			'max' => 100,
		),
	) );

	$wp_customize->add_setting('vw_book_store_pro_slider_arrows',array(
        'default' => 'true',
        'sanitize_callback'	=> 'sanitize_text_field'
    ));
    $wp_customize->add_control('vw_book_store_pro_slider_arrows',array(
        'type' => 'checkbox',
        'label' => __('Show / Hide Next & Previous Arrows','interior-designs-pro'),
        'section' => 'vw_book_store_pro_slider_section',
    ));
    $wp_customize->add_setting('vw_book_store_pro_slider_dots',array(
        'default' => 'true',
        'sanitize_callback'	=> 'sanitize_text_field'
    ));
    $wp_customize->add_control('vw_book_store_pro_slider_dots',array(
        'type' => 'checkbox',
        'label' => __('Show / Hide Dots','interior-designs-pro'),
        'section' => 'vw_book_store_pro_slider_section',
    ));


	// This is Slider Heading Color picker setting
	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_heading_label',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'vw_book_store_pro_text_sanitization'
	));
	$wp_customize->add_control( new VW_Themes_Seperator_custom_Control( $wp_customize, 'vw_book_store_pro_slider_section_heading_label',
	array(
	'label' => __('Heading Typography','vw-book-store-pro'),
	'section' => 'vw_book_store_pro_slider_section'
	)));

	$wp_customize->add_setting( 'vw_book_store_pro_sliderHeading_color', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_book_store_pro_sliderHeading_color', array(
		'label' => __('Slider Heading Color', 'vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'settings' => 'vw_book_store_pro_sliderHeading_color',
	)));
	//This is Slider Heading FontFamily picker setting
	$wp_customize->add_setting('vw_book_store_pro_sliderHeading_font_family',array(
	  'default' => '',
	  'capability' => 'edit_theme_options',
	  'sanitize_callback' => 'vw_book_store_pro_sanitize_choices'
	));
	$wp_customize->add_control(
	    'vw_book_store_pro_sliderHeading_font_family', array(
	    'section'  => 'vw_book_store_pro_slider_section',
	    'label'    => __( 'Slider Heading Fonts','vw-book-store-pro'),
	    'type'     => 'select',
	    'choices'  => $font_array,
	));

	$wp_customize->add_setting('vw_book_store_pro_sliderHeading_font_size',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('vw_book_store_pro_sliderHeading_font_size',array(
		'label' => __('Heading Font Size','vw-book-store-pro'),
		'description' => __('Add font size in px','vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'setting' => 'vw_book_store_pro_sliderHeading_font_size',
		'type'    => 'number'
	));

	// This is Slider Heading Color picker setting
	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_heading_small_label',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'vw_book_store_pro_text_sanitization'
	));
	$wp_customize->add_control( new VW_Themes_Seperator_custom_Control( $wp_customize, 'vw_book_store_pro_slider_section_heading_small_label',
	array(
	'label' => __('Small Heading Typography','vw-book-store-pro'),
	'section' => 'vw_book_store_pro_slider_section'
	)));

	$wp_customize->add_setting( 'vw_book_store_pro_sliderHeading_smallcolor', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_book_store_pro_sliderHeading_smallcolor', array(
		'label' => __('Slider Small Heading Color', 'vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'settings' => 'vw_book_store_pro_sliderHeading_smallcolor',
	)));
	//This is Slider Heading FontFamily picker setting
	$wp_customize->add_setting('vw_book_store_pro_sliderHeading_small_font_family',array(
	  'default' => '',
	  'capability' => 'edit_theme_options',
	  'sanitize_callback' => 'vw_book_store_pro_sanitize_choices'
	));
	$wp_customize->add_control(
	    'vw_book_store_pro_sliderHeading_small_font_family', array(
	    'section'  => 'vw_book_store_pro_slider_section',
	    'label'    => __( 'Slider Small Heading Fonts','vw-book-store-pro'),
	    'type'     => 'select',
	    'choices'  => $font_array,
	));

	$wp_customize->add_setting('vw_book_store_pro_sliderHeading_small_font_size',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('vw_book_store_pro_sliderHeading_small_font_size',array(
		'label' => __('Heading Small Font Size','vw-book-store-pro'),
		'description' => __('Add font size in px','vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'setting' => 'vw_book_store_pro_sliderHeading_small_font_size',
		'type'    => 'number'
	));

	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_text_label',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'vw_book_store_pro_text_sanitization'
	));
	$wp_customize->add_control( new VW_Themes_Seperator_custom_Control( $wp_customize, 'vw_book_store_pro_slider_section_text_label',
	array(
	'label' => __('Text Typography','vw-book-store-pro'),
	'section' => 'vw_book_store_pro_slider_section'
	)));

	// This is Slider Text Color picker setting
	$wp_customize->add_setting( 'vw_book_store_pro_slidertext_color', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_book_store_pro_slidertext_color', array(
		'label' => __('Slider Text Color', 'vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'settings' => 'vw_book_store_pro_slidertext_color',
	)));
	//This is Slider Text FontFamily picker setting
	$wp_customize->add_setting('vw_book_store_pro_slidertext_font_family',array(
	  'default' => '',
	  'capability' => 'edit_theme_options',
	  'sanitize_callback' => 'vw_book_store_pro_sanitize_choices'
	));
	$wp_customize->add_control(
	    'vw_book_store_pro_slidertext_font_family', array(
	    'section'  => 'vw_book_store_pro_slider_section',
	    'label'    => __( 'Slider Text Fonts','vw-book-store-pro'),
	    'type'     => 'select',
	    'choices'  => $font_array,
	));

	$wp_customize->add_setting('vw_book_store_pro_slidertext_font_size',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('vw_book_store_pro_slidertext_font_size',array(
		'label' => __('Text Font Size','vw-book-store-pro'),
		'description' => __('Add font size in px','vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'setting' => 'vw_book_store_pro_slidertext_font_size',
		'type'    => 'number'
	));

	$wp_customize->add_setting( 'vw_book_store_pro_slider_section_btn_label',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'vw_book_store_pro_text_sanitization'
	));
	$wp_customize->add_control( new VW_Themes_Seperator_custom_Control( $wp_customize, 'vw_book_store_pro_slider_section_btn_label',
	array(
	'label' => __('Button Typography','vw-book-store-pro'),
	'section' => 'vw_book_store_pro_slider_section'
	)));

	// Button color settings
	$wp_customize->add_setting( 'vw_book_store_pro_slide_buttoncolor', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_book_store_pro_slide_buttoncolor', array(
		'label' => 'Button Text Color',
		'section' => 'vw_book_store_pro_slider_section',
		'settings' => 'vw_book_store_pro_slide_buttoncolor',
	)));
	$wp_customize->add_setting( 'vw_book_store_pro_slide_buttonbgcolor', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_book_store_pro_slide_buttonbgcolor', array(
		'label' => 'Button Background Color',
		'section' => 'vw_book_store_pro_slider_section',
		'settings' => 'vw_book_store_pro_slide_buttonbgcolor',
	)));
	$wp_customize->add_setting('vw_book_store_pro_button_fontfamily',array(
	  'default' => '',
	  'capability' => 'edit_theme_options',
	  'sanitize_callback' => 'vw_book_store_pro_sanitize_choices'
	 ));
	$wp_customize->add_control(
	    'vw_book_store_pro_button_fontfamily', array(
	    'section'  => 'vw_book_store_pro_slider_section',
	    'label'    => __( 'Button Text Fonts','vw-book-store-pro'),
	    'type'     => 'select',
	    'choices'  => $font_array,
 	));

 	$wp_customize->add_setting('vw_book_store_pro_button_fontsize',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('vw_book_store_pro_button_fontsize',array(
		'label' => __('Button Font Size','vw-book-store-pro'),
		'description' => __('Add font size in px','vw-book-store-pro'),
		'section' => 'vw_book_store_pro_slider_section',
		'setting' => 'vw_book_store_pro_button_fontsize',
		'type'    => 'number'
	));

	$wp_customize->add_setting( 'vw_book_store_pro_slide_button_hovercolor', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_book_store_pro_slide_button_hovercolor', array(
		'label' => 'Button Text Hover Color',
		'section' => 'vw_book_store_pro_slider_section',
		'settings' => 'vw_book_store_pro_slide_button_hovercolor',
	)));
	$wp_customize->add_setting( 'vw_book_store_pro_slide_buttonbg_hovercolor', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_book_store_pro_slide_buttonbg_hovercolor', array(
		'label' => 'Button Background Hover Color',
		'section' => 'vw_book_store_pro_slider_section',
		'settings' => 'vw_book_store_pro_slide_buttonbg_hovercolor',
	)));