<?php
/**
 * Classic Gaming Theme Customizer
 *
 * @package Classic Gaming
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function classic_gaming_customize_register( $wp_customize ) {

	function classic_gaming_sanitize_dropdown_pages( $page_id, $setting ) {
  		$page_id = absint( $page_id );
  		return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default );
	}

	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';

	wp_enqueue_style('classic-gaming-customize-controls', trailingslashit(esc_url(get_template_directory_uri())).'/css/customize-controls.css');

	if ( class_exists( 'WP_Customize_Control' ) ) {
		require_once get_template_directory() . '/inc/customizer-custom-controls.php';
	}

	// Enable / Disable Logo
	$wp_customize->add_setting('classic_gaming_logo_enable',array(
		'default' => true,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_gaming_logo_enable', array(
	   'settings' => 'classic_gaming_logo_enable',
	   'section'   => 'title_tagline',
	   'label'     => __('Enable Logo','classic-gaming'),
	   'type'      => 'checkbox'
	));

	//Logo
    $wp_customize->add_setting('classic_gaming_logo_width', array(
        'default' => '',
        'transport' => 'refresh',
        'sanitize_callback' => 'classic_gaming_sanitize_integer'
    ));
    $wp_customize->add_control(new Classic_Gaming_Slider_Custom_Control($wp_customize, 'classic_gaming_logo_width', array(
    	'label'          => __( 'Logo Width', 'classic-gaming'),
        'section' => 'title_tagline',
        'settings' => 'classic_gaming_logo_width',
        'input_attrs' => array(
            'step' => 1,
            'min' => 0,
            'max' => 300,
        ),
    )));

	// color site title
	$wp_customize->add_setting('classic_gaming_sitetitle_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_gaming_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));

	$wp_customize->add_control( 'classic_gaming_sitetitle_color', array(
	   'settings' => 'classic_gaming_sitetitle_color',
	   'section'   => 'title_tagline',
	   'label' => __('Site Title Color', 'classic-gaming'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('classic_gaming_title_enable',array(
		'default' => false,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_gaming_title_enable', array(
	   'settings' => 'classic_gaming_title_enable',
	   'section'   => 'title_tagline',
	   'label'     => __('Enable Site Title','classic-gaming'),
	   'type'      => 'checkbox'
	));

	// color site tagline
	$wp_customize->add_setting('classic_gaming_sitetagline_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_gaming_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_sitetagline_color', array(
	   'settings' => 'classic_gaming_sitetagline_color',
	   'section'   => 'title_tagline',
	   'label' => __('Site Tagline Color', 'classic-gaming'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('classic_gaming_tagline_enable',array(
		'default' => false,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_gaming_tagline_enable', array(
	   'settings' => 'classic_gaming_tagline_enable',
	   'section'   => 'title_tagline',
	   'label'     => __('Enable Site Tagline','classic-gaming'),
	   'type'      => 'checkbox'
	));

	// woocommerce section
	$wp_customize->add_section('classic_gaming_woocommerce_page_settings', array(
		'title'    => __('WooCommerce Page Settings', 'classic-gaming'),
		'priority' => null,
		'panel'    => 'woocommerce',
	));

	$wp_customize->add_setting('classic_gaming_shop_page_sidebar',array(
		'default' => false,
		'sanitize_callback'	=> 'classic_gaming_sanitize_checkbox'
	 ));
	 $wp_customize->add_control('classic_gaming_shop_page_sidebar',array(
		'type' => 'checkbox',
		'label' => __(' Check To Enable Shop page sidebar','classic-gaming'),
		'section' => 'classic_gaming_woocommerce_page_settings',
	 ));

    // shop page sidebar alignment
    $wp_customize->add_setting('classic_gaming_shop_page_sidebar_position', array(
		'default'           => 'Right Sidebar',
		'sanitize_callback' => 'classic_gaming_sanitize_choices',
	));
	$wp_customize->add_control('classic_gaming_shop_page_sidebar_position',array(
		'type'           => 'radio',
		'label'          => __('Shop Page Sidebar', 'classic-gaming'),
		'section'        => 'classic_gaming_woocommerce_page_settings',
		'choices'        => array(
			'Left Sidebar'  => __('Left Sidebar', 'classic-gaming'),
			'Right Sidebar' => __('Right Sidebar', 'classic-gaming'),
		),
	));	 

	$wp_customize->add_setting('classic_gaming_wooproducts_nav',array(
		'default' => 'Yes',
		'sanitize_callback'	=> 'classic_gaming_sanitize_choices'
	 ));
	 $wp_customize->add_control('classic_gaming_wooproducts_nav',array(
		'type' => 'select',
		'label' => __('Shop Page Products Navigation','classic-gaming'),
		'choices' => array(
			 'Yes' => __('Yes','classic-gaming'),
			 'No' => __('No','classic-gaming'),
		 ),
		'section' => 'classic_gaming_woocommerce_page_settings',
	 ));

	 $wp_customize->add_setting( 'classic_gaming_single_page_sidebar',array(
		'default' => false,
		'sanitize_callback'	=> 'classic_gaming_sanitize_checkbox'
    ) );
    $wp_customize->add_control('classic_gaming_single_page_sidebar',array(
    	'type' => 'checkbox',
       	'label' => __('Check To Enable Single Product Page Sidebar','classic-gaming'),
		'section' => 'classic_gaming_woocommerce_page_settings'
    ));

	// single product page sidebar alignment
    $wp_customize->add_setting('classic_gaming_single_product_page_layout', array(
		'default'           => 'Right Sidebar',
		'sanitize_callback' => 'classic_gaming_sanitize_choices',
	));
	$wp_customize->add_control('classic_gaming_single_product_page_layout',array(
		'type'           => 'radio',
		'label'          => __('Single product Page Sidebar', 'classic-gaming'),
		'section'        => 'classic_gaming_woocommerce_page_settings',
		'choices'        => array(
			'Left Sidebar'  => __('Left Sidebar', 'classic-gaming'),
			'Right Sidebar' => __('Right Sidebar', 'classic-gaming'),
		),
	));

	$wp_customize->add_setting('classic_gaming_related_product_enable',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_gaming_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_gaming_related_product_enable',array(
		'type' => 'checkbox',
		'label' => __('Check To Enable Related product','classic-gaming'),
		'section' => 'classic_gaming_woocommerce_page_settings',
	));

	$wp_customize->add_setting( 'classic_gaming_woo_product_img_border_radius', array(
        'default'              => '0',
        'transport'            => 'refresh',
        'sanitize_callback'    => 'classic_gaming_sanitize_integer'
    ) );
    $wp_customize->add_control(new Classic_Gaming_Slider_Custom_Control( $wp_customize, 'classic_gaming_woo_product_img_border_radius',array(
		'label'	=> esc_html__('Woo Product Img Border Radius','classic-gaming'),
		'section'=> 'classic_gaming_woocommerce_page_settings',
		'settings'=>'classic_gaming_woo_product_img_border_radius',
		'input_attrs' => array(
            'step'             => 1,
			'min'              => 0,
			'max'              => 100,
        ),
	)));
    // Add a setting for number of products per row
    $wp_customize->add_setting('classic_gaming_products_per_row', array(
	    'default'   => '4',
	    'transport' => 'refresh',
	    'sanitize_callback' => 'classic_gaming_sanitize_integer'  
    ));

   $wp_customize->add_control('classic_gaming_products_per_row', array(
	   'label'    => __('Products Per Row', 'classic-gaming'),
	   'section'  => 'classic_gaming_woocommerce_page_settings',
	   'settings' => 'classic_gaming_products_per_row',
	   'type'     => 'select',
	   'choices'  => array(
		      '2' => '2',
		'      3' => '3',
		      '4' => '4',
	  ),
   ) );

   // Add a setting for the number of products per page
   $wp_customize->add_setting('classic_gaming_products_per_page', array(
	'default'   => '9',
	'transport' => 'refresh',
	'sanitize_callback' => 'classic_gaming_sanitize_integer'
   ));

   $wp_customize->add_control('classic_gaming_products_per_page', array(
	  'label'    => __('Products Per Page', 'classic-gaming'),
	  'section'  => 'classic_gaming_woocommerce_page_settings',
	  'settings' => 'classic_gaming_products_per_page',
	  'type'     => 'number',
	  'input_attrs' => array(
		 'min'  => 1,
		 'step' => 1,
	 ),
   ));	

   $wp_customize->add_setting('classic_gaming_product_sale_position',array(
	'default' => 'Left',
	'sanitize_callback' => 'classic_gaming_sanitize_choices'
	));
	$wp_customize->add_control('classic_gaming_product_sale_position',array(
		'type' => 'radio',
		'label' => __('Product Sale Position','classic-gaming'),
		'section' => 'classic_gaming_woocommerce_page_settings',
		'choices' => array(
			'Left' => __('Left','classic-gaming'),
			'Right' => __('Right','classic-gaming'),
		),
	) );   

	//Theme Options
	$wp_customize->add_panel( 'classic_gaming_panel_area', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'title' => __( 'Theme Options Panel', 'classic-gaming' ),
	) );

	//Site Layout Section
	$wp_customize->add_section('classic_gaming_site_layoutsec',array(
		'title'	=> __('Manage Site Layout Section ','classic-gaming'),
		'description' => __('<p class="sec-title">Manage Site Layout Section</p>','classic-gaming'),
		'priority'	=> 1,
		'panel' => 'classic_gaming_panel_area',
	));

	$wp_customize->add_setting('classic_gaming_preloader',array(
		'default' => false,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_gaming_preloader', array(
	   'section'   => 'classic_gaming_site_layoutsec',
	   'label'	=> __('Check to Show preloader','classic-gaming'),
	   'type'      => 'checkbox'
 	));	
    $wp_customize->add_setting('classic_gaming_cursor_outline',array(
		'default' => false,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_gaming_cursor_outline', array(
	   'section'   => 'classic_gaming_site_layoutsec',
	   'label'	=> __('Check to Show Dot Cursor','classic-gaming'),
	   'type'      => 'checkbox'
 	));	
	$wp_customize->add_setting('classic_gaming_box_layout',array(
		'default' => false,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_gaming_box_layout', array(
	   'section'   => 'classic_gaming_site_layoutsec',
	   'label'	=> __('Check to Show Box Layout','classic-gaming'),
	   'type'      => 'checkbox'
 	));

	// Add Settings and Controls for Page Layout
    $wp_customize->add_setting('classic_gaming_sidebar_page_layout',array(
		'default' => 'full',
	 	'sanitize_callback' => 'classic_gaming_sanitize_choices'
	));
	$wp_customize->add_control('classic_gaming_sidebar_page_layout',array(
		'type' => 'radio',
		'label'     => __('Theme Page Sidebar Position', 'classic-gaming'),
		'section' => 'classic_gaming_site_layoutsec',
		'choices' => array(
			'left' => __('Left','classic-gaming'),
			'right' => __('Right','classic-gaming'),
			'full' => __('No Sidebar','classic-gaming')
	),
	));	
	
	$wp_customize->add_setting( 'classic_gaming_site_layoutsec_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_site_layoutsec_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_site_layoutsec'
	));

	//Global Color
	$wp_customize->add_section('classic_gaming_global_color', array(
		'title'    => __('Manage Global Color Section', 'classic-gaming'),
		'panel'    => 'classic_gaming_panel_area',
	));

	$wp_customize->add_setting('classic_gaming_first_color', array(
		'default'           => '#FF4074',
		'sanitize_callback' => 'sanitize_hex_color',
	));
	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'classic_gaming_first_color', array(
		'label'    => __('Theme Color', 'classic-gaming'),
		'section'  => 'classic_gaming_global_color',
		'settings' => 'classic_gaming_first_color',
	)));

	$wp_customize->add_setting( 'classic_gaming_global_color_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_global_color_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_global_color'
	));

	// Header Section
	$wp_customize->add_section('classic_gaming_topbar_section',array(
	    'title' => __('Manage Header Section','classic-gaming'),
	    'priority'  => null,
	    'panel' => 'classic_gaming_panel_area',
	));	

	// Sticky Header
	$wp_customize->add_setting( 'classic_gaming_sticky_header',array(
        'default' => false,
        'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
		'capability' => 'edit_theme_options',
    ));
    $wp_customize->add_control( 'classic_gaming_sticky_header',array(
		'settings' => 'classic_gaming_sticky_header',
	    'section'   => 'classic_gaming_topbar_section',
        'label' => esc_html__( 'Sticky Header','classic-gaming' ),
        'type'      => 'checkbox'
    ));

	$wp_customize->add_setting('classic_gaming_header_btn_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_header_btn_text', array(
	   'settings' => 'classic_gaming_header_btn_text',
	   'section'   => 'classic_gaming_topbar_section',
	   'label' => __('Add Button Text', 'classic-gaming'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('classic_gaming_header_btn_url',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_header_btn_url', array(
	   'settings' => 'classic_gaming_header_btn_url',
	   'section'   => 'classic_gaming_topbar_section',
	   'label' => __('Add Button URL', 'classic-gaming'),
	   'type'      => 'url'
	));

    // Menu Text Transform
    $wp_customize->add_setting( 'classic_gaming_menu_text_transform', array(
        'default'           => 'Uppercase',
		'transport' => 'refresh',
		'sanitize_callback' => 'classic_gaming_sanitize_choices'
    ));

    $wp_customize->add_control( 'classic_gaming_menu_text_transform', array(
        'label'    => __( 'Menu Text Transform', 'classic-gaming' ),
        'section'  => 'classic_gaming_topbar_section',
        'type'     => 'select',
        'choices'  => array(
			'None'       => __( 'None', 'classic-gaming' ),
            'Capitalize' => __( 'Capitalize', 'classic-gaming' ),
            'Uppercase'  => __( 'Uppercase', 'classic-gaming' ),
            'Lowercase'  => __( 'Lowercase', 'classic-gaming' ),
        ),
    ));

	$wp_customize->add_setting( 'classic_gaming_header_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_header_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_topbar_section'
	));

    // Banner Section
	$wp_customize->add_section('classic_gaming_banner_section',array(
	    'title' => __('Manage Banner Section','classic-gaming'),
	    'priority'  => null,
	    'description'	=> __('<p class="sec-title">Manage Banner Section</p> Select Page from the Dropdowns for banner, Also use the given image dimension (420 x 470).','classic-gaming'),
	    'panel' => 'classic_gaming_panel_area',
	));	

	$wp_customize->add_setting('classic_gaming_banner',array(
		'default' => true,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_banner', array(
	   'settings' => 'classic_gaming_banner',
	   'section'   => 'classic_gaming_banner_section',
	   'label'     => __('Check To Enable This Section','classic-gaming'),
	   'type'      => 'checkbox'
	));

	// Page Dropdown
	$wp_customize->add_setting('classic_gaming_banner_pageboxes', array(
	    'default'           => '0',
	    'capability'        => 'edit_theme_options',
	    'sanitize_callback' => 'classic_gaming_sanitize_dropdown_pages',
	));
	$wp_customize->add_control('classic_gaming_banner_pageboxes', array(
	    'type'     => 'dropdown-pages',
	    'label'    => __('Select Page to display Banner', 'classic-gaming'),
	    'section'  => 'classic_gaming_banner_section',
	));

	// Small Title
	$wp_customize->add_setting('classic_gaming_banner_small_title', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_gaming_banner_small_title', array(
	    'settings' => 'classic_gaming_banner_small_title',
	    'section'  => 'classic_gaming_banner_section',
	    'label'    => __('Add Banner Small Title', 'classic-gaming'),
	    'type'     => 'text',
	));

	// Button Text
	$wp_customize->add_setting('classic_gaming_button_text', array(
	    'default'           => 'READ MORE',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_gaming_button_text', array(
	    'settings' => 'classic_gaming_button_text',
	    'section'  => 'classic_gaming_banner_section',
	    'label'    => __('Add Banner Button Text', 'classic-gaming'),
	    'type'     => 'text',
	));

	// Button Link
	$wp_customize->add_setting('classic_gaming_button_link_banner', array(
	    'default'           => '',
	    'sanitize_callback' => 'esc_url_raw',
	));
	$wp_customize->add_control('classic_gaming_button_link_banner', array(
	    'label'    => __('Add Banner Button Link', 'classic-gaming'),
	    'section'  => 'classic_gaming_banner_section',
	    'type'     => 'url',
	));

	$wp_customize->add_setting('classic_gaming_banner_email_address',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_email',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_banner_email_address', array(
	   'settings' => 'classic_gaming_banner_email_address',
	   'section'   => 'classic_gaming_banner_section',
	   'label' => __('Add Email Address', 'classic-gaming'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('classic_gaming_fb_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_fb_link', array(
	   'settings' => 'classic_gaming_fb_link',
	   'section'   => 'classic_gaming_banner_section',
	   'label' => __('Facebook Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_youtube_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_youtube_link', array(
	   'settings' => 'classic_gaming_youtube_link',
	   'section'   => 'classic_gaming_banner_section',
	   'label' => __('Youtube Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_twitter_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_twitter_link', array(
	   'settings' => 'classic_gaming_twitter_link',
	   'section'   => 'classic_gaming_banner_section',
	   'label' => __('Twitter Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_steam_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_steam_link', array(
	   'settings' => 'classic_gaming_steam_link',
	   'section'   => 'classic_gaming_banner_section',
	   'label' => __('Steam Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_behance_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_behance_link', array(
	   'settings' => 'classic_gaming_behance_link',
	   'section'   => 'classic_gaming_banner_section',
	   'label' => __('Behance Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_posts_number',array(
		'default'	=> '',
		'sanitize_callback'	=> 'classic_gaming_sanitize_choices',
	));
	$wp_customize->add_control('classic_gaming_posts_number',array(
		'label'	=> __('Number of post to show','classic-gaming'),
		'description' => __('Add number and refresh tab','classic-gaming'),
		'section'	=> 'classic_gaming_banner_section',
		'type'		=> 'select',
		'choices' => array(
			'1' => '1',
			'2' => '2'
		),
	));
	$classic_gaming_featured_post = get_theme_mod('classic_gaming_posts_number');

	$classic_gaming_args = array('numberposts' => -1);
	$classic_gaming_post_list = get_posts($classic_gaming_args);
	$classic_gaming_i = 0;
	$classic_gaming_pst[]='Select';
	foreach($classic_gaming_post_list as $classic_gaming_post){
		$classic_gaming_pst[$classic_gaming_post->ID] = $classic_gaming_post->post_title;
	}

	for ( $classic_gaming_i = 1; $classic_gaming_i <= $classic_gaming_featured_post; $classic_gaming_i++ ) {
		$wp_customize->add_setting('classic_gaming_select_post'.$classic_gaming_i,array(
			'sanitize_callback' => 'classic_gaming_sanitize_choices',
		));
		$wp_customize->add_control('classic_gaming_select_post'.$classic_gaming_i,array(
			'type'    => 'select',
			'choices' => $classic_gaming_pst,
			'label' => __('Select Post','classic-gaming'),
			'section' => 'classic_gaming_banner_section',
		));

		$wp_customize->add_setting('classic_gaming_add_steam_count'.$classic_gaming_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		    'capability'        => 'edit_theme_options',
		));
		$wp_customize->add_control('classic_gaming_add_steam_count'.$classic_gaming_i, array(
		    'settings' => 'classic_gaming_add_steam_count'.$classic_gaming_i,
		    'section'  => 'classic_gaming_banner_section',
		    'label'    => __('Add Steam Count', 'classic-gaming'),
		    'type'     => 'text',
		));

		$wp_customize->add_setting('classic_gaming_steam_icon'.$classic_gaming_i,array(
	        'default'=> 'fa-brands fa-steam',
	        'sanitize_callback' => 'sanitize_text_field'
	    ));
	    $wp_customize->add_control('classic_gaming_steam_icon'.$classic_gaming_i,array(
	        'label' => __('Add Icon','classic-gaming'),
	        'description' => __('Fontawesome Icon (e.g., fa-brands fa-steam)','classic-gaming'),
	        'section'=> 'classic_gaming_banner_section',
	        'type'=> 'text'
	    ));

		$wp_customize->add_setting('classic_gaming_add_score'.$classic_gaming_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		    'capability'        => 'edit_theme_options',
		));
		$wp_customize->add_control('classic_gaming_add_score'.$classic_gaming_i, array(
		    'settings' => 'classic_gaming_add_score'.$classic_gaming_i,
		    'section'  => 'classic_gaming_banner_section',
		    'label'    => __('Add Score', 'classic-gaming'),
		    'type'     => 'text',
		));

		$wp_customize->add_setting('classic_gaming_score_icon'.$classic_gaming_i,array(
	        'default'=> 'fa-brands fa-playstation',
	        'sanitize_callback' => 'sanitize_text_field'
	    ));
	    $wp_customize->add_control('classic_gaming_score_icon'.$classic_gaming_i,array(
	        'label' => __('Add Icon','classic-gaming'),
	        'description' => __('Fontawesome Icon (e.g., fa-brands fa-playstation)','classic-gaming'),
	        'section'=> 'classic_gaming_banner_section',
	        'type'=> 'text'
	    ));
	}

	$wp_customize->add_setting('classic_gaming_banner_bg_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_gaming_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_banner_bg_color', array(
		'settings' => 'classic_gaming_banner_bg_color',
		'section'   => 'classic_gaming_banner_section',
		'label' => __('Banner Background Color', 'classic-gaming'),
		'type'      => 'color'
	));

	$wp_customize->add_setting('classic_gaming_banner_bg_img_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_gaming_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_banner_bg_img_color', array(
		'settings' => 'classic_gaming_banner_bg_img_color',
		'section'   => 'classic_gaming_banner_section',
		'label' => __('Background SVG Color', 'classic-gaming'),
		'type'      => 'color'
	));

	$wp_customize->add_setting('classic_gaming_banner_bg_img',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw',
	));
	$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'classic_gaming_banner_bg_img',array(
	    'label' => __('Background Image','classic-gaming'),
	    'description'	=> __('Use the given image dimension (370px x 370px).','classic-gaming'),
	    'section' => 'classic_gaming_banner_section'
	)));

	$wp_customize->add_setting( 'classic_gaming_banner_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_banner_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_banner_section'
	));

	// Products Section
	$wp_customize->add_section('classic_gaming_product_section', array(
	    'title'       => __('Manage Products Section', 'classic-gaming'),
	    'description' => __('<p class="sec-title">Manage Products Section</p>', 'classic-gaming'),
	    'priority'    => null,
	    'panel'       => 'classic_gaming_panel_area',
	));

	$wp_customize->add_setting('classic_gaming_disabled_product_section', array(
	    'default'           => true,
	    'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_gaming_disabled_product_section', array(
	    'settings' => 'classic_gaming_disabled_product_section',
	    'section'  => 'classic_gaming_product_section',
	    'label'    => __('Check To Enable Section', 'classic-gaming'),
	    'type'     => 'checkbox',
	));

	$wp_customize->add_setting('classic_gaming_product_title', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_gaming_product_title', array(
	    'settings' => 'classic_gaming_product_title',
	    'section'  => 'classic_gaming_product_section',
	    'label'    => __('Add Section Title', 'classic-gaming'),
	    'type'     => 'text',
	));

	$wp_customize->add_setting('classic_gaming_product_text', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_gaming_product_text', array(
	    'settings' => 'classic_gaming_product_text',
	    'section'  => 'classic_gaming_product_section',
	    'label'    => __('Add Section Text', 'classic-gaming'),
	    'type'     => 'text',
	));

	$classic_gaming_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
    );
	$classic_gaming_categories = get_categories($classic_gaming_args);
	$classic_gaming_cat_posts = array();
	$classic_gaming_m = 0;
	$classic_gaming_cat_posts[]='Select';
	foreach($classic_gaming_categories as $classic_gaming_category){
		if($classic_gaming_m==0){
			$classic_gaming_default = $classic_gaming_category->slug;
			$classic_gaming_m++;
		}
		$classic_gaming_cat_posts[$classic_gaming_category->slug] = $classic_gaming_category->name;
	}

	$wp_customize->add_setting('classic_gaming_hot_products_cat',array(
		'default'	=> 'select',
		'sanitize_callback' => 'classic_gaming_sanitize_choices',
	));
	$wp_customize->add_control('classic_gaming_hot_products_cat',array(
		'type'    => 'select',
		'choices' => $classic_gaming_cat_posts,
		'label' => __('Select category to display products ','classic-gaming'),
		'section' => 'classic_gaming_product_section',
	));

	$wp_customize->add_setting( 'classic_gaming_product_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_product_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_product_section'
	));

	//Blog post
	$wp_customize->add_section('classic_gaming_blog_post_settings',array(
        'title' => __('Manage Post Section', 'classic-gaming'),
        'priority' => null,
        'panel' => 'classic_gaming_panel_area'
    ) );

	// Layouts Post
	$wp_customize->add_setting(
		'classic_gaming_blog_layout_option_setting',
		array(
			'default'           => 'Left',
			'sanitize_callback' => 'classic_gaming_sanitize_choices',
		)
	);

	$wp_customize->add_control(
		new Classic_Gaming_Image_Radio_Control(
			$wp_customize,
			'classic_gaming_blog_layout_option_setting',
			array(
				'label'   => __( 'Post Layouts', 'classic-gaming' ),
				'section' => 'classic_gaming_blog_post_settings',
				'choices' => array(
					'Left' => get_template_directory_uri() . '/images/layout-1.png',
					'Center'    => get_template_directory_uri() . '/images/layout-2.png',
					'Right'   => get_template_directory_uri() . '/images/layout-3.png',
				),
			)
		)
	);

	$wp_customize->add_setting('classic_gaming_metafields_date', array(
	    'default' => true,
	    'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_gaming_metafields_date', array(
	    'settings' => 'classic_gaming_metafields_date', 
	    'section'   => 'classic_gaming_blog_post_settings',
	    'label'     => __('Check to Enable Date', 'classic-gaming'),
	    'type'      => 'checkbox',
	));

	$wp_customize->add_setting('classic_gaming_metafields_comments', array(
		'default' => true,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));	
	$wp_customize->add_control('classic_gaming_metafields_comments', array(
		'settings' => 'classic_gaming_metafields_comments',
		'section'  => 'classic_gaming_blog_post_settings',
		'label'    => __('Check to Enable Comments', 'classic-gaming'),
		'type'     => 'checkbox',
	));

	$wp_customize->add_setting('classic_gaming_metafields_author', array(
		'default' => true,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_gaming_metafields_author', array(
		'settings' => 'classic_gaming_metafields_author',
		'section'  => 'classic_gaming_blog_post_settings',
		'label'    => __('Check to Enable Author', 'classic-gaming'),
		'type'     => 'checkbox',
	));		

	$wp_customize->add_setting('classic_gaming_metafields_time', array(
		'default' => true,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_gaming_metafields_time', array(
		'settings' => 'classic_gaming_metafields_time',
		'section'  => 'classic_gaming_blog_post_settings',
		'label'    => __('Check to Enable Time', 'classic-gaming'),
		'type'     => 'checkbox',
	));	

	$wp_customize->add_setting('classic_gaming_metabox_seperator',array(
		'default' => '|',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_metabox_seperator',array(
		'type' => 'text',
		'label' => __('Metabox Seperator','classic-gaming'),
		'description' => __('Ex: "/", "|", "-", ...','classic-gaming'),
		'section' => 'classic_gaming_blog_post_settings'
	)); 

    // Add Settings and Controls for Post Layout
	$wp_customize->add_setting('classic_gaming_sidebar_post_layout',array(
		'default' => 'right',
		'sanitize_callback' => 'classic_gaming_sanitize_choices'
	));
	$wp_customize->add_control('classic_gaming_sidebar_post_layout',array(
		'type' => 'radio',
		'label'     => __('Theme Post Sidebar Position', 'classic-gaming'),
		'description'   => __('This option work for blog page, archive page and search page.', 'classic-gaming'),
		'section' => 'classic_gaming_blog_post_settings',
		'choices' => array(
			'left' => __('Left','classic-gaming'),
			'right' => __('Right','classic-gaming'),
			'three-column' => __('Three Columns','classic-gaming'),
			'four-column' => __('Four Columns','classic-gaming'),
			'grid' => __('Grid Layout','classic-gaming'),
			'full' => __('No Sidebar','classic-gaming')
     ),
	) );

	$wp_customize->add_setting('classic_gaming_blog_post_description_option',array(
    	'default'   => 'Excerpt Content', 
        'sanitize_callback' => 'classic_gaming_sanitize_choices'
	));
	$wp_customize->add_control('classic_gaming_blog_post_description_option',array(
        'type' => 'radio',
        'label' => __('Post Description Length','classic-gaming'),
        'section' => 'classic_gaming_blog_post_settings',
        'choices' => array(
            'No Content' => __('No Content','classic-gaming'),
            'Excerpt Content' => __('Excerpt Content','classic-gaming'),
            'Full Content' => __('Full Content','classic-gaming'),
        ),
	) );

	$wp_customize->add_setting('classic_gaming_blog_post_thumb',array(
        'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
        'default'           => 1,
    ));
    $wp_customize->add_control('classic_gaming_blog_post_thumb',array(
        'type'        => 'checkbox',
        'label'       => esc_html__('Show / Hide Blog Post Thumbnail', 'classic-gaming'),
        'section'     => 'classic_gaming_blog_post_settings',
    ));

	$wp_customize->add_setting( 'classic_gaming_blog_post_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_blog_post_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_blog_post_settings'
	));

	//Single Post Settings
	$wp_customize->add_section('classic_gaming_single_post_settings',array(
		'title' => __('Manage Single Post Section', 'classic-gaming'),
		'priority' => null,
		'panel' => 'classic_gaming_panel_area'
	));

	$wp_customize->add_setting('classic_gaming_single_post_date',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_gaming_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_gaming_single_post_date',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Date ','classic-gaming'),
		'section' => 'classic_gaming_single_post_settings'
	));	

	$wp_customize->add_setting('classic_gaming_single_post_author',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_gaming_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_gaming_single_post_author',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Author','classic-gaming'),
		'section' => 'classic_gaming_single_post_settings'
	));

	$wp_customize->add_setting('classic_gaming_single_post_comment',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_gaming_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_gaming_single_post_comment',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Comments','classic-gaming'),
		'section' => 'classic_gaming_single_post_settings'
	));	

	$wp_customize->add_setting('classic_gaming_single_post_time',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_gaming_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_gaming_single_post_time',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Time','classic-gaming'),
		'section' => 'classic_gaming_single_post_settings'
	));	

	$wp_customize->add_setting('classic_gaming_single_post_metabox_seperator',array(
		'default' => '|',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_single_post_metabox_seperator',array(
		'type' => 'text',
		'label' => __('Metabox Seperator','classic-gaming'),
		'description' => __('Ex: "/", "|", "-", ...','classic-gaming'),
		'section' => 'classic_gaming_single_post_settings'
	)); 

	$wp_customize->add_setting('classic_gaming_sidebar_single_post_layout',array(
    	'default' => 'right',
    	 'sanitize_callback' => 'classic_gaming_sanitize_choices'
	));
	$wp_customize->add_control('classic_gaming_sidebar_single_post_layout',array(
   		'type' => 'radio',
    	'label'     => __('Single post sidebar layout', 'classic-gaming'),
     	'section' => 'classic_gaming_single_post_settings',
     	'choices' => array(
			'left' => __('Left','classic-gaming'),
			'right' => __('Right','classic-gaming'),
			'full' => __('No Sidebar','classic-gaming')
     ),
	));

	$wp_customize->add_setting( 'classic_gaming_single_post_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_single_post_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_single_post_settings'
	));

	//Page Settings
	$wp_customize->add_section('classic_gaming_page_settings',array(
		'title' => __('Manage Page Section', 'classic-gaming'),
		'priority' => null,
		'panel' => 'classic_gaming_panel_area'
	));

	// Add Settings and Controls for Page Layout
	$wp_customize->add_setting('classic_gaming_sidebar_page_layout',array(
		'default' => 'full',
			'sanitize_callback' => 'classic_gaming_sanitize_choices'
	));
	$wp_customize->add_control('classic_gaming_sidebar_page_layout',array(
		'type' => 'radio',
		'label'     => __('Theme Page Sidebar Position', 'classic-gaming'),
		'section' => 'classic_gaming_page_settings',
		'choices' => array(
			'left' => __('Left','classic-gaming'),
			'right' => __('Right','classic-gaming'),
			'full' => __('No Sidebar','classic-gaming')
		),
	));	

	$wp_customize->add_setting( 'classic_gaming_page_layout_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_page_layout_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		<a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_page_settings'
	));

	// 404 Page Settings
	$wp_customize->add_section('classic_gaming_page_not_found', array(
		'title'	=> __('Manage 404 Page Section','classic-gaming'),
		'priority'	=> null,
		'panel' => 'classic_gaming_panel_area',
	));

	$wp_customize->add_setting('classic_gaming_page_not_found_heading',array(
		'default'=> __('404 Not Found','classic-gaming'),
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_page_not_found_heading',array(
		'label'	=> __('404 Heading','classic-gaming'),
		'section'=> 'classic_gaming_page_not_found',
		'type'=> 'text'
	));

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

	$wp_customize->add_control('classic_gaming_page_not_found_content',array(
		'label'	=> __('404 Text','classic-gaming'),
		'input_attrs' => array(
			'placeholder' => __( 'Looks like you have taken a wrong turn.....Don\'t worry... it happens to the best of us.', 'classic-gaming' ),
		),
		'section'=> 'classic_gaming_page_not_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('classic_gaming_page_not_found_btn',array(
		'default' => 'Homepage',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_page_not_found_btn', array(
	   'settings' => 'classic_gaming_page_not_found_btn',
	   'section'   => 'classic_gaming_page_not_found',
	   'label' => __('404 Button', 'classic-gaming'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting( 'classic_gaming_page_not_found_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_page_not_found_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
			<a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_page_not_found'
	));

	// No Results Page Settings
	$wp_customize->add_section('classic_gaming_no_results_found', array(
		'title'	=> __('Manage No Results Page Section','classic-gaming'),
		'priority'	=> null,
		'panel' => 'classic_gaming_panel_area',
	));
	
	$wp_customize->add_setting('classic_gaming_page_nothing_found_heading',array(
		'default'=> __('Nothing Found','classic-gaming'),
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_page_nothing_found_heading',array(
		'label'	=> __('Add Title','classic-gaming'),
		'section'=> 'classic_gaming_no_results_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('classic_gaming_nothing_found_content',array(
		'default'=> 'Sorry, but nothing matched your search terms. Please try again with some different keywords.',
		'sanitize_callback'	=> 'sanitize_text_field'
	));

	$wp_customize->add_control('classic_gaming_nothing_found_content',array(
		'label'	=> __('Add Text','classic-gaming'),
		'section'=> 'classic_gaming_no_results_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('classic_gaming_nothing_found_search',array(
		'default' => true,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_nothing_found_search', array(
	   'settings' => 'classic_gaming_nothing_found_search',
	   'section'   => 'classic_gaming_no_results_found',
	   'label'     => __('Check To Enable Search','classic-gaming'),
	   'type'      => 'checkbox'
	));

	$wp_customize->add_setting( 'classic_gaming_no_results_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_no_results_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		<a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_no_results_found'
	));

	// Animation Section
	$wp_customize->add_section('classic_gaming_animation', array(
		'title'	=> __('Manage Animation Section','classic-gaming'),
		'description'	=> __('<p class="sec-title">Manage Animation Section</p>','classic-gaming'),
		'priority'	=> null,
		'panel' => 'classic_gaming_panel_area',
	));

	$wp_customize->add_setting('classic_gaming_animation_enabled',array(
		'default' => true,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_animation_enabled', array(
	   'settings' => 'classic_gaming_animation_enabled',
	   'section'   => 'classic_gaming_animation',
	   'label'     => __('Check To Enable Animation','classic-gaming'),
	   'type'      => 'checkbox'
	));

	$wp_customize->add_setting( 'classic_gaming_animation_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_animation_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		<a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_animation'
	));

	// Footer Section
	$wp_customize->add_section('classic_gaming_footer', array(
		'title'	=> __('Manage Footer Section','classic-gaming'),
		'description'	=> __('<p class="sec-title">Manage Footer Section</p>','classic-gaming'),
		'priority'	=> null,
		'panel' => 'classic_gaming_panel_area',
	));

	$wp_customize->add_setting('classic_gaming_footer_widget', array(
	    'default' => true,
	    'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_gaming_footer_widget', array(
	    'settings' => 'classic_gaming_footer_widget',
	    'section'   => 'classic_gaming_footer',
	    'label'     => __('Check to Enable Footer Widget', 'classic-gaming'),
	    'type'      => 'checkbox',
	));

	//  footer bg color
	$wp_customize->add_setting('classic_gaming_footerbg_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_gaming_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footerbg_color', array(
		'settings' => 'classic_gaming_footerbg_color',
		'section'   => 'classic_gaming_footer',
		'label' => __('Footer Background Color', 'classic-gaming'),
		'type'      => 'color'
	));

	$wp_customize->add_setting('classic_gaming_footer_bg_image',array(
        'default'   => '',
        'sanitize_callback' => 'esc_url_raw',
    ));
    $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'classic_gaming_footer_bg_image',array(
        'label' => __('Footer Background Image','classic-gaming'),
        'section' => 'classic_gaming_footer',
    )));

	$wp_customize->add_setting('classic_gaming_footer_img_position',array(
		'default' => 'center center',
		'transport' => 'refresh',
		'sanitize_callback' => 'classic_gaming_sanitize_choices'
	));
	$wp_customize->add_control('classic_gaming_footer_img_position',array(
		'type' => 'select',
		'label' => __('Footer Image Position','classic-gaming'),
		'section' => 'classic_gaming_footer',
		'choices' 	=> array(
			'center center'   => esc_html__( 'Center', 'classic-gaming' ),
			'center top'   => esc_html__( 'Top', 'classic-gaming' ),
			'left center'   => esc_html__( 'Left', 'classic-gaming' ),
			'right center'   => esc_html__( 'Right', 'classic-gaming' ),
			'center bottom'   => esc_html__( 'Bottom', 'classic-gaming' ),
		),
	));	

	$wp_customize->add_setting('classic_gaming_footer_widget_areas',array(
		'default'           => 4,
		'sanitize_callback' => 'classic_gaming_sanitize_choices',
	));
	$wp_customize->add_control('classic_gaming_footer_widget_areas',array(
		'type'        => 'radio',
		'section' => 'classic_gaming_footer',
		'label'       => __('Footer widget area', 'classic-gaming'),
		'choices' => array(
		   '1'     => __('One', 'classic-gaming'),
		   '2'     => __('Two', 'classic-gaming'),
		   '3'     => __('Three', 'classic-gaming'),
		   '4'     => __('Four', 'classic-gaming')
		),
	));

	$wp_customize->add_setting('classic_gaming_copyright_line',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'classic_gaming_copyright_line', array(
	   'section' 	=> 'classic_gaming_footer',
	   'label'	 	=> __('Copyright Line','classic-gaming'),
	   'type'    	=> 'text',
	   'priority' 	=> null,
    ));

	$wp_customize->add_setting('classic_gaming_copyright_link',array(
    	'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'classic_gaming_copyright_link', array(
	   'section' 	=> 'classic_gaming_footer',
	   'label'	 	=> __('Copyright Link','classic-gaming'),
	   'type'    	=> 'text',
	   'priority' 	=> null,
    ));

	//  footer title color
	$wp_customize->add_setting('classic_gaming_footertitle_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_gaming_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footertitle_color', array(
	   'settings' => 'classic_gaming_footertitle_color',
	   'section'   => 'classic_gaming_footer',
	   'label' => __('Title Color', 'classic-gaming'),
	   'type'      => 'color'
	));

	//  footer list color
	$wp_customize->add_setting('classic_gaming_footerlist_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_gaming_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footerlist_color', array(
	   'settings' => 'classic_gaming_footerlist_color',
	   'section'   => 'classic_gaming_footer',
	   'label' => __('List Color', 'classic-gaming'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('classic_gaming_scroll_hide', array(
        'default' => true,
        'sanitize_callback' => 'classic_gaming_sanitize_checkbox'
    ));
    $wp_customize->add_control( new WP_Customize_Control($wp_customize,'classic_gaming_scroll_hide',array(
        'label'          => __( 'Check To Show Scroll To Top', 'classic-gaming' ),
        'section'        => 'classic_gaming_footer',
        'settings'       => 'classic_gaming_scroll_hide',
        'type'           => 'checkbox',
    )));

	$wp_customize->add_setting('classic_gaming_scroll_position',array(
        'default' => 'Right',
        'sanitize_callback' => 'classic_gaming_sanitize_choices'
    ));
    $wp_customize->add_control('classic_gaming_scroll_position',array(
        'type' => 'radio',
        'section' => 'classic_gaming_footer',
        'label'	 	=> __('Scroll To Top Positions','classic-gaming'),
        'choices' => array(
            'Right' => __('Right','classic-gaming'),
            'Left' => __('Left','classic-gaming'),
            'Center' => __('Center','classic-gaming')
        ),
    ) );

	$wp_customize->add_setting('classic_gaming_scroll_text',array(
		'default'	=> __('TOP','classic-gaming'),
		'sanitize_callback'	=> 'sanitize_text_field',
	));	
	$wp_customize->add_control('classic_gaming_scroll_text',array(
		'label'	=> __('Scroll To Top Button Text','classic-gaming'),
		'section'	=> 'classic_gaming_footer',
		'type'		=> 'text'
	));

	$wp_customize->add_setting( 'classic_gaming_scroll_top_shape', array(
		'default'           => 'circle',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	
	$wp_customize->add_control( 'classic_gaming_scroll_top_shape', array(
		'label'    => __( 'Scroll to Top Button Shape', 'classic-gaming' ),
		'section'  => 'classic_gaming_footer',
		'settings' => 'classic_gaming_scroll_top_shape',
		'type'     => 'radio',
		'choices'  => array(
			'box'        => __( 'Box', 'classic-gaming' ),
			'curved' => __( 'Curved', 'classic-gaming'),
			'circle'     => __( 'Circle', 'classic-gaming' ),
		),
	) );
    // Progress Bar
	$wp_customize->add_setting('classic_gaming_progress_bar', array(
		'default' => false,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));

	$wp_customize->add_control(
		new WP_Customize_Control(
			$wp_customize,
			'classic_gaming_progress_bar',
			array(
				'label' => __('Check To Show Progress Bar', 'classic-gaming'),
				'section' => 'classic_gaming_footer',
				'settings' => 'classic_gaming_progress_bar',
				'type' => 'checkbox',
			)
		)
	);
    // Sticky Copyright Enable / Disable
	$wp_customize->add_setting('classic_gaming_sticky_copyright_enable',array(
		'default' => false,
		'sanitize_callback' => 'classic_gaming_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_gaming_sticky_copyright_enable', array(
	   'section'   => 'classic_gaming_footer',
	   'label'	=> __('Check To Show Sticky Copyright','classic-gaming'),
	   'type'      => 'checkbox'
 	));
	$wp_customize->add_setting( 'classic_gaming_footer_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_footer_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_footer'
	));

	// Footer Social Section
	$wp_customize->add_section('classic_gaming_footer_social_icons', array(
		'title'	=> __('Manage Footer Social Section','classic-gaming'),
		'description'	=> __('<p class="sec-title">Manage Footer Social Section</p>','classic-gaming'),
		'priority'	=> null,
		'panel' => 'classic_gaming_panel_area',
	));

	$wp_customize->add_setting('classic_gaming_footer_facebook_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footer_facebook_link', array(
	   'settings' => 'classic_gaming_footer_facebook_link',
	   'section'   => 'classic_gaming_footer_social_icons',
	   'label' => __('Facebook Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_footer_youtube_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footer_youtube_link', array(
	   'settings' => 'classic_gaming_footer_youtube_link',
	   'section'   => 'classic_gaming_footer_social_icons',
	   'label' => __('Youtube Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_footer_twitter_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footer_twitter_link', array(
	   'settings' => 'classic_gaming_footer_twitter_link',
	   'section'   => 'classic_gaming_footer_social_icons',
	   'label' => __('Twitter Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_footer_steam_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footer_steam_link', array(
	   'settings' => 'classic_gaming_footer_steam_link',
	   'section'   => 'classic_gaming_footer_social_icons',
	   'label' => __('Steam Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_gaming_footer_behance_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_gaming_footer_behance_link', array(
	   'settings' => 'classic_gaming_footer_behance_link',
	   'section'   => 'classic_gaming_footer_social_icons',
	   'label' => __('Behance Link', 'classic-gaming'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting( 'classic_gaming_footer_social_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_gaming_footer_social_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_GAMING_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_gaming_footer_social_icons'
	));
    
	// Google Fonts
	$wp_customize->add_section( 'classic_gaming_google_fonts_section', array(
		'title'       => __( 'Google Fonts', 'classic-gaming' ),
		'priority'    => 24,
	) );

	$font_choices = array(
		'' => 'No Fonts',
		'Kaushan Script:' => 'Kaushan Script',
		'Emilys Candy:' => 'Emilys Candy',
		'Poppins:0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900' => 'Poppins',
		'Source Sans Pro:400,700,400italic,700italic' => 'Source Sans Pro',
		'Open Sans:400italic,700italic,400,700' => 'Open Sans',
		'Oswald:400,700' => 'Oswald',
		'Playfair Display:400,700,400italic' => 'Playfair Display',
		'Montserrat:400,700' => 'Montserrat',
		'Raleway:400,700' => 'Raleway',
		'Droid Sans:400,700' => 'Droid Sans',
		'Lato:400,700,400italic,700italic' => 'Lato',
		'Arvo:400,700,400italic,700italic' => 'Arvo',
		'Lora:400,700,400italic,700italic' => 'Lora',
		'Merriweather:400,300italic,300,400italic,700,700italic' => 'Merriweather',
		'Oxygen:400,300,700' => 'Oxygen',
		'PT Serif:400,700' => 'PT Serif',
		'PT Sans:400,700,400italic,700italic' => 'PT Sans',
		'PT Sans Narrow:400,700' => 'PT Sans Narrow',
		'Cabin:400,700,400italic' => 'Cabin',
		'Fjalla One:400' => 'Fjalla One',
		'Francois One:400' => 'Francois One',
		'Josefin Sans:400,300,600,700' => 'Josefin Sans',
		'Libre Baskerville:400,400italic,700' => 'Libre Baskerville',
		'Arimo:400,700,400italic,700italic' => 'Arimo',
		'Ubuntu:400,700,400italic,700italic' => 'Ubuntu',
		'Bitter:400,700,400italic' => 'Bitter',
		'Droid Serif:400,700,400italic,700italic' => 'Droid Serif',
		'Roboto:400,400italic,700,700italic' => 'Roboto',
		'Open Sans Condensed:700,300italic,300' => 'Open Sans Condensed',
		'Roboto Condensed:400italic,700italic,400,700' => 'Roboto Condensed',
		'Roboto Slab:400,700' => 'Roboto Slab',
		'Yanone Kaffeesatz:400,700' => 'Yanone Kaffeesatz',
		'Rokkitt:400' => 'Rokkitt',
	);

	$wp_customize->add_setting( 'classic_gaming_headings_fonts', array(
		'sanitize_callback' => 'classic_gaming_sanitize_fonts',
	));
	$wp_customize->add_control( 'classic_gaming_headings_fonts', array(
		'type' => 'select',
		'description' => __('Select your desired font for the headings.', 'classic-gaming'),
		'section' => 'classic_gaming_google_fonts_section',
		'choices' => $font_choices
	));

	$wp_customize->add_setting( 'classic_gaming_body_fonts', array(
		'sanitize_callback' => 'classic_gaming_sanitize_fonts'
	));
	$wp_customize->add_control( 'classic_gaming_body_fonts', array(
		'type' => 'select',
		'description' => __( 'Select your desired font for the body.', 'classic-gaming' ),
		'section' => 'classic_gaming_google_fonts_section',
		'choices' => $font_choices
	));
  
}
add_action( 'customize_register', 'classic_gaming_customize_register' );

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function classic_gaming_customize_preview_js() {
	wp_enqueue_script( 'classic_gaming_customizer', esc_url(get_template_directory_uri()) . '/js/customize-preview.js', array( 'customize-preview' ), '20161510', true );
}
add_action( 'customize_preview_init', 'classic_gaming_customize_preview_js' );
