<?php
/**
 * Garden Farm Theme Customizer
 *
 * @package Garden Farm
 */

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

	function garden_farm_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('garden-farm-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('garden_farm_logo_enable',array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'garden_farm_logo_enable', array(
		'settings' => 'garden_farm_logo_enable',
		'section'   => 'title_tagline',
		'label'     => __('Enable Logo','garden-farm'),
		'type'      => 'checkbox'
	));

	//Logo
    $wp_customize->add_setting('garden_farm_logo_width', array(
        'default' => '',
        'transport' => 'refresh',
        'sanitize_callback' => 'garden_farm_sanitize_integer'
    ));
    $wp_customize->add_control(new Garden_Farm_Slider_Custom_Control($wp_customize, 'garden_farm_logo_width', array(
    	'label'          => __( 'Logo Width', 'garden-farm'),
        'section' => 'title_tagline',
        'settings' => 'garden_farm_logo_width',
        'input_attrs' => array(
            'step' => 1,
            'min' => 0,
            'max' => 300,
        ),
    )));

	// color site title
	$wp_customize->add_setting('garden_farm_sitetitle_color',array(
		'default' => '',
		'sanitize_callback' => 'garden_farm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_sitetitle_color', array(
	   'settings' => 'garden_farm_sitetitle_color',
	   'section'   => 'title_tagline',
	   'label' => __('Site Title Color', 'garden-farm'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('garden_farm_title_enable',array(
		'default' => false,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'garden_farm_title_enable', array(
	   'settings' => 'garden_farm_title_enable',
	   'section'   => 'title_tagline',
	   'label'     => __('Enable Site Title','garden-farm'),
	   'type'      => 'checkbox'
	));

	// color site tagline
	$wp_customize->add_setting('garden_farm_sitetagline_color',array(
		'default' => '',
		'sanitize_callback' => 'garden_farm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_sitetagline_color', array(
	   'settings' => 'garden_farm_sitetagline_color',
	   'section'   => 'title_tagline',
	   'label' => __('Site Tagline Color', 'garden-farm'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('garden_farm_tagline_enable',array(
		'default' => false,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'garden_farm_tagline_enable', array(
	   'settings' => 'garden_farm_tagline_enable',
	   'section'   => 'title_tagline',
	   'label'     => __('Enable Site Tagline','garden-farm'),
	   'type'      => 'checkbox'
	));

	// woocommerce section
	$wp_customize->add_section('garden_farm_woocommerce_page_settings', array(
		'title'    => __('WooCommerce Page Settings', 'garden-farm'),
		'priority' => null,
		'panel'    => 'woocommerce',
	));

	$wp_customize->add_setting('garden_farm_shop_page_sidebar',array(
		'default' => false,
		'sanitize_callback'	=> 'garden_farm_sanitize_checkbox'
	));
	$wp_customize->add_control('garden_farm_shop_page_sidebar',array(
		'type' => 'checkbox',
		'label' => __(' Check To Enable Shop page sidebar','garden-farm'),
		'section' => 'garden_farm_woocommerce_page_settings',
	));

    // shop page sidebar alignment
    $wp_customize->add_setting('garden_farm_shop_page_sidebar_position', array(
		'default'           => 'Right Sidebar',
		'sanitize_callback' => 'garden_farm_sanitize_choices',
	));
	$wp_customize->add_control('garden_farm_shop_page_sidebar_position',array(
		'type'           => 'radio',
		'label'          => __('Shop Page Sidebar', 'garden-farm'),
		'section'        => 'garden_farm_woocommerce_page_settings',
		'choices'        => array(
			'Left Sidebar'  => __('Left Sidebar', 'garden-farm'),
			'Right Sidebar' => __('Right Sidebar', 'garden-farm'),
		),
	));	 

	$wp_customize->add_setting('garden_farm_wooproducts_nav',array(
		'default' => 'Yes',
		'sanitize_callback'	=> 'garden_farm_sanitize_choices'
	));
	$wp_customize->add_control('garden_farm_wooproducts_nav',array(
		'type' => 'select',
		'label' => __('Shop Page Products Navigation','garden-farm'),
		'choices' => array(
			 'Yes' => __('Yes','garden-farm'),
			 'No' => __('No','garden-farm'),
		 ),
		'section' => 'garden_farm_woocommerce_page_settings',
	));

	$wp_customize->add_setting( 'garden_farm_single_page_sidebar',array(
		'default' => false,
		'sanitize_callback'	=> 'garden_farm_sanitize_checkbox'
    ) );
    $wp_customize->add_control('garden_farm_single_page_sidebar',array(
    	'type' => 'checkbox',
       	'label' => __('Check To Enable Single Product Page Sidebar','garden-farm'),
		'section' => 'garden_farm_woocommerce_page_settings'
    ));

	// single product page sidebar alignment
    $wp_customize->add_setting('garden_farm_single_product_page_layout', array(
		'default'           => 'Right Sidebar',
		'sanitize_callback' => 'garden_farm_sanitize_choices',
	));
	$wp_customize->add_control('garden_farm_single_product_page_layout',array(
		'type'           => 'radio',
		'label'          => __('Single product Page Sidebar', 'garden-farm'),
		'section'        => 'garden_farm_woocommerce_page_settings',
		'choices'        => array(
			'Left Sidebar'  => __('Left Sidebar', 'garden-farm'),
			'Right Sidebar' => __('Right Sidebar', 'garden-farm'),
		),
	));

	$wp_customize->add_setting('garden_farm_related_product_enable',array(
		'default' => true,
		'sanitize_callback'	=> 'garden_farm_sanitize_checkbox'
	));
	$wp_customize->add_control('garden_farm_related_product_enable',array(
		'type' => 'checkbox',
		'label' => __('Check To Enable Related product','garden-farm'),
		'section' => 'garden_farm_woocommerce_page_settings',
	));	

	$wp_customize->add_setting( 'garden_farm_woo_product_img_border_radius', array(
        'default'              => '0',
        'transport'            => 'refresh',
        'sanitize_callback'    => 'garden_farm_sanitize_integer'
    ) );
    $wp_customize->add_control(new Garden_Farm_Slider_Custom_Control( $wp_customize, 'garden_farm_woo_product_img_border_radius',array(
		'label'	=> esc_html__('Product Img Border Radius','garden-farm'),
		'section'=> 'garden_farm_woocommerce_page_settings',
		'settings'=>'garden_farm_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('garden_farm_products_per_row', array(
	    'default'   => '4',
	    'transport' => 'refresh',
	    'sanitize_callback' => 'garden_farm_sanitize_integer'  
    ));
    $wp_customize->add_control('garden_farm_products_per_row', array(
	   'label'    => __('Products Per Row', 'garden-farm'),
	   'section'  => 'garden_farm_woocommerce_page_settings',
	   'settings' => 'garden_farm_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('garden_farm_products_per_page', array(
		'default'   => '9',
		'transport' => 'refresh',
		'sanitize_callback' => 'garden_farm_sanitize_integer'
   ));
   $wp_customize->add_control('garden_farm_products_per_page', array(
	  'label'    => __('Products Per Page', 'garden-farm'),
	  'section'  => 'garden_farm_woocommerce_page_settings',
	  'settings' => 'garden_farm_products_per_page',
	  'type'     => 'number',
	  'input_attrs' => array(
		 'min'  => 1,
		 'step' => 1,
	 ),
   ));	

    $wp_customize->add_setting('garden_farm_product_sale_position',array(
		'default' => 'Left',
		'sanitize_callback' => 'garden_farm_sanitize_choices'
	));
	$wp_customize->add_control('garden_farm_product_sale_position',array(
		'type' => 'radio',
		'label' => __('Product Sale Position','garden-farm'),
		'section' => 'garden_farm_woocommerce_page_settings',
		'choices' => array(
			'Left' => __('Left','garden-farm'),
			'Right' => __('Right','garden-farm'),
		),
	) );     

	//Theme Options
	$wp_customize->add_panel( 'garden_farm_panel_area', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'title' => __( 'Theme Options Panel', 'garden-farm' ),
	) );

	//Site Layout Section
	$wp_customize->add_section('garden_farm_site_layoutsec',array(
		'title'	=> __('Manage Site Layout Section ','garden-farm'),
		'description' => __('<p class="sec-title">Manage Site Layout Section</p>','garden-farm'),
		'priority'	=> 1,
		'panel' => 'garden_farm_panel_area',
	));

	$wp_customize->add_setting('garden_farm_preloader',array(
		'default' => false,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'garden_farm_preloader', array(
	   'section'   => 'garden_farm_site_layoutsec',
	   'label'	=> __('Check to Show preloader','garden-farm'),
	   'type'      => 'checkbox'
 	));
	
  	$wp_customize->add_setting('garden_farm_box_layout',array(
		'default' => false,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'garden_farm_box_layout', array(
	   'section'   => 'garden_farm_site_layoutsec',
	   'label'	=> __('Check to Show Box Layout','garden-farm'),
	   'type'      => 'checkbox'
 	));
		
	$wp_customize->add_setting( 'garden_farm_layoutsec_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_layoutsec_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(GARDEN_FARM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'garden_farm_site_layoutsec'
	));		

	//Global Color
	$wp_customize->add_section('garden_farm_global_color', array(
		'title'    => __('Manage Global Color Section', 'garden-farm'),
		'panel'    => 'garden_farm_panel_area',
	));

	$wp_customize->add_setting('garden_farm_first_color', array(
		'default'           => '#0C7735',
		'sanitize_callback' => 'sanitize_hex_color',
	));
	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'garden_farm_first_color', array(
		'label'    => __('Theme Color', 'garden-farm'),
		'section'  => 'garden_farm_global_color',
		'settings' => 'garden_farm_first_color',
	)));	

	$wp_customize->add_setting('garden_farm_second_color', array(
		'default'           => '#FDD61F',
		'sanitize_callback' => 'sanitize_hex_color',
	));
	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'garden_farm_second_color', array(
		'label'    => __('Theme Color', 'garden-farm'),
		'section'  => 'garden_farm_global_color',
		'settings' => 'garden_farm_second_color',
	)));
    
	$wp_customize->add_setting( 'garden_farm_global_color_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_global_color_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(GARDEN_FARM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'garden_farm_global_color'
	));	

	// Topbar Section
	$wp_customize->add_section('garden_farm_topbar_section',array(
	    'title' => __('Manage Topbar Section','garden-farm'),
	    'priority'  => null,
	    'panel' => 'garden_farm_panel_area',
	));	

	// Sticky Header
	$wp_customize->add_setting( 'garden_farm_sticky_header',array(
        'default' => false,
        'sanitize_callback' => 'garden_farm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
    ));
    $wp_customize->add_control( 'garden_farm_sticky_header',array(
		'settings' => 'garden_farm_sticky_header',
	    'section'   => 'garden_farm_topbar_section',
        'label' => esc_html__( 'Check To Enable Sticky Header','garden-farm' ),
        'type'      => 'checkbox'
    ));

	$wp_customize->add_setting('garden_farm_enable_topbar_section',array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_enable_topbar_section', array(
	   'settings' => 'garden_farm_enable_topbar_section',
	   'section'   => 'garden_farm_topbar_section',
	   'label'     => __('Check To Enable This Section','garden-farm'),
	   'type'      => 'checkbox'
	));

	$wp_customize->add_setting('garden_farm_whatsapp_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_whatsapp_link', array(
	   'settings' => 'garden_farm_whatsapp_link',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Whatsapp Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('garden_farm_fb_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_fb_link', array(
	   'settings' => 'garden_farm_fb_link',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Facebook Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('garden_farm_youtube_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_youtube_link', array(
	   'settings' => 'garden_farm_youtube_link',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Youtube Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('garden_farm_instagram_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_instagram_link', array(
	   'settings' => 'garden_farm_instagram_link',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Instagram Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('garden_farm_phone_number',array(
		'default' => '',
		'sanitize_callback' => 'garden_farm_sanitize_phone_number',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_phone_number', array(
	   'settings' => 'garden_farm_phone_number',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Add Phone Number', 'garden-farm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('garden_farm_email_address',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_email',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_email_address', array(
	   'settings' => 'garden_farm_email_address',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Add Email Address', 'garden-farm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('garden_farm_address_location',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_address_location', array(
	   'settings' => 'garden_farm_address_location',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Add Location Address', 'garden-farm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('garden_farm_track_locatin_url',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_track_locatin_url', array(
	   'settings' => 'garden_farm_track_locatin_url',
	   'section'   => 'garden_farm_topbar_section',
	   'label' => __('Location Link', 'garden-farm'),
	   'type'      => 'url'
	));

    // Menu Text Transform
    $wp_customize->add_setting( 'garden_farm_menu_text_transform', array(
        'default'           => 'Capitalize',
		'transport' => 'refresh',
		'sanitize_callback' => 'garden_farm_sanitize_choices'
    ));

    $wp_customize->add_control( 'garden_farm_menu_text_transform', array(
        'label'    => __( 'Menu Text Transform', 'garden-farm' ),
        'section'  => 'garden_farm_topbar_section',
        'type'     => 'select',
        'choices'  => array(
			'None'       => __( 'None', 'garden-farm' ),
            'Capitalize' => __( 'Capitalize', 'garden-farm' ),
            'Uppercase'  => __( 'Uppercase', 'garden-farm' ),
            'Lowercase'  => __( 'Lowercase', 'garden-farm' ),
        ),
    ));

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

	// Slider Section
	$wp_customize->add_section('garden_farm_slider_section',array(
	    'title' => __('Manage Slider Section','garden-farm'),
	    'priority'  => null,
	    'description'	=> __('<p class="sec-title">Manage Slider Section</p> Select Category from the Dropdowns for slider, Also use the given image dimension (1200 x 700).','garden-farm'),
	    'panel' => 'garden_farm_panel_area',
	));	

	$wp_customize->add_setting('garden_farm_slider',array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_slider', array(
	   'settings' => 'garden_farm_slider',
	   'section'   => 'garden_farm_slider_section',
	   'label'     => __('Check To Enable This Section','garden-farm'),
	   'type'      => 'checkbox'
	));

	$garden_farm_categories = get_categories();
	$garden_farm_cat_post = array();
	$garden_farm_cat_post['0'] = 'Select';

	foreach ($garden_farm_categories as $garden_farm_category) {
	    $garden_farm_cat_post[$garden_farm_category->slug] = $garden_farm_category->name;
	}

	$wp_customize->add_setting('garden_farm_slider_cat', array(
	    'default' => '0',
	    'sanitize_callback' => 'garden_farm_sanitize_choices',
	));

	$wp_customize->add_control('garden_farm_slider_cat', array(
	    'type'    => 'select',
	    'choices' => $garden_farm_cat_post,
	    'label'   => __('Select Category to display Latest Post', 'garden-farm'),
	    'description' => __('<p class="sec-title">Choose a category, then reload the page.</p>', 'garden-farm'),
	    'section' => 'garden_farm_slider_section',
	));

	$wp_customize->add_setting('garden_farm_slider_subhead',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_slider_subhead', array(
	   'settings' => 'garden_farm_slider_subhead',
	   'section'   => 'garden_farm_slider_section',
	   'label' => __('Add Slider Subheading', 'garden-farm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('garden_farm_button_text',array(
		'default' => 'Discover More',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_button_text', array(
	   'settings' => 'garden_farm_button_text',
	   'section'   => 'garden_farm_slider_section',
	   'label' => __('Add Button Text', 'garden-farm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('garden_farm_button_icon',array(
        'default'=> 'fa-solid fa-arrow-right',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('garden_farm_button_icon',array(
        'label' => __('Button Icon','garden-farm'),
        'description' => __('Fontawesome Icon (e.g., fa-solid fa-arrow-right)','garden-farm'),
        'section'=> 'garden_farm_slider_section',
        'type'=> 'text'
    ));

	$wp_customize->add_setting('garden_farm_button_link_slider',array(
        'default'=> '',
        'sanitize_callback' => 'esc_url_raw'
    ));
    $wp_customize->add_control('garden_farm_button_link_slider',array(
        'label' => esc_html__('Add Button Link','garden-farm'),
        'section'=> 'garden_farm_slider_section',
        'type'=> 'url'
    ));

    $wp_customize->add_setting('garden_farm_slider_nav_img', array(
	    'default'           => '',
	    'sanitize_callback' => 'esc_url_raw',
	));
	$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'garden_farm_slider_nav_img', array(
	    'label'   => __('Select Navigation Image', 'garden-farm'),
	    'description'	=> __('Use the given image dimension (40 x 65).','garden-farm'),
	    'section' => 'garden_farm_slider_section',
	)));

	$wp_customize->add_setting( 'garden_farm_slider_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_slider_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(GARDEN_FARM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'garden_farm_slider_section'
	));	
    
	// Our Team Section
	$wp_customize->add_section('garden_farm_our_team_section', array(
	    'title'       => __('Manage Our Team Section', 'garden-farm'),
	    'description' => __('<p class="sec-title">Manage Our Team Section</p>', 'garden-farm'),
	    'priority'    => null,
	    'panel'       => 'garden_farm_panel_area',
	));

	$wp_customize->add_setting('garden_farm_disabled_our_team_section', array(
	    'default'           => true,
	    'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('garden_farm_disabled_our_team_section', array(
	    'settings' => 'garden_farm_disabled_our_team_section',
	    'section'  => 'garden_farm_our_team_section',
	    'label'    => __('Check To Enable Section', 'garden-farm'),
	    'type'     => 'checkbox',
	));

	$wp_customize->add_setting('garden_farm_our_team_text', array(
	    'default'           => ' ',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('garden_farm_our_team_text', array(
	    'settings' => 'garden_farm_our_team_text',
	    'section'  => 'garden_farm_our_team_section',
	    'label'    => __('Add Our Team Text', 'garden-farm'),
	    'type'     => 'text',
	));

	$wp_customize->add_setting('garden_farm_our_team_title', array(
	    'default'           => ' ',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('garden_farm_our_team_title', array(
	    'settings' => 'garden_farm_our_team_title',
	    'section'  => 'garden_farm_our_team_section',
	    'label'    => __('Add Our Team Title', 'garden-farm'),
	    'type'     => 'text',
	));

	$garden_farm_categories = get_categories();
	$garden_farm_cat_post = array();
	$garden_farm_cat_post['0'] = 'Select';

	foreach ($garden_farm_categories as $garden_farm_category) {
	    $garden_farm_cat_post[$garden_farm_category->slug] = $garden_farm_category->name;
	}

	$wp_customize->add_setting('garden_farm_posts', array(
	    'default' => '0',
	    'sanitize_callback' => 'garden_farm_sanitize_choices',
	));
	$wp_customize->add_control('garden_farm_posts', array(
	    'type'    => 'select',
	    'choices' => $garden_farm_cat_post,
	    'label'   => __('Select Category to display Latest Post', 'garden-farm'),
	    'description' => __('<p class="sec-title">Choose a category, then reload the page.</p>', 'garden-farm'),
	    'section' => 'garden_farm_our_team_section',
	));

	$garden_farm_selected_category = get_theme_mod('garden_farm_posts', '');

	if ($garden_farm_selected_category && $garden_farm_selected_category !== '0') {
	    $garden_farm_posts = get_posts(array(
	        'category_name'  => $garden_farm_selected_category,
	        'posts_per_page' => 3,
	    ));

	    foreach ($garden_farm_posts as $garden_farm_post) {
	        for ($garden_farm_i = 1; $garden_farm_i <= 5; $garden_farm_i++) {
	            // Setting for social link
	            $garden_farm_setting_link_id = 'garden_farm_social_link_' . $garden_farm_post->ID . '_' . $garden_farm_i;
	            $wp_customize->add_setting($garden_farm_setting_link_id, array(
	                'default'           => '',
	                'sanitize_callback' => 'esc_url_raw',
	                'capability' => 'edit_theme_options',
	            ));
	            $wp_customize->add_control($garden_farm_setting_link_id, array(
					/* translators: 1: Social link number, 2: Post title */
	                'label'   => sprintf(__('Social Link %1$d for Post: %2$s', 'garden-farm'), $garden_farm_i, $garden_farm_post->post_title),
	                'section' => 'garden_farm_our_team_section',
	                'type'    => 'url',
	            ));

	            // Setting for social icon
	            $garden_farm_setting_icon_id = 'garden_farm_social_icon_' . $garden_farm_post->ID . '_' . $garden_farm_i;
	            $wp_customize->add_setting($garden_farm_setting_icon_id, array(
	                'default'           => '',
	                'sanitize_callback' => 'sanitize_text_field',
	            ));
	            $wp_customize->add_control($garden_farm_setting_icon_id, array(
					/* translators: 1: Social Icon number, 2: Post title */
	                'label'       => sprintf(__('Social Icon %1$d for Post: %2$s', 'garden-farm'), $garden_farm_i, $garden_farm_post->post_title),
	                'description' => __('Fontawesome Icon (e.g., fa-brands fa-facebook-f)', 'garden-farm'),
	                'section'     => 'garden_farm_our_team_section',
	                'type'        => 'text',
	            ));
	        }
	    }
	}

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

	//Blog post
	$wp_customize->add_section('garden_farm_blog_post_settings',array(
        'title' => __('Manage Post Section', 'garden-farm'),
        'priority' => null,
        'panel' => 'garden_farm_panel_area'
    ) );

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

	$wp_customize->add_control(
		new Garden_Farm_Image_Radio_Control(
			$wp_customize,
			'garden_farm_blog_layout_option_setting',
			array(
				'label'   => __( 'Post Layouts', 'garden-farm' ),
				'section' => 'garden_farm_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('garden_farm_metafields_date', array(
	    'default' => true,
	    'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control('garden_farm_metafields_date', array(
	    'settings' => 'garden_farm_metafields_date', 
	    'section'   => 'garden_farm_blog_post_settings',
	    'label'     => __('Check to Enable Date', 'garden-farm'),
	    'type'      => 'checkbox',
	));

	$wp_customize->add_setting('garden_farm_metafields_comments', array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));	
	$wp_customize->add_control('garden_farm_metafields_comments', array(
		'settings' => 'garden_farm_metafields_comments',
		'section'  => 'garden_farm_blog_post_settings',
		'label'    => __('Check to Enable Comments', 'garden-farm'),
		'type'     => 'checkbox',
	));

	$wp_customize->add_setting('garden_farm_metafields_author', array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control('garden_farm_metafields_author', array(
		'settings' => 'garden_farm_metafields_author',
		'section'  => 'garden_farm_blog_post_settings',
		'label'    => __('Check to Enable Author', 'garden-farm'),
		'type'     => 'checkbox',
	));		

	$wp_customize->add_setting('garden_farm_metafields_time', array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control('garden_farm_metafields_time', array(
		'settings' => 'garden_farm_metafields_time',
		'section'  => 'garden_farm_blog_post_settings',
		'label'    => __('Check to Enable Time', 'garden-farm'),
		'type'     => 'checkbox',
	));	

	$wp_customize->add_setting('garden_farm_metabox_seperator',array(
		'default' => '|',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_metabox_seperator',array(
		'type' => 'text',
		'label' => __('Metabox Seperator','garden-farm'),
		'description' => __('Ex: "/", "|", "-", ...','garden-farm'),
		'section' => 'garden_farm_blog_post_settings'
	)); 

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

	$wp_customize->add_setting('garden_farm_blog_post_description_option',array(
    	'default'   => 'Excerpt Content', 
        'sanitize_callback' => 'garden_farm_sanitize_choices'
	));
	$wp_customize->add_control('garden_farm_blog_post_description_option',array(
        'type' => 'radio',
        'label' => __('Post Description Length','garden-farm'),
        'section' => 'garden_farm_blog_post_settings',
        'choices' => array(
            'No Content' => __('No Content','garden-farm'),
            'Excerpt Content' => __('Excerpt Content','garden-farm'),
            'Full Content' => __('Full Content','garden-farm'),
        ),
	) );

	$wp_customize->add_setting('garden_farm_blog_post_thumb',array(
        'sanitize_callback' => 'garden_farm_sanitize_checkbox',
        'default'           => 1,
    ));
    $wp_customize->add_control('garden_farm_blog_post_thumb',array(
        'type'        => 'checkbox',
        'label'       => esc_html__('Show / Hide Post Thumbnail', 'garden-farm'),
        'section'     => 'garden_farm_blog_post_settings',
    ));

    $wp_customize->add_setting( 'garden_farm_blog_post_page_image_box_shadow', array(
        'default'              => '0',
        'transport'            => 'refresh',
        'sanitize_callback'    => 'garden_farm_sanitize_integer'
    ) );
    $wp_customize->add_control(new Garden_Farm_Slider_Custom_Control( $wp_customize, 'garden_farm_blog_post_page_image_box_shadow',array(
		'label'	=> esc_html__('Post Image Box Shadow','garden-farm'),
		'section'=> 'garden_farm_blog_post_settings',
		'settings'=>'garden_farm_blog_post_page_image_box_shadow',
		'input_attrs' => array(
            'step'             => 1,
			'min'              => 0,
			'max'              => 100,
        ),
	)));	

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

	//Single Post Settings
	$wp_customize->add_section('garden_farm_single_post_settings',array(
		'title' => __('Manage Single Post Section', 'garden-farm'),
		'priority' => null,
		'panel' => 'garden_farm_panel_area'
	));

	$wp_customize->add_setting('garden_farm_single_post_date',array(
		'default' => true,
		'sanitize_callback'	=> 'garden_farm_sanitize_checkbox'
	));
	$wp_customize->add_control('garden_farm_single_post_date',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Date ','garden-farm'),
		'section' => 'garden_farm_single_post_settings'
	));	

	$wp_customize->add_setting('garden_farm_single_post_author',array(
		'default' => true,
		'sanitize_callback'	=> 'garden_farm_sanitize_checkbox'
	));
	$wp_customize->add_control('garden_farm_single_post_author',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Author','garden-farm'),
		'section' => 'garden_farm_single_post_settings'
	));

	$wp_customize->add_setting('garden_farm_single_post_comment',array(
		'default' => true,
		'sanitize_callback'	=> 'garden_farm_sanitize_checkbox'
	));
	$wp_customize->add_control('garden_farm_single_post_comment',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Comments','garden-farm'),
		'section' => 'garden_farm_single_post_settings'
	));	

	$wp_customize->add_setting('garden_farm_single_post_time',array(
		'default' => true,
		'sanitize_callback'	=> 'garden_farm_sanitize_checkbox'
	));
	$wp_customize->add_control('garden_farm_single_post_time',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Time','garden-farm'),
		'section' => 'garden_farm_single_post_settings'
	));	

	$wp_customize->add_setting('garden_farm_single_post_metabox_seperator',array(
		'default' => '|',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_single_post_metabox_seperator',array(
		'type' => 'text',
		'label' => __('Metabox Seperator','garden-farm'),
		'description' => __('Ex: "/", "|", "-", ...','garden-farm'),
		'section' => 'garden_farm_single_post_settings'
	)); 

	$wp_customize->add_setting('garden_farm_sidebar_single_post_layout',array(
    	'default' => 'right',
    	 'sanitize_callback' => 'garden_farm_sanitize_choices'
	));
	$wp_customize->add_control('garden_farm_sidebar_single_post_layout',array(
   		'type' => 'radio',
    	'label'     => __('Single post sidebar layout', 'garden-farm'),
     	'section' => 'garden_farm_single_post_settings',
     	'choices' => array(
			'left' => __('Left','garden-farm'),
			'right' => __('Right','garden-farm'),
			'full' => __('No Sidebar','garden-farm')
     ),
	));

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

	//Page Settings
	$wp_customize->add_section('garden_farm_page_settings',array(
		'title' => __('Manage Page Section', 'garden-farm'),
		'priority' => null,
		'panel' => 'garden_farm_panel_area'
	));

	// Add Settings and Controls for Page Layout
	$wp_customize->add_setting('garden_farm_sidebar_page_layout',array(
		'default' => 'full',
			'sanitize_callback' => 'garden_farm_sanitize_choices'
	));
	$wp_customize->add_control('garden_farm_sidebar_page_layout',array(
		'type' => 'radio',
		'label'     => __('Theme Page Sidebar Position', 'garden-farm'),
		'section' => 'garden_farm_page_settings',
		'choices' => array(
			'left' => __('Left','garden-farm'),
			'right' => __('Right','garden-farm'),
			'full' => __('No Sidebar','garden-farm')
	),
	));	

	// 404 Page Settings
	$wp_customize->add_section('garden_farm_page_not_found', array(
		'title'	=> __('Manage 404 Page Section','garden-farm'),
		'priority'	=> null,
		'panel' => 'garden_farm_panel_area',
	));
	
	$wp_customize->add_setting('garden_farm_page_not_found_heading',array(
		'default'=> __('404 Not Found','garden-farm'),
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_page_not_found_heading',array(
		'label'	=> __('404 Heading','garden-farm'),
		'section'=> 'garden_farm_page_not_found',
		'type'=> 'text'
	));

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

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

	$wp_customize->add_setting('garden_farm_page_not_found_btn',array(
		'default' => 'Homepage',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_page_not_found_btn', array(
	   'settings' => 'garden_farm_page_not_found_btn',
	   'section'   => 'garden_farm_page_not_found',
	   'label' => __('404 Button', 'garden-farm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting( 'garden_farm_page_not_found_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_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(GARDEN_FARM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'garden_farm_page_not_found'
	));

	// No Results Page Settings
	$wp_customize->add_section('garden_farm_no_results_found', array(
		'title'	=> __('Manage No Results Page Section','garden-farm'),
		'priority'	=> null,
		'panel' => 'garden_farm_panel_area',
	));
	
	$wp_customize->add_setting('garden_farm_page_nothing_found_heading',array(
		'default'=> __('Nothing Found','garden-farm'),
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_page_nothing_found_heading',array(
		'label'	=> __('Add Title','garden-farm'),
		'section'=> 'garden_farm_no_results_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('garden_farm_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('garden_farm_nothing_found_content',array(
		'label'	=> __('Add Text','garden-farm'),
		'section'=> 'garden_farm_no_results_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('garden_farm_nothing_found_search',array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_nothing_found_search', array(
	   'settings' => 'garden_farm_nothing_found_search',
	   'section'   => 'garden_farm_no_results_found',
	   'label'     => __('Check To Enable Search','garden-farm'),
	   'type'      => 'checkbox'
	));

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

	// Animation Section
	$wp_customize->add_section('garden_farm_animation', array(
		'title'	=> __('Manage Animation Section','garden-farm'),
		'description'	=> __('<p class="sec-title">Manage Animation Section</p>','garden-farm'),
		'priority'	=> null,
		'panel' => 'garden_farm_panel_area',
	));

	$wp_customize->add_setting('garden_farm_animation_enabled',array(
		'default' => true,
		'sanitize_callback' => 'garden_farm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_animation_enabled', array(
	   'settings' => 'garden_farm_animation_enabled',
	   'section'   => 'garden_farm_animation',
	   'label'     => __('Check To Enable Animation','garden-farm'),
	   'type'      => 'checkbox'
	));

	$wp_customize->add_setting( 'garden_farm_animation_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_animation_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		<a target='_blank' href='". esc_url(GARDEN_FARM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'garden_farm_animation'
	));
    
	// Footer Section
	$wp_customize->add_section('garden_farm_footer', array(
		'title'	=> __('Manage Footer Section','garden-farm'),
		'description'	=> __('<p class="sec-title">Manage Footer Section</p>','garden-farm'),
		'priority'	=> null,
		'panel' => 'garden_farm_panel_area',
	));

	$wp_customize->add_setting('garden_farm_footer_widget', array(
	    'default' => true,
	    'sanitize_callback' => 'garden_farm_sanitize_checkbox',
	));
	$wp_customize->add_control('garden_farm_footer_widget', array(
	    'settings' => 'garden_farm_footer_widget',
	    'section'   => 'garden_farm_footer',
	    'label'     => __('Check to Enable Footer Widget', 'garden-farm'),
	    'type'      => 'checkbox',
	));

	//  footer bg color
	$wp_customize->add_setting('garden_farm_footerbg_color',array(
		'default' => '',
		'sanitize_callback' => 'garden_farm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_footerbg_color', array(
		'settings' => 'garden_farm_footerbg_color',
		'section'   => 'garden_farm_footer',
		'label' => __('Footer Background Color', 'garden-farm'),
		'type'      => 'color'
	));

	$wp_customize->add_setting('garden_farm_footer_bg_image',array(
		'default'   => '',
		'sanitize_callback' => 'esc_url_raw',
	));
	$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'garden_farm_footer_bg_image',array(
		'label' => __('Footer Background Image','garden-farm'),
		'section' => 'garden_farm_footer',
	)));

	$wp_customize->add_setting('garden_farm_footer_img_position',array(
		'default' => 'center center',
		'transport' => 'refresh',
		'sanitize_callback' => 'garden_farm_sanitize_choices'
	));
	$wp_customize->add_control('garden_farm_footer_img_position',array(
		'type' => 'select',
		'label' => __('Footer Image Position','garden-farm'),
		'section' => 'garden_farm_footer',
		'choices' 	=> array(
			'center center'   => esc_html__( 'Center', 'garden-farm' ),
			'center top'   => esc_html__( 'Top', 'garden-farm' ),
			'left center'   => esc_html__( 'Left', 'garden-farm' ),
			'right center'   => esc_html__( 'Right', 'garden-farm' ),
			'center bottom'   => esc_html__( 'Bottom', 'garden-farm' ),
		),
	));	

	$wp_customize->add_setting('garden_farm_copyright_line',array(
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'garden_farm_copyright_line', array(
	   'section' 	=> 'garden_farm_footer',
	   'label'	 	=> __('Copyright Line','garden-farm'),
	   'type'    	=> 'text',
	   'priority' 	=> null,
    ));

	$wp_customize->add_setting('garden_farm_copyright_link',array(
    	'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'garden_farm_copyright_link', array(
	   'section' 	=> 'garden_farm_footer',
	   'label'	 	=> __('Copyright Link','garden-farm'),
	   'type'    	=> 'text',
	   'priority' 	=> null,
    ));	

	//  footer title color
	$wp_customize->add_setting('garden_farm_footertitle_color',array(
		'default' => '',
		'sanitize_callback' => 'garden_farm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_footertitle_color', array(
	   'settings' => 'garden_farm_footertitle_color',
	   'section'   => 'garden_farm_footer',
	   'label' => __('Title Color', 'garden-farm'),
	   'type'      => 'color'
	));

	//  footer list color
	$wp_customize->add_setting('garden_farm_footerlist_color',array(
		'default' => '',
		'sanitize_callback' => 'garden_farm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_footerlist_color', array(
	   'settings' => 'garden_farm_footerlist_color',
	   'section'   => 'garden_farm_footer',
	   'label' => __('List Color', 'garden-farm'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('garden_farm_scroll_hide', array(
        'default' => true,
        'sanitize_callback' => 'garden_farm_sanitize_checkbox'
    ));
    $wp_customize->add_control( new WP_Customize_Control($wp_customize,'garden_farm_scroll_hide',array(
        'label'          => __( 'Check To Show Scroll To Top', 'garden-farm' ),
        'section'        => 'garden_farm_footer',
        'settings'       => 'garden_farm_scroll_hide',
        'type'           => 'checkbox',
    )));

    $wp_customize->add_setting('garden_farm_scroll_position',array(
        'default' => 'Right',
        'sanitize_callback' => 'garden_farm_sanitize_choices'
    ));
    $wp_customize->add_control('garden_farm_scroll_position',array(
        'type' => 'radio',
        'section' => 'garden_farm_footer',
        'label'	 	=> __('Scroll To Top Positions','garden-farm'),
        'choices' => array(
            'Right' => __('Right','garden-farm'),
            'Left' => __('Left','garden-farm'),
            'Center' => __('Center','garden-farm')
        ),
    ) );	

	$wp_customize->add_setting('garden_farm_scroll_text',array(
		'default'	=> __('TOP','garden-farm'),
		'sanitize_callback'	=> 'sanitize_text_field',
	));	
	$wp_customize->add_control('garden_farm_scroll_text',array(
		'label'	=> __('Scroll To Top Button Text','garden-farm'),
		'section'	=> 'garden_farm_footer',
		'type'		=> 'text'
	));

	$wp_customize->add_setting( 'garden_farm_scroll_top_shape', array(
		'default'           => 'circle',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'garden_farm_scroll_top_shape', array(
		'label'    => __( 'Scroll to Top Button Shape', 'garden-farm' ),
		'section'  => 'garden_farm_footer',
		'settings' => 'garden_farm_scroll_top_shape',
		'type'     => 'radio',
		'choices'  => array(
			'box'        => __( 'Box', 'garden-farm' ),
			'curved' => __( 'Curved', 'garden-farm'),
			'circle'     => __( 'Circle', 'garden-farm' ),
		),
	));

	$wp_customize->add_setting('garden_farm_footer_widget_areas',array(
		'default'           => 4,
		'sanitize_callback' => 'garden_farm_sanitize_choices',
	));
	$wp_customize->add_control('garden_farm_footer_widget_areas',array(
		'type'        => 'radio',
		'section' => 'garden_farm_footer',
		'label'       => __('Footer widget area', 'garden-farm'),
		'choices' => array(
		   '1'     => __('One', 'garden-farm'),
		   '2'     => __('Two', 'garden-farm'),
		   '3'     => __('Three', 'garden-farm'),
		   '4'     => __('Four', 'garden-farm')
		),
	));

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

	// Footer Social Section
	$wp_customize->add_section('garden_farm_footer_social_icons', array(
		'title'	=> __('Manage Footer Social Section','garden-farm'),
		'description'	=> __('<p class="sec-title">Manage Footer Social Section</p>','garden-farm'),
		'priority'	=> null,
		'panel' => 'garden_farm_panel_area',
	));

	$wp_customize->add_setting('garden_farm_footer_whatsapp_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_footer_whatsapp_link', array(
	   'settings' => 'garden_farm_footer_whatsapp_link',
	   'section'   => 'garden_farm_footer_social_icons',
	   'label' => __('Whatsapp Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('garden_farm_footer_facebook_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_footer_facebook_link', array(
	   'settings' => 'garden_farm_footer_facebook_link',
	   'section'   => 'garden_farm_footer_social_icons',
	   'label' => __('Facebook Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('garden_farm_footer_youtube_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_footer_youtube_link', array(
	   'settings' => 'garden_farm_footer_youtube_link',
	   'section'   => 'garden_farm_footer_social_icons',
	   'label' => __('Youtube Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('garden_farm_footer_instagram_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'garden_farm_footer_instagram_link', array(
	   'settings' => 'garden_farm_footer_instagram_link',
	   'section'   => 'garden_farm_footer_social_icons',
	   'label' => __('Instagram Link', 'garden-farm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting( 'garden_farm_footer_social_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('garden_farm_footer_social_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(GARDEN_FARM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'garden_farm_footer_social_icons'
	));	
    
	// Google Fonts
	$wp_customize->add_section( 'garden_farm_google_fonts_section', array(
		'title'       => __( 'Google Fonts', 'garden-farm' ),
		'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( 'garden_farm_headings_fonts', array(
		'sanitize_callback' => 'garden_farm_sanitize_fonts',
	));
	$wp_customize->add_control( 'garden_farm_headings_fonts', array(
		'type' => 'select',
		'description' => __('Select your desired font for the headings.', 'garden-farm'),
		'section' => 'garden_farm_google_fonts_section',
		'choices' => $font_choices
	));

	$wp_customize->add_setting( 'garden_farm_body_fonts', array(
		'sanitize_callback' => 'garden_farm_sanitize_fonts'
	));
	$wp_customize->add_control( 'garden_farm_body_fonts', array(
		'type' => 'select',
		'description' => __( 'Select your desired font for the body.', 'garden-farm' ),
		'section' => 'garden_farm_google_fonts_section',
		'choices' => $font_choices
	));
  
}
add_action( 'customize_register', 'garden_farm_customize_register' );

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