<?php
/**
 * chocolate-store Theme Customizer.
 *
 * @package chocolate-store
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function chocolate_store_customize_register( $wp_customize ) {
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
	$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
	$wp_customize->get_setting('custom_logo')->transport = 'refresh';	
}
add_action( 'customize_register', 'chocolate_store_customize_register' );

if ( ! defined( 'CHOCOLATE_STORE_BUY_NOW_1' ) ) {
define('CHOCOLATE_STORE_BUY_NOW_1',__('https://www.mishkatwp.com/themes/chocolate-store-wordpress-theme/','chocolate-store'));
}

if ( ! defined( 'CHOCOLATE_STORE_BUNDLE_1' ) ) {
define('CHOCOLATE_STORE_BUNDLE_1',__('https://www.mishkatwp.com/themes/wordpress-theme-bundle/','chocolate-store'));
}

if ( class_exists("Kirki")){

    //Post & Pages Setting Panel
	new \Kirki\Panel(
		'chocolate_store_post_pages_section',
		[
			'priority'    => 11,
			'title'       => esc_html__( 'Post & Pages Settings', 'chocolate-store' ),
		]
	);

	/* Banner Options */

	new \Kirki\Section(
		'chocolate_store_banner_options',
		[
			'title'       => esc_html__( 'Banner Image Settings', 'chocolate-store' ),
			'priority'    => 30,
			'panel'		  => 'chocolate_store_post_pages_section',
		]
	);

	new \Kirki\Field\Image(
		[
			'settings'    => 'chocolate_store_custom_fallback_img',
			'label'       => esc_html__( 'Featured Header Image Banner Background', 'chocolate-store' ),
			'section'     => 'chocolate_store_banner_options',
			'default'     => '',
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Feature', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_banner_options',
    ] );


	/* Single Post Options */

	new \Kirki\Section(
		'chocolate_store_single_post_options',
		[
			'title'       => esc_html__( 'Single Post Options', 'chocolate-store' ),
			'priority'    => 30,
			'panel'		  => 'chocolate_store_post_pages_section',
		]
	);

	/* Single Post Content Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_single_post_content_on_off',
			'label'       => esc_html__( 'Single Post Content On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_single_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Single Post Meta Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_single_meta_on_off',
			'label'       => esc_html__( 'Single Post Meta On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_single_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Single Post Feature Image Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_single_post_image_on_off',
			'label'       => esc_html__( 'Single Post Feature Image On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_single_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Single Post Pagination Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_single_post_pagination_on_off',
			'label'       => esc_html__( 'Single Post Pagination On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_single_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_single_post_options',
    ] );

	/* Page Options */
		new \Kirki\Section(
		'chocolate_store_single_page_options',
		[
			'title'       => esc_html__( 'Page Sidebar Options', 'chocolate-store' ),
			'priority'    => 30,
			'panel'		  => 'chocolate_store_post_pages_section',
		]
	);

	new \Kirki\Field\Radio(
	[
		'settings'    => 'chocolate_store_single_page_sidebar_option',
		'label'       => esc_html__( 'Page Sidebar Settings', 'chocolate-store' ),
		'section'     => 'chocolate_store_single_page_options',
		'default'     => 'right',
		'priority'    => 10,
		'choices'     => [
			'right'   => esc_html__( 'Page With Right Sidebar', 'chocolate-store' ),
			'left' => esc_html__( 'Page With Left Sidebar', 'chocolate-store' ),
			'none'  => esc_html__( 'Page With No Sidebar', 'chocolate-store' ),

		],
	]
);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_single_page_options',
    ] );
	/* Page Options End*/

	/* Post Options */

	new \Kirki\Section(
		'chocolate_store_post_options',
		[
			'title'       => esc_html__( 'Post Options', 'chocolate-store' ),
			'priority'    => 30,
			'panel'		  => 'chocolate_store_post_pages_section',
		]
	);
    
    /* Post Image Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_post_image_on_off',
			'label'       => esc_html__( 'Post Image On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Post Heading Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_post_heading_on_off',
			'label'       => esc_html__( 'Post Heading On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Post Content Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_post_content_on_off',
			'label'       => esc_html__( 'Post Content On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Post Date Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_post_date_on_off',
			'label'       => esc_html__( 'Post Date On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Post Comments Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_post_comment_on_off',
			'label'       => esc_html__( 'Post Comments On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Post Author Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_post_author_on_off',
			'label'       => esc_html__( 'Post Author On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Post Categories Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_post_categories_on_off',
			'label'       => esc_html__( 'Post Categories On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	/* Post limit Option End */
	new \Kirki\Field\Slider(
		[
			'settings'    => 'chocolate_store_post_content_limit',
			'label'       => esc_html__( 'Post Content Limit', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_options',
			'default'     => 15,
			'choices'     => [
				'min'  => 0,
				'max'  => 50,
				'step' => 1,
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_post_options',
    ] );

	/* Post Options End */

	/* Post Options */

	new \Kirki\Section(
		'chocolate_store_post_layouts_section',
		[
			'title'       => esc_html__( 'Post Layout Options', 'chocolate-store' ),
			'priority'    => 30,
			'panel'		  => 'chocolate_store_post_pages_section',
		]
	);

	new \Kirki\Field\Radio_Image(
		[
			'settings'    => 'chocolate_store_post_layout',
			'label'       => esc_html__( 'Blog Layout', 'chocolate-store' ),
			'section'     => 'chocolate_store_post_layouts_section',
			'default'     => 'two_column_right',
			'priority'    => 10,
			'choices'     => [
				'one_column'   => get_template_directory_uri().'/images/1column.png',
				'two_column_right' => get_template_directory_uri().'/images/right-sidebar.png',
				'two_column_left'  => get_template_directory_uri().'/images/left-sidebar.png',
				'three_column'  => get_template_directory_uri().'/images/3column.png',
				'four_column'  => get_template_directory_uri().'/images/4column.png',
				'grid_post'  => get_template_directory_uri().'/images/grid.png',
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_post_layouts_section',
    ] );

	/* Post Options End */

	/* Related Post Options */

	new \Kirki\Section(
		'chocolate_store_related_post_section',
		[
			'title'       => esc_html__( 'Related Post Options', 'chocolate-store' ),
			'priority'    => 30,
			'panel'		  => 'chocolate_store_post_pages_section',
		]
	);

    /* Post Image Option End */
	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_enable_related_post_thumbnail',
			'label'       => esc_html__( 'Related Post Image On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_related_post_section',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Feature', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_related_post_section',
    ] );

	/* Related Post Options End */

	/* 404 Page */

	new \Kirki\Section(
		'chocolate_store_404_page_section',
		[
			'title'       => esc_html__( '404 Page', 'chocolate-store' ),
			'description' => esc_html__( 'Here you can add 404 Page information.', 'chocolate-store' ),
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Text(
		[
			'settings' => 'chocolate_store_404_page_heading',
			'label'    => esc_html__( 'Add Heading', 'chocolate-store' ),
			'section'  => 'chocolate_store_404_page_section',
			'default'  => esc_html__( '404', 'chocolate-store' ),
			'priority' => 10,
		]
	);

	new \Kirki\Field\Text(
		[
			'settings' => 'chocolate_store_404_page_content',
			'label'    => esc_html__( 'Add Content', 'chocolate-store' ),
			'section'  => 'chocolate_store_404_page_section',
			'default'  => esc_html__( 'Ops! Something happened...', 'chocolate-store' ),
			'priority' => 10,
		]
	);

	new \Kirki\Field\Text(
		[
			'settings' => 'chocolate_store_404_page_button',
			'label'    => esc_html__( 'Add Button', 'chocolate-store' ),
			'section'  => 'chocolate_store_404_page_section',
			'default'  => esc_html__( 'Home', 'chocolate-store' ),
			'priority' => 10,
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_404_page_section',
    ] );

	/* 404 Page End */

	/* Logo */

	/* Logo Size limit Option End */
	new \Kirki\Field\Slider(
		[
			'settings'    => 'chocolate_store_logo_resizer_setting',
			'label'       => esc_html__( 'Logo Size Limit', 'chocolate-store' ),
			'section'     => 'title_tagline',
			'default'     => 70,
			'choices'     => [
				'min'  => 10,
				'max'  => 300,
				'step' => 10,
			],
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_site_title_setting',
			'label'       => esc_html__( 'Site Title On / Off', 'chocolate-store' ),
			'section'     => 'title_tagline',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_tagline_setting',
			'label'       => esc_html__( 'Tagline On / Off', 'chocolate-store' ),
			'section'     => 'title_tagline',
			'default'     => 'off',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'title_tagline',
    ] );

	/* Logo End */

	/* Responsive Options */

	new \Kirki\Section(
		'chocolate_store_responsive_options_section',
		[
			'title'       => esc_html__( 'Responsive Options', 'chocolate-store' ),
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_responsive_preloader_setting',
			'label'       => esc_html__( 'Preloader On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_responsive_options_section',
			'default'     => 'off',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Select(
	[
		'settings'    => 'chocolate_store_preloader_type',
		'label'       => esc_html__( 'Preloader Type', 'chocolate-store' ),
		'section'     => 'chocolate_store_general_options_section',
		'default'     => 'load',
		'placeholder' => esc_html__( 'Choose an option', 'chocolate-store' ),
		'choices'     => [
			'load' => esc_html__( 'Load', 'chocolate-store' ),
			'time' => esc_html__( 'Time', 'chocolate-store' ),
		],
	] );

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_responsive_scroll_to_top_setting',
			'label'       => esc_html__( 'Scroll To Top On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_responsive_options_section',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Feature', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_responsive_options_section',
    ] );


	/* Responsive End */

	/* General Options */

	new \Kirki\Section(
		'chocolate_store_general_options_section',
		[
			'title'       => esc_html__( 'General Options', 'chocolate-store' ),
			'priority'    => 10,
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_sticky_header_setting',
			'label'       => esc_html__( 'Show Hide Sticky Header', 'chocolate-store' ),
			'section'     => 'chocolate_store_general_options_section',
			'default'     => 'off',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_preloader_setting',
			'label'       => esc_html__( 'Preloader On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_general_options_section',
			'default'     => 'off',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_scroll_to_top_setting',
			'label'       => esc_html__( 'Scroll To Top On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_general_options_section',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Select(
		[
			'settings'    => 'chocolate_store_scroll_to_top_type',
			'label'       => esc_html__( 'Scroll To Top Type', 'chocolate-store' ),
			'section'     => 'chocolate_store_general_options_section',
			'default' => 'advance-scroll',
			'placeholder' => esc_html__( 'Choose an option', 'chocolate-store' ),
			'choices'     => [
				'advance-scroll' => __('Type 1','chocolate-store'),
	            'simple-scroll' => __('Type 2','chocolate-store'),
			],
		] );

	new \Kirki\Field\Select(
	[
		'settings'    => 'chocolate_store_scroll_top_alignment',
		'label'       => esc_html__( 'Scroll Top Alignment', 'chocolate-store' ),
		'section'     => 'chocolate_store_general_options_section',
		'default'     => 'Right',
		'choices'     => [
			'Left' => esc_html__( 'Left Align', 'chocolate-store' ),
			'Center' => esc_html__( 'Center Align', 'chocolate-store' ),
			'Right' => esc_html__( 'Right Align', 'chocolate-store' ),
		],
	]
);

	Kirki::add_field( 'theme_config_id', [
		'type'        => 'slider',
		'settings'    => 'chocolate_store_container_width',
		'label'       => esc_html__( 'Theme Container Width', 'chocolate-store' ),
		'section'     => 'chocolate_store_general_options_section',
		'default'     => 100,
		'choices'     => [
			'min'  => 50,
			'max'  => 100,
			'step' => 1,
		],
	] );

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_general_options_section',
    ] );

	/* General Options End */


	/* Typography Section */

	new \Kirki\Section(
		'chocolate_store_theme_typography_section',
		[
			'title'       => esc_html__( 'Theme Typography', 'chocolate-store' ),
			'description' => esc_html__( 'Here you can customize Heading or other body text font settings', 'chocolate-store' ),
			'priority'    => 30,
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'type'        => 'custom',
		'settings'    => 'chocolate_store_all_headings_typography',
		'section'     => 'chocolate_store_theme_typography_section',
			'default'         => '<h3 style="color: #2271b1; padding:10px; background:#fff; margin:0; border-left: solid 5px #2271b1; ">' . __( 'Heading Of All Sections',  'chocolate-store' ) . '</h3>',
		'priority'    => 10,
	] );

	Kirki::add_field( 'global', array(
		'type'        => 'typography',
		'settings'    => 'chocolate_store_all_headings_typography',
		'label'       => esc_html__( 'Heading Typography',  'chocolate-store' ),
		'description' => esc_html__( 'Select the typography options for your heading.',  'chocolate-store' ),
		'section'     => 'chocolate_store_theme_typography_section',
		'priority'    => 10,
		'default'     => array(
			'font-family'    => '',
			'variant'        => '',
		),
		'output' => array(
			array(
				'element' => array( 'h1','h2','h3','h4','h5','h6', ),
			),
		),
	) );

	Kirki::add_field( 'theme_config_id', [
		'type'        => 'custom',
		'settings'    => 'chocolate_store_body_content_typography',
		'section'     => 'chocolate_store_theme_typography_section',
			'default'         => '<h3 style="color: #2271b1; padding:10px; background:#fff; margin:0; border-left: solid 5px #2271b1; ">' . __( 'Body Content',  'chocolate-store' ) . '</h3>',
		'priority'    => 10,
	] );

	Kirki::add_field( 'global', array(
		'type'        => 'typography',
		'settings'    => 'chocolate_store_body_content_typography',
		'label'       => esc_html__( 'Content Typography',  'chocolate-store' ),
		'description' => esc_html__( 'Select the typography options for your content.',  'chocolate-store' ),
		'section'     => 'chocolate_store_theme_typography_section',
		'priority'    => 10,
		'default'     => array(
			'font-family'    => '',
			'variant'        => '',
		),
		'output' => array(
			array(
				'element' => array( 'body', ),
			),
		),
	) );

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_theme_typography_section',
    ] );

    /* End Typography */

        /* Woocommerce Section */

	new \Kirki\Section(
		'chocolate_store_theme_product_sidebar',
		[
			'title'       => esc_html__( 'Woocommerce Sidebars', 'chocolate-store' ),
			'description' => esc_html__( 'Here you can change woocommerce sidebar', 'chocolate-store' ),
			'panel' =>'woocommerce',
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Select(
		[
			'settings'    => 'chocolate_store_product_sidebar_position',
			'label'       => esc_html__( 'Sidebar Option', 'chocolate-store' ),
			'section'     => 'chocolate_store_theme_product_sidebar',
			'default'     => 'right',
			'choices'     => [
				'left' => esc_html__( 'Left Sidebar', 'chocolate-store' ),
				'right' => esc_html__( 'Right Sidebar', 'chocolate-store' ),
				'none' => esc_html__( 'No Sidebar', 'chocolate-store' ),
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_theme_product_sidebar',
    ] );

    /* Woocommerce Section End */

    /* Global Color Section */

	new \Kirki\Section(
		'chocolate_store_theme_color_section',
		[
			'title'       => esc_html__( 'Theme Colors Option', 'chocolate-store' ),
			'description' => esc_html__( 'Here you can change your theme color', 'chocolate-store' ),
			'priority'    => 30,
		]
	);


	Kirki::add_field( 'theme_config_id', [
		'type'        => 'color',
		'settings'    => 'chocolate_store_theme_color_1',
		'label'       => __( 'Select Your First Color', 'chocolate-store' ),
		'section'     => 'chocolate_store_theme_color_section',
		'default'     => '#BC0923',
	] );

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_theme_color_section',
    ] );

       /* Global Color End */

    /* Breadcrumb Section */

	new \Kirki\Section(
		'chocolate_store_breadcrumb_section',
		[
			'title'       => esc_html__( 'Theme Breadcrumb Option', 'chocolate-store' ),
			'description' => esc_html__( 'The breadcrumbs for your theme can be included here.', 'chocolate-store' ),
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_breadcrumb_setting',
			'label'       => esc_html__( 'Enable Breadcrumbs Option', 'chocolate-store' ),
			'section'     => 'chocolate_store_breadcrumb_section',
			'default'     => true,
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	Kirki::add_field( 'theme_config_id', [
	    'type'        => 'text',
	    'settings'    => 'chocolate_store_breadcrumb_separator',
	    'label'       => esc_html__( 'Breadcrumb Separator Setting', 'chocolate-store' ),
	    'section'     => 'chocolate_store_breadcrumb_section',
	    'default'     => ' → ',
	    'priority'    => 10,
	] );

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_breadcrumb_section',
    ] );


    /* Breadcrumb section End */

	// PANEL
	Kirki::add_panel( 'chocolate_store_panel_id_5', array(
	    'priority'    => 10,
	    'title'       => esc_html__( 'Theme Animations', 'chocolate-store' ),
	) );

	// ANIMATION SECTION
	Kirki::add_section( 'chocolate_store_section_animation', array(
	    'title'          => esc_html__( 'Animations', 'chocolate-store' ),
	    'priority'       => 2,
	) );

	Kirki::add_field( 'theme_config_id', [
		'type'        => 'switch',
		'settings'    => 'chocolate_store_animation_enabled',
		'label'       => esc_html__( 'Turn To Show Animation', 'chocolate-store' ),
		'section'     => 'chocolate_store_section_animation',
		'default'     => true,
		'priority'    => 10,
		'choices'     => [
			'on'  => esc_html__( 'Enable', 'chocolate-store' ),
			'off' => esc_html__( 'Disable', 'chocolate-store' ),
		],
	] );

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Feature', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'priority'    => 100,
        'section'     => 'chocolate_store_section_animation',
    ] );

	//Home page Setting Panel
	new \Kirki\Panel(
		'chocolate_store_home_page_section',
		[
			'priority'    => 10,
			'title'       => esc_html__( 'Home Page Sections', 'chocolate-store' ),
		]
	);

	/* Header */

	new \Kirki\Section(
		'chocolate_store_header_button_section',
		[
			'title'       => esc_html__( 'Header', 'chocolate-store' ),
			'description' => esc_html__( 'Here you can add header text.', 'chocolate-store' ),
			'panel'		  => 'chocolate_store_home_page_section',
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Text(
		[
			'settings' => 'chocolate_store_header_text',
			'label'    => esc_html__( 'Add Top Header Text', 'chocolate-store' ),
			'section'  => 'chocolate_store_header_button_section',
			'default'  => '',
			'priority' => 10,
		]
	);

	Kirki::add_field( 'theme_config_id', [
		'label'    => esc_html__( 'Buy Our Premium Theme For More Features', 'chocolate-store' ),
		'default'  => 
	        '<a class="premium_info_btn" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUY_NOW_1 ) . '">' . __( 'Buy Pro', 'chocolate-store' ) . '</a>' .
	        '<a class="premium_info_btn bundle" target="_blank" href="' . esc_url( CHOCOLATE_STORE_BUNDLE_1 ) . '">' . __( 'Buy All Themes In Single Package', 'chocolate-store' ) . '</a>',
        'type'        => 'custom',
        'section'     => 'chocolate_store_header_button_section',
    ] );

	/* Home Slider */

	new \Kirki\Section(
		'chocolate_store_home_slider_section',
		[
			'title'       => esc_html__( 'Home Slider', 'chocolate-store' ),
			'description' => esc_html__( 'Here you can add slider image, title and text.', 'chocolate-store' ),
			'panel'		  => 'chocolate_store_home_page_section',
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_slide_on_off',
			'label'       => esc_html__( 'Slider On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_home_slider_section',
			'default'     => 'off',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Number(
		[
			'settings' => 'chocolate_store_slide_count',
			'label'    => esc_html__( 'Slider Number Control', 'chocolate-store' ),
			'section'  => 'chocolate_store_home_slider_section',
			'default'  => '',
			'choices'  => [
				'min'  => 1,
				'max'  => 2	,
				'step' => 1,
			],
		]
	);

	$chocolate_store_slide_count = get_theme_mod('chocolate_store_slide_count');

	for ($i=1; $i <= $chocolate_store_slide_count; $i++) { 
		
		new \Kirki\Field\Image(
			[
				'settings'    => 'chocolate_store_slider_image'.$i,
				'label'       => esc_html__( 'Slider Image 0', 'chocolate-store' ).$i,
				'section'     => 'chocolate_store_home_slider_section',
				'default'     => '',
			]
		);

		new \Kirki\Field\Text(
			[
				'settings' => 'chocolate_store_slider_short_heading'.$i,
				'label'    => esc_html__( 'Short Heading 0', 'chocolate-store' ).$i,
				'section'  => 'chocolate_store_home_slider_section',
			]
		);

		new \Kirki\Field\Text(
			[
				'settings' => 'chocolate_store_slider_heading'.$i,
				'label'    => esc_html__( 'Main Heading 0', 'chocolate-store' ).$i,
				'section'  => 'chocolate_store_home_slider_section',
			]
		);

		new \Kirki\Field\Text(
			[
				'settings' => 'chocolate_store_slider_button_text'.$i,
				'label'    => esc_html__( 'Button Text 0', 'chocolate-store' ).$i,
				'section'  => 'chocolate_store_home_slider_section',
			]
		);

		new \Kirki\Field\URL(
			[
				'settings' => 'chocolate_store_slider_button_link'.$i,
				'label'    => esc_html__( 'Button Url 0', 'chocolate-store' ).$i,
				'section'  => 'chocolate_store_home_slider_section',
				'default'  => '',
			]
		);

	}

	/* Home Products */

	new \Kirki\Section(
		'chocolate_store_home_product_section',
		[
			'title'       => esc_html__( 'Home Products', 'chocolate-store' ),
			'description' => esc_html__( 'Here you can select product category to display products.', 'chocolate-store' ),
			'panel'		  => 'chocolate_store_home_page_section',
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_product_on_off',
			'label'       => esc_html__( 'Products On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_home_product_section',
			'default'     => 'off',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Text(
		[
			'settings' => 'chocolate_store_featured_product_heading',
			'label'    => esc_html__( 'Main Heading', 'chocolate-store' ),
			'section'  => 'chocolate_store_home_product_section',
		]
	);

	new \Kirki\Field\Text(
		[
			'settings' => 'chocolate_store_featured_product_content',
			'label'    => esc_html__( 'Main Heading Content', 'chocolate-store' ),
			'section'  => 'chocolate_store_home_product_section',
		]
	);

	/* Footer */

	new \Kirki\Section(
		'chocolate_store_footer_section',
		[
			'title'       => esc_html__( 'Footer', 'chocolate-store' ),
			'panel'		  => 'chocolate_store_home_page_section',
			'priority'    => 30,
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_footer_widgets_on_off',
			'label'       => esc_html__( 'Footer Widgets On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_footer_section',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Checkbox_Switch(
		[
			'settings'    => 'chocolate_store_copyright_on_off',
			'label'       => esc_html__( 'Footer Copyright On / Off', 'chocolate-store' ),
			'section'     => 'chocolate_store_footer_section',
			'default'     => 'on',
			'choices'     => [
				'on'  => esc_html__( 'Enable', 'chocolate-store' ),
				'off' => esc_html__( 'Disable', 'chocolate-store' ),
			],
		]
	);

	new \Kirki\Field\Text(
		[
			'settings' => 'chocolate_store_copyright_content_text',
			'label'    => esc_html__( 'Copyright Text', 'chocolate-store' ),
			'section'  => 'chocolate_store_footer_section',
		]
	);

	new \Kirki\Field\Select(
	[
		'settings'    => 'chocolate_store_copyright_alignment',
		'label'       => esc_html__( 'Copyright Text Alignment', 'chocolate-store' ),
		'section'     => 'chocolate_store_footer_section',
		'default'     => 'Center',
		'choices'     => [
			'Left' => esc_html__( 'Left Align', 'chocolate-store' ),
			'Center' => esc_html__( 'Center Align', 'chocolate-store' ),
			'Right' => esc_html__( 'Right Align', 'chocolate-store' ),
		],
	]
);

	new \Kirki\Field\Image(
	[
		'settings'    => 'chocolate_store_footer_background_image',
		'label'       => esc_html__( 'Select Your Appropriate Image for footer background', 'chocolate-store' ),
		'section'     => 'chocolate_store_footer_section',
		'default'     => '',
	] );

	Kirki::add_field( 'theme_config_id', [
		'type'        => 'color',
		'settings'    => 'chocolate_store_footer_background_color',
		'label'       => __( 'Select Your Appropriate Color for footer background', 'chocolate-store' ),
		'section'     => 'chocolate_store_footer_section',
		'default'     => '#191718',
	] );

}

function chocolate_store_customizer_settings( $wp_customize ) {

    // Slider Product
	$chocolate_store_args = array(
		'type'                     => 'product',
		 'child_of'                 => 0,
		 'parent'                   => '',
		 'orderby'                  => 'term_group',
		 'order'                    => 'ASC',
		 'hide_empty'               => false,
		 'hierarchical'             => 1,
		 'number'                   => '',
		 'taxonomy'                 => 'product_cat',
		 'pad_counts'               => false
	 );
 
	 $categories = get_categories($chocolate_store_args);
	 $cat_posts = array();
	 $m = 0;
	 $cat_posts[]='Select';
	 foreach($categories as $category){
		 if($m==0){
			 $default = $category->slug;
			 $m++;
		 }
		 $cat_posts[$category->slug] = $category->name;
	 }
 
	 $wp_customize->add_setting('chocolate_store_slider_product_category',array(
		 'default'	=> 'select',
		 'sanitize_callback' => 'chocolate_store_sanitize_select',
	 ));
 
	 $wp_customize->add_control('chocolate_store_slider_product_category',array(
		 'type'    => 'select',
		 'choices' => $cat_posts,
		 'label' => __('Select category to display products ','chocolate-store'),
		 'section' => 'chocolate_store_home_slider_section',
	 ));



	// Product Section

	$chocolate_store_args = array(
       'type'                     => 'product',
        'child_of'                 => 0,
        'parent'                   => '',
        'orderby'                  => 'term_group',
        'order'                    => 'ASC',
        'hide_empty'               => false,
        'hierarchical'             => 1,
        'number'                   => '',
        'taxonomy'                 => 'product_cat',
        'pad_counts'               => false
    );

	$categories = get_categories($chocolate_store_args);
	$cat_posts = array();
	$m = 0;
	$cat_posts[]='Select';
	foreach($categories as $category){
		if($m==0){
			$default = $category->slug;
			$m++;
		}
		$cat_posts[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('chocolate_store_featured_product_category',array(
		'default'	=> 'select',
		'sanitize_callback' => 'chocolate_store_sanitize_select',
	));

	$wp_customize->add_control('chocolate_store_featured_product_category',array(
		'type'    => 'select',
		'choices' => $cat_posts,
		'label' => __('Select category to display products ','chocolate-store'),
		'section' => 'chocolate_store_home_product_section',
	));



}

add_action( 'customize_register', 'chocolate_store_customizer_settings' );