<?php
/**
 * Slider Section Settings
 *
 * @package jeweler_shop
 */

// Add Slider Section
$wp_customize->add_section(
	'jeweler_shop_slider_section',
	array(
		'panel'    => 'jeweler_shop_front_page_options',
		'title'    => esc_html__( 'Slider Section', 'jeweler-shop' ),
		'priority' => 10,
	)
);

// Enable Slider Section
$wp_customize->add_setting(
	'jeweler_shop_enable_slider_section',
	array(
		'default'           => false,
		'sanitize_callback' => 'jeweler_shop_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Jeweler_Shop_Toggle_Switch_Custom_Control(
		$wp_customize,
		'jeweler_shop_enable_slider_section',
		array(
			'label'    => esc_html__( 'Enable Slider Section', 'jeweler-shop' ),
			'section'  => 'jeweler_shop_slider_section',
			'settings' => 'jeweler_shop_enable_slider_section',
		)
	)
);

//  Heading Label.
$wp_customize->add_setting(
	'jeweler_shop_slider_heading',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'jeweler_shop_slider_heading',
	array(
		'label'           => esc_html__( 'Slider Heading', 'jeweler-shop' ),
		'section'         => 'jeweler_shop_slider_section',
		'settings'        => 'jeweler_shop_slider_heading',
		'type'            => 'text',
		'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
	)
);

// Add Separator Custom Control
$wp_customize->add_setting( 'jeweler_shop_slider_separators', array(
	'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control( new Jeweler_Shop_Separator_Custom_Control( $wp_customize, 'jeweler_shop_slider_separators', array(
	'label' => __( 'Select Slider Category', 'jeweler-shop' ),
	'section' => 'jeweler_shop_slider_section',
	'settings' => 'jeweler_shop_slider_separators',
	'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
)));

// Slider Category Setting
$wp_customize->add_setting(
	'jeweler_shop_slider_slider_category',
	array(
		'default'           => 'slider',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	new Jeweler_Shop_Customize_Category_Dropdown_Control(
		$wp_customize,
		'jeweler_shop_slider_slider_category',
		array(
			'label'    => __( 'Select Slider Category', 'jeweler-shop' ),
			'section'  => 'jeweler_shop_slider_section',
			'settings' => 'jeweler_shop_slider_slider_category',
			'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
		)
	)
);

// Button Label
$wp_customize->add_setting(
	'jeweler_shop_slider_button_label',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'jeweler_shop_slider_button_label',
	array(
		'label'           => esc_html__( 'Button Label', 'jeweler-shop'  ),
		'section'         => 'jeweler_shop_slider_section',
		'settings'        => 'jeweler_shop_slider_button_label',
		'type'            => 'text',
		'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
	)
);

// Button Link
$wp_customize->add_setting(
	'jeweler_shop_slider_button_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'jeweler_shop_slider_button_link',
	array(
		'label'           => esc_html__( 'Button Link', 'jeweler-shop' ),
		'section'         => 'jeweler_shop_slider_section',
		'settings'        => 'jeweler_shop_slider_button_link',
		'type'            => 'url',
		'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
	)
);

//Image 1
$wp_customize->add_setting('jeweler_shop_slider_image_1', array(
    'default' => '',
    'sanitize_callback' => 'esc_url_raw',
));

$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'jeweler_shop_slider_image_1', array(
    'label' => __('Slider Image 1', 'jeweler-shop'),
    'section' => 'jeweler_shop_slider_section',
	'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
)));

//Image 2
$wp_customize->add_setting('jeweler_shop_slider_image_2', array(
    'default' => '',
    'sanitize_callback' => 'esc_url_raw',
));

$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'jeweler_shop_slider_image_2', array(
    'label' => __('Slider Image 2', 'jeweler-shop'),
    'section' => 'jeweler_shop_slider_section',
	'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
)));

$wp_customize->add_setting( 'jeweler_shop_banner_side_heading', array(
    'default'           => 'Bridal Jewelry',
    'transport'         => 'refresh',
    'sanitize_callback' => 'sanitize_text_field',
) );

// Add the control for the new heading
$wp_customize->add_control( 'jeweler_shop_banner_side_heading', array(
    'label'    => __( 'Add Banner Side Content', 'jeweler-shop' ),
    'section'  => 'jeweler_shop_slider_section',
    'settings' => 'jeweler_shop_banner_side_heading',
    'type'     => 'text',
	'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
) );

// Slider Button Label Color
$wp_customize->add_setting('jeweler_shop_slider_btn_color',array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'jeweler_shop_slider_btn_color',array(
			'label'           => __('Slider Button Label Color', 'jeweler-shop'),
			'section'         => 'jeweler_shop_slider_section',
			'settings'        => 'jeweler_shop_slider_btn_color',
			'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
		)
	)
);
// Slider Button Background Color
$wp_customize->add_setting('jeweler_shop_slider_btn_bg_color',array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'jeweler_shop_slider_btn_bg_color',array(
			'label'           => __('Slider Button Background Color', 'jeweler-shop'),
			'section'         => 'jeweler_shop_slider_section',
			'settings'        => 'jeweler_shop_slider_btn_bg_color',
			'active_callback' => 'jeweler_shop_is_slider_slider_section_enabled',
		)
	)
);

$wp_customize->add_setting( 
	'jeweler_shop_banner_settings_upgraded_features',
	array(
		'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control(
	'jeweler_shop_banner_settings_upgraded_features', 
	array(
		'type'=> 'hidden',
		'description' => "
			<div class='customizer-upgraded-features'>
				<i class='fas fa-info-circle'></i>
				<span class='pro-text'>
					Unlock Premium <strong>Features</strong> ?<br>
					<a target='_blank' href='". esc_url(JEWELER_SHOP_PREMIUM_PAGE) ." '>Upgrade Pro</a>
				</div>
			</div>
		",
		'section' => 'jeweler_shop_slider_section'
	)
);