<?php
/**
 * Banner Section
 *
 * @package electrical_services
 */

$wp_customize->add_section(
	'electrical_services_banner_section',
	array(
		'panel'    => 'electrical_services_front_page_options',
		'title'    => esc_html__( 'Banner Section', 'electrical-services' ),
		'priority' => 10,
	)
);

// Banner Section - Enable Section.

$wp_customize->add_setting(
	'electrical_services_enable_banner_section',
	array(
		'default'           => false,
		'sanitize_callback' => 'electrical_services_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Electrical_Services_Toggle_Switch_Custom_Control(
		$wp_customize,
		'electrical_services_enable_banner_section',
		array(
			'label'    => esc_html__( 'Enable Banner Section', 'electrical-services' ),
			'section'  => 'electrical_services_banner_section',
			'settings' => 'electrical_services_enable_banner_section',
		)
	)
);

if ( isset( $wp_customize->selective_refresh ) ) {
	$wp_customize->selective_refresh->add_partial(
		'electrical_services_enable_banner_section',
		array(
			'selector' => '#electrical_services_banner_section .section-link',
			'settings' => 'electrical_services_enable_banner_section',
		)
	);
}

// Banner Section - Banner Heading.
$wp_customize->add_setting(
	'electrical_services_banner_section_sub_title',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'electrical_services_banner_section_sub_title',
	array(
		'label'           => sprintf( esc_html__( 'Banner Sub Title', 'electrical-services' )),
		'section'         => 'electrical_services_banner_section',
		'settings'        => 'electrical_services_banner_section_sub_title',
		'type'            => 'text',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

// Banner Section - Banner Content.
$wp_customize->add_setting(
	'electrical_services_banner_section_title',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'electrical_services_banner_section_title',
	array(
		'label'           => sprintf( esc_html__( 'Banner Title', 'electrical-services' )),
		'section'         => 'electrical_services_banner_section',
		'settings'        => 'electrical_services_banner_section_title',
		'type'            => 'text',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

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

$wp_customize->add_control(
	'electrical_services_banner_secondary_stat_label',
	array(
		'label'           => __( 'Banner Below Title', 'electrical-services' ),
		'section'         => 'electrical_services_banner_section',
		'type'            => 'text',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

// Banner Section - Banner Description.
$wp_customize->add_setting(
	'electrical_services_banner_section_description',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_textarea_field',
	)
);

$wp_customize->add_control(
	'electrical_services_banner_section_description',
	array(
		'label'           => sprintf( esc_html__( 'Banner Description', 'electrical-services' )),
		'section'         => 'electrical_services_banner_section',
		'settings'        => 'electrical_services_banner_section_description',
		'type'            => 'text',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

// Banner Section - Button Label.
$wp_customize->add_setting(
	'electrical_services_banner_button_label_',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'electrical_services_banner_button_label_',
	array(
		'label'           => sprintf( esc_html__( 'First Button Text', 'electrical-services' )),
		'section'         => 'electrical_services_banner_section',
		'settings'        => 'electrical_services_banner_button_label_',
		'type'            => 'text',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

// Banner Section - Button Link.
$wp_customize->add_setting(
	'electrical_services_banner_button_link_' ,
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'electrical_services_banner_button_link_' ,
	array(
		'label'           => sprintf( esc_html__( 'First Button Link', 'electrical-services' )  ),
		'section'         => 'electrical_services_banner_section',
		'settings'        => 'electrical_services_banner_button_link_' ,
		'type'            => 'url',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

// Banner Section - Secondary Button Label.
$wp_customize->add_setting(
	'electrical_services_banner_second_button_label',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'electrical_services_banner_second_button_label',
	array(
		'label'           => sprintf( esc_html__( 'Second Button Text', 'electrical-services' ) ),
		'section'         => 'electrical_services_banner_section',
		'settings'        => 'electrical_services_banner_second_button_label',
		'type'            => 'text',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

// Banner Section - Secondary Button Link.
$wp_customize->add_setting(
	'electrical_services_banner_second_button_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'electrical_services_banner_second_button_link',
	array(
		'label'           => sprintf( esc_html__( 'Second Button Link', 'electrical-services' ) ),
		'section'         => 'electrical_services_banner_section',
		'settings'        => 'electrical_services_banner_second_button_link',
		'type'            => 'url',
		'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
	)
);

$wp_customize->add_setting('electrical_services_banner_section_image', array(
	'default' => get_template_directory_uri() . '/resource/img/default1.png',
    'sanitize_callback' => 'esc_url_raw',
));

$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'electrical_services_banner_section_image', array(
    'label' => __('Banner Image', 'electrical-services'),
    'section' => 'electrical_services_banner_section',
	'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
)));

$wp_customize->add_setting(
	'electrical_services_banner_small_image',
	array(
		'default'           => get_template_directory_uri() . '/resource/img/default2.png',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	new WP_Customize_Image_Control(
		$wp_customize,
		'electrical_services_banner_small_image',
		array(
			'label'           => __( 'Banner Small Image', 'electrical-services' ),
			'section'         => 'electrical_services_banner_section',
			'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
		)
	)
);



// Discount Percentage
$wp_customize->add_setting('electrical_services_banner_years_experience', [
	'default' => '',
    'sanitize_callback' => 'sanitize_text_field'
]);

$wp_customize->add_control('electrical_services_banner_years_experience', [
	'label' => __('Experience Years', 'electrical-services'),
    'section' => 'electrical_services_banner_section',
    'type' => 'text',
	'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
]);

// Discount Label (UP TO)
$wp_customize->add_setting('electrical_services_banner_years_experience_label', [
	'default' => '',
    'sanitize_callback' => 'sanitize_text_field'
]);

$wp_customize->add_control('electrical_services_banner_years_experience_label', [
    'label' => __('Experience Years Text', 'electrical-services'),
    'section' => 'electrical_services_banner_section',
    'type' => 'text',
	'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
]);

// Banner Button Label Color
$wp_customize->add_setting(
	'electrical_services_banner_btn_color',
	array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'electrical_services_banner_btn_color',array(
			'label' => __('Banner Button Label Color','electrical-services'),
			'section' => 'electrical_services_banner_section',
			'settings' => 'electrical_services_banner_btn_color',
			'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
		)
	)
);

// Banner Button Background Color
$wp_customize->add_setting('electrical_services_banner_btn_bg_color',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'electrical_services_banner_btn_bg_color',array(
			'label' => __('Banner Button Background Color','electrical-services'),
			'section' => 'electrical_services_banner_section',
			'settings' => 'electrical_services_banner_btn_bg_color',
			'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
		)
	)
);
// Banner Button Border Color
$wp_customize->add_setting(
	'electrical_services_banner_btn_border_color',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'electrical_services_banner_btn_border_color',array(
			'label' => __('Banner Button Border Color','electrical-services'),
			'section' => 'electrical_services_banner_section',
			'settings' => 'electrical_services_banner_btn_border_color',
			'active_callback' => 'electrical_services_is_banner_slider_section_enabled',
		)
	)
);


