<?php
/**
 * Surgical Hospital Theme Customizer
 *
 * @package Surgical Hospital
 */

function Surgical_Hospital_Customize_register( $wp_customize ) {
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial(
			'blogname',
			array(
				'selector'        => '.site-title a',
				'render_callback' => 'Surgical_Hospital_Customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'Surgical_Hospital_Customize_partial_blogdescription',
			)
		);
	}

	/*
    * Theme Options Panel
    */
	$wp_customize->add_panel('surgical_hospital_panel', array(
		'priority' => 25,
		'capability' => 'edit_theme_options',
		'title' => __('Surgical Hospital Theme Options', 'surgical-hospital'),
	));

	/*
	* Customizer main header section
	*/

	$wp_customize->add_setting(
		'surgical_hospital_site_title_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_site_title_text',
		array(
			'label'       => __('Enable Title', 'surgical-hospital'),
			'description' => __('Enable or Disable Title from the site', 'surgical-hospital'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting(
		'surgical_hospital_site_tagline_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_site_tagline_text',
		array(
			'label'       => __('Enable Tagline', 'surgical-hospital'),
			'description' => __('Enable or Disable Tagline from the site', 'surgical-hospital'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

		$wp_customize->add_setting(
		'surgical_hospital_logo_width',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '150',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_logo_width',
		array(
			'label'       => __('Logo Width in PX', 'surgical-hospital'),
			'section'     => 'title_tagline',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 100,
	             'max' => 300,
	             'step' => 1,
	         ),
		)
	);

	/* WooCommerce custom settings */

	$wp_customize->add_section('woocommerce_custom_settings', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('WooCommerce Custom Settings', 'surgical-hospital'),
		'panel'       => 'woocommerce',
	));

	$wp_customize->add_setting(
		'surgical_hospital_per_columns',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_per_columns',
		array(
			'label'       => __('Product Per Single Row', 'surgical-hospital'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 4,
	             'step' => 1,
	         ),
		)
	);

	$wp_customize->add_setting(
		'surgical_hospital_product_per_page',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '6',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_product_per_page',
		array(
			'label'       => __('Product Per One Page', 'surgical-hospital'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 12,
	             'step' => 1,
	         ),
		)
	);

	/*Related Products Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_related_product',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_related_product',
		array(
			'label'       => __('Enable Related Product', 'surgical-hospital'),
			'description' => __('Checked to show Related Product', 'surgical-hospital'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting(
		'custom_related_products_number',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'custom_related_products_number',
		array(
			'label'       => __('Related Product Count', 'surgical-hospital'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 20,
	             'step' => 1,
	         ),
		)
	);

	$wp_customize->add_setting(
		'custom_related_products_number_per_row',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'custom_related_products_number_per_row',
		array(
			'label'       => __('Related Product Per Row', 'surgical-hospital'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 4,
	             'step' => 1,
	         ),
		)
	);

	/*Archive Product layout*/
	$wp_customize->add_setting('surgical_hospital_archive_product_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
	));
	$wp_customize->add_control('surgical_hospital_archive_product_layout',array(
        'type' => 'select',
        'label' => esc_html__('Archive Product Layout','surgical-hospital'),
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','surgical-hospital'),
            'layout-2' => esc_html__('Sidebar On Left','surgical-hospital'),
			'layout-3' => esc_html__('Full Width Layout','surgical-hospital')
        ),
	) );

	/*Single Product layout*/
	$wp_customize->add_setting('surgical_hospital_single_product_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
	));
	$wp_customize->add_control('surgical_hospital_single_product_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Product Layout','surgical-hospital'),
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','surgical-hospital'),
            'layout-2' => esc_html__('Sidebar On Left','surgical-hospital'),
			'layout-3' => esc_html__('Full Width Layout','surgical-hospital')
        ),
	) );

	$wp_customize->add_setting('surgical_hospital_woocommerce_product_sale',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
        'default'           => 'Right',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
    ));
    $wp_customize->add_control('surgical_hospital_woocommerce_product_sale',array(
        'label'       => esc_html__( 'Woocommerce Product Sale Positions','surgical-hospital' ),
        'type' => 'select',
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'Right' => __('Right','surgical-hospital'),
            'Left' => __('Left','surgical-hospital'),
            'Center' => __('Center','surgical-hospital')
        ),
    ) );

	/*Additional Options*/
	$wp_customize->add_section('surgical_hospital_additional_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Additional Options', 'surgical-hospital'),
		'panel'       => 'surgical_hospital_panel',
	));

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_sticky_header',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => false,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_sticky_header',
		array(
			'label'       => __('Enable Sticky Header', 'surgical-hospital'),
			'description' => __('Checked to enable sticky header', 'surgical-hospital'),
			'section'     => 'surgical_hospital_additional_section',
			'type'        => 'checkbox',
		)
	);

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_preloader',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_preloader',
		array(
			'label'       => __('Enable Preloader', 'surgical-hospital'),
			'description' => __('Checked to show preloader', 'surgical-hospital'),
			'section'     => 'surgical_hospital_additional_section',
			'type'        => 'checkbox',
		)
	);

	/*Breadcrumbs Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_breadcrumbs',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_breadcrumbs',
		array(
			'label'       => __('Enable Breadcrumbs', 'surgical-hospital'),
			'description' => __('Checked to show Breadcrumbs', 'surgical-hospital'),
			'section'     => 'surgical_hospital_additional_section',
			'type'        => 'checkbox',
		)
	);

		/*Pagination Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_pagination',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_pagination',
		array(
			'label'       => __('Enable Pagination', 'surgical-hospital'),
			'description' => __('Checked to show Pagination', 'surgical-hospital'),
			'section'     => 'surgical_hospital_additional_section',
			'type'        => 'checkbox',
		)
	);

		/*Pagination Select Type Option*/
	$wp_customize->add_setting('surgical_hospital_pagination_type',array(
        'default' => 'type-1',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
	));
	$wp_customize->add_control('surgical_hospital_pagination_type',array(
        'type' => 'select',
        'label' => esc_html__('Select Pagination Type','surgical-hospital'),
        'section' => 'surgical_hospital_additional_section',
        'choices' => array(
            'type-1' => esc_html__('Type 1','surgical-hospital'),
            'type-2' => esc_html__('Type 2','surgical-hospital'),
        ),
	) );

	/*Post layout*/
	$wp_customize->add_setting('surgical_hospital_archive_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
	));
	$wp_customize->add_control('surgical_hospital_archive_layout',array(
        'type' => 'select',
        'label' => esc_html__('Posts Layout','surgical-hospital'),
        'section' => 'surgical_hospital_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','surgical-hospital'),
            'layout-2' => esc_html__('Sidebar On Left','surgical-hospital'),
			'layout-3' => esc_html__('Full Width Layout','surgical-hospital')
        ),
	) );

	/*single post layout*/
	$wp_customize->add_setting('surgical_hospital_post_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
	));
	$wp_customize->add_control('surgical_hospital_post_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Post Layout','surgical-hospital'),
        'section' => 'surgical_hospital_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','surgical-hospital'),
            'layout-2' => esc_html__('Sidebar On Left','surgical-hospital'),
			'layout-3' => esc_html__('Full Width Layout','surgical-hospital')
        ),
	) );

	/*single page layout*/
	$wp_customize->add_setting('surgical_hospital_page_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
	));
	$wp_customize->add_control('surgical_hospital_page_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Page Layout','surgical-hospital'),
        'section' => 'surgical_hospital_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','surgical-hospital'),
            'layout-2' => esc_html__('Sidebar On Left','surgical-hospital'),
			'layout-3' => esc_html__('Full Width Layout','surgical-hospital')
        ),
	) );

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

	$wp_customize->add_control(
		'surgical_hospital_additional_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more additional options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(SURGICAL_HOSPITAL_BUY_NOW) ." '>Check Surgical Hospital PRO version.</a>
					</div>
				</div>
			",
			'section' => 'surgical_hospital_additional_section'
		)
	);

	/*Archive Post Options*/
	$wp_customize->add_section('surgical_hospital_blog_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Blog Page Options', 'surgical-hospital'),
		'panel'       => 'surgical_hospital_panel',
	));

	$wp_customize->add_setting('surgical_hospital_enable_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_blog_post_title',array(
		'label'       => __('Enable Blog Post Title', 'surgical-hospital'),
		'description' => __('Checked To Show Blog Post Title', 'surgical-hospital'),
		'section'     => 'surgical_hospital_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_blog_post_meta',array(
		'label'       => __('Enable Blog Post Meta', 'surgical-hospital'),
		'description' => __('Checked To Show Blog Post Meta Feilds', 'surgical-hospital'),
		'section'     => 'surgical_hospital_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_blog_post_tags',array(
		'label'       => __('Enable Blog Post Tags', 'surgical-hospital'),
		'description' => __('Checked To Show Blog Post Tags', 'surgical-hospital'),
		'section'     => 'surgical_hospital_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_blog_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_blog_post_image',array(
		'label'       => __('Enable Blog Post Image', 'surgical-hospital'),
		'description' => __('Checked To Show Blog Post Image', 'surgical-hospital'),
		'section'     => 'surgical_hospital_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_blog_post_content',array(
		'label'       => __('Enable Blog Post Content', 'surgical-hospital'),
		'description' => __('Checked To Show Blog Post Content', 'surgical-hospital'),
		'section'     => 'surgical_hospital_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_blog_post_button',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_blog_post_button',array(
		'label'       => __('Enable Blog Post Read More Button', 'surgical-hospital'),
		'description' => __('Checked To Show Blog Post Read More Button', 'surgical-hospital'),
		'section'     => 'surgical_hospital_blog_post_section',
		'type'        => 'checkbox',
	));

	/*Blog post Content layout*/
	$wp_customize->add_setting('surgical_hospital_blog_Post_content_layout',array(
        'default' => 'Left',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
	));
	$wp_customize->add_control('surgical_hospital_blog_Post_content_layout',array(
        'type' => 'select',
        'label' => esc_html__('Blog Post Content Layout','surgical-hospital'),
        'section' => 'surgical_hospital_blog_post_section',
        'choices' => array(
            'Left' => esc_html__('Left','surgical-hospital'),
            'Center' => esc_html__('Center','surgical-hospital'),
            'Right' => esc_html__('Right','surgical-hospital')
        ),
	) );

	/*Excerpt*/
    $wp_customize->add_setting(
		'surgical_hospital_excerpt_limit',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '25',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_excerpt_limit',
		array(
			'label'       => __('Excerpt Limit', 'surgical-hospital'),
			'section'     => 'surgical_hospital_blog_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 2,
	             'max' => 50,
	             'step' => 2,
	         ),
		)
	);

	/*Archive Button Text*/
	$wp_customize->add_setting(
		'surgical_hospital_read_more_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Continue Reading....',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_read_more_text',
		array(
			'label'       => __('Edit Button Text ', 'surgical-hospital'),
			'section'     => 'surgical_hospital_blog_post_section',
			'type'        => 'text',
		)
	);

	/*Single Post Options*/
	$wp_customize->add_section('surgical_hospital_single_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Single Post Options', 'surgical-hospital'),
		'panel'       => 'surgical_hospital_panel',
	));

	$wp_customize->add_setting('surgical_hospital_enable_single_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_single_blog_post_title',array(
		'label'       => __('Enable Single Post Title', 'surgical-hospital'),
		'description' => __('Checked To Show Single Blog Post Title', 'surgical-hospital'),
		'section'     => 'surgical_hospital_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_single_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_single_blog_post_meta',array(
		'label'       => __('Enable Single Post Meta', 'surgical-hospital'),
		'description' => __('Checked To Show Single Blog Post Meta Feilds', 'surgical-hospital'),
		'section'     => 'surgical_hospital_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_single_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_single_blog_post_tags',array(
		'label'       => __('Enable Single Post Tags', 'surgical-hospital'),
		'description' => __('Checked To Show Single Blog Post Tags', 'surgical-hospital'),
		'section'     => 'surgical_hospital_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_single_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_single_post_image',array(
		'label'       => __('Enable Single Post Image', 'surgical-hospital'),
		'description' => __('Checked To Show Single Post Image', 'surgical-hospital'),
		'section'     => 'surgical_hospital_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('surgical_hospital_enable_single_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));
	$wp_customize->add_control('surgical_hospital_enable_single_blog_post_content',array(
		'label'       => __('Enable Single Post Content', 'surgical-hospital'),
		'description' => __('Checked To Show Single Blog Post Content', 'surgical-hospital'),
		'section'     => 'surgical_hospital_single_post_section',
		'type'        => 'checkbox',
	));

	/*Related Post Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_related_post',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_related_post',
		array(
			'label'       => __('Enable Related Post', 'surgical-hospital'),
			'description' => __('Checked to show Related Post', 'surgical-hospital'),
			'section'     => 'surgical_hospital_single_post_section',
			'type'        => 'checkbox',
		)
	);

	/*Related post Edit Text*/
	$wp_customize->add_setting(
		'surgical_hospital_related_post_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Related Post',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_related_post_text',
		array(
			'label'       => __('Edit Related Post Text ', 'surgical-hospital'),
			'section'     => 'surgical_hospital_single_post_section',
			'type'        => 'text',
		)
	);	

	/*Related Post Per Page*/
	$wp_customize->add_setting(
		'surgical_hospital_related_post_count',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_related_post_count',
		array(
			'label'       => __('Related Post Count', 'surgical-hospital'),
			'section'     => 'surgical_hospital_single_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 9,
	             'step' => 1,
	         ),
		)
	);

	/* Comment Section Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_comment_section',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_comment_section',
		array(
			'label'       => __('Enable Comment Section', 'surgical-hospital'),
			'description' => __('Checked to show Comment Section', 'surgical-hospital'),
			'section'     => 'surgical_hospital_single_post_section',
			'type'        => 'checkbox',
		)
	);

	/*
	* Customizer Global COlor
	*/

	/*Global Color Options*/
	$wp_customize->add_section('surgical_hospital_global_color_section', array(
		'priority'       => 1,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Global Color Options', 'surgical-hospital'),
		'panel'       => 'surgical_hospital_panel',
	));

	$wp_customize->add_setting( 'surgical_hospital_primary_color',
		array(
		'default'           => '#1BBDE4',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control( 
		new WP_Customize_Color_Control( 
		$wp_customize, 
		'surgical_hospital_primary_color',
		array(
			'label'      => esc_html__( 'Primary Color', 'surgical-hospital' ),
			'section'    => 'surgical_hospital_global_color_section',
			'settings'   => 'surgical_hospital_primary_color',
		) ) 
	);

	/*Typography Options*/
	$wp_customize->add_section( 'surgical_hospital_typography_section', array(
		'panel'       => 'surgical_hospital_panel',
        'title'    => __( 'Typography Options', 'surgical-hospital' ),
        'priority' => 2,
    ) );

    $wp_customize->add_setting( 'surgical_hospital_font_family', array(
		'default'           => 'default',
		'sanitize_callback' => 'surgical_hospital_sanitize_font_family',
	) );
	
	$wp_customize->add_control( 'surgical_hospital_font_family', array(
		'label'    => __( 'Global Font Family', 'surgical-hospital' ),
		'section'  => 'surgical_hospital_typography_section',
		'type'     => 'select',
		'choices'  => array(
			'default'          => __( 'Default (Theme Font)', 'surgical-hospital' ),
			'bad_script'       => 'Bad Script',
			'roboto'           => 'Roboto',
			'playfair_display' => 'Playfair Display',
			'open_sans'        => 'Open Sans',
			'lobster'          => 'Lobster',
			'merriweather'     => 'Merriweather',
			'oswald'           => 'Oswald',
			'raleway'          => 'Raleway',
		),
	) );

/*
	* Customizer main header section
	*/
	/*Main Header Options*/
	$wp_customize->add_section('surgical_hospital_header_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Header Options', 'surgical-hospital'),
		'panel'       => 'surgical_hospital_panel',
	));

	$wp_customize->add_setting(
		'surgical_hospital_header_search',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => true,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_header_search',
		array(
			'label'       => __('Enable Disable Search', 'surgical-hospital'),
			'description' => __('Enable or Disable header Search', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'checkbox',
		)
	);

	// Add Setting for Menu Text Transform
    $wp_customize->add_setting( 'surgical_hospital_menu_text_transform', array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'capitalize',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
    ) );

    // Add Control for Menu Text Transform
    $wp_customize->add_control( 'surgical_hospital_menu_text_transform', array(
        'label'    => __( 'Menu Text Transform', 'surgical-hospital' ),
        'section'  => 'surgical_hospital_header_section',
        'type'     => 'select',
        'choices'  => array(
            'none'       => __( 'None', 'surgical-hospital' ),
            'capitalize' => __( 'Capitalize', 'surgical-hospital' ),
            'uppercase'  => __( 'Uppercase', 'surgical-hospital' ),
            'lowercase'  => __( 'Lowercase', 'surgical-hospital' ),
        ),
    ) );

	$wp_customize->add_setting('surgical_hospital_location',array(
		'default'=> 'Mountain Drive, London, UK',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('surgical_hospital_location',array(
		'label'	=> __('Add location','surgical-hospital'),
		'section'=> 'surgical_hospital_header_section',
		'type'=> 'text'
	));

	/*Main Header Phone Text*/
	$wp_customize->add_setting(
		'surgical_hospital_header_info_phone',
		array(
			'default'           => '+00 123 456 7890',
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'sanitize_callback' => 'surgical_hospital_sanitize_phone_number',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_header_info_phone',
		array(
			'label'       => __('Edit Phone Number ', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'text',
		)
	);

	/*Main Header Phone Text*/
	$wp_customize->add_setting(
		'surgical_hospital_header_info_email',
		array(
			'default'           => 'doctor1245@example.com',
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_email',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_header_info_email',
		array(
			'label'       => __('Edit Email Address ', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'text',
		)
	);

	/*Main Header Button Text*/
	$wp_customize->add_setting(
		'surgical_hospital_header_button_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Get A Quote',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_header_button_text',
		array(
			'label'       => __('Edit Button Text ', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'text',
		)
	);

	/*Main Header Button Link*/
	$wp_customize->add_setting(
		'surgical_hospital_header_button_link',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_header_button_link',
		array(
			'label'       => __('Edit Button Link ', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'url',
		)
	);

	/*Facebook Link*/
	$wp_customize->add_setting(
		'surgical_hospital_facebook_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'www.facebook.com',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_facebook_link_option',
		array(
			'label'       => __('Edit Facebook Link', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'url',
		)
	);

	/*Twitter Link*/
	$wp_customize->add_setting(
		'surgical_hospital_twitter_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'www.twitter.com',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_twitter_link_option',
		array(
			'label'       => __('Edit Twitter Link', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'surgical_hospital_youtube_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'www.youtube.com',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_youtube_link_option',
		array(
			'label'       => __('Edit Youtube Link', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'surgical_hospital_instagram_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'www.instagram.com',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_instagram_link_option',
		array(
			'label'       => __('Edit Instagram Link', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'surgical_hospital_linked_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'www.linkedin.com',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_linked_link_option',
		array(
			'label'       => __('Edit Linkedin Link', 'surgical-hospital'),
			'section'     => 'surgical_hospital_header_section',
			'type'        => 'url',
		)
	);

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

	$wp_customize->add_control(
		'surgical_hospital_header_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more header options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(SURGICAL_HOSPITAL_BUY_NOW) ." '>Check Surgical Hospital PRO version.</a>
					</div>
				</div>
			",
			'section' => 'surgical_hospital_header_section'
		)
	);

	/*
	* Customizer main slider section
	*/
	/*Main Slider Options*/
	$wp_customize->add_section('surgical_hospital_slider_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Slider Options', 'surgical-hospital'),
		'panel'       => 'surgical_hospital_panel',
	));

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_slider',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_slider',
		array(
			'label'       => __('Enable Main Slider', 'surgical-hospital'),
			'description' => __('Checked to show the main slider', 'surgical-hospital'),
			'section'     => 'surgical_hospital_slider_section',
			'type'        => 'checkbox',
		)
	);

	for ($i=1; $i <= 3; $i++) { 

		/*Main Slider Image*/
		$wp_customize->add_setting(
			'surgical_hospital_slider_image'.$i,
			array(
				'capability'    => 'edit_theme_options',
		        'default'       => '',
		        'transport'     => 'postMessage',
		        'sanitize_callback' => 'esc_url_raw',
	    	)
	    );

		$wp_customize->add_control( 
			new WP_Customize_Image_Control( $wp_customize, 
				'surgical_hospital_slider_image'.$i, 
				array(
			        'label' => __('Edit Slider Image ', 'surgical-hospital') .$i,
			        'description' => __('Edit the slider image.', 'surgical-hospital'),
			        'section' => 'surgical_hospital_slider_section',
				)
			)
		);

		/*Main Slider Heading*/
		$wp_customize->add_setting(
			'surgical_hospital_slider_heading'.$i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		$wp_customize->add_control(
			'surgical_hospital_slider_heading'.$i,
			array(
				'label'       => __('Edit Heading Text ', 'surgical-hospital') .$i,
				'description' => __('Edit the slider heading text.', 'surgical-hospital'),
				'section'     => 'surgical_hospital_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Content*/
		$wp_customize->add_setting(
			'surgical_hospital_slider_text'.$i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		$wp_customize->add_control(
			'surgical_hospital_slider_text'.$i,
			array(
				'label'       => __('Edit Content Text ', 'surgical-hospital') .$i,
				'description' => __('Edit the slider content text.', 'surgical-hospital'),
				'section'     => 'surgical_hospital_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 Text*/
		$wp_customize->add_setting(
			'surgical_hospital_slider_button1_text'.$i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);
		$wp_customize->add_control(
			'surgical_hospital_slider_button1_text'.$i,
			array(
				'label'       => __('Edit Button #1 Text ', 'surgical-hospital') .$i,
				'description' => __('Edit the slider button text.', 'surgical-hospital'),
				'section'     => 'surgical_hospital_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 URL*/
		$wp_customize->add_setting(
			'surgical_hospital_slider_button1_link'.$i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'esc_url_raw',
			)
		);

		$wp_customize->add_control(
			'surgical_hospital_slider_button1_link'.$i,
			array(
				'label'       => __('Edit Button #1 URL ', 'surgical-hospital') .$i,
				'description' => __('Edit the slider button url.', 'surgical-hospital'),
				'section'     => 'surgical_hospital_slider_section',
				'type'        => 'url',
			)
		);

		/*Main Slider Button2 Text*/
		$wp_customize->add_setting(
			'surgical_hospital_slider_button2_text'.$i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		$wp_customize->add_control(
			'surgical_hospital_slider_button2_text'.$i,
			array(
				'label'       => __('Edit Button #2 Text ', 'surgical-hospital') .$i,
				'description' => __('Edit the slider button text.', 'surgical-hospital'),
				'section'     => 'surgical_hospital_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 URL*/
		$wp_customize->add_setting(
			'surgical_hospital_slider_button2_link'.$i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'esc_url_raw',
			)
		);

		$wp_customize->add_control(
			'surgical_hospital_slider_button2_link'.$i,
			array(
				'label'       => __('Edit Button #2 URL ', 'surgical-hospital') .$i,
				'description' => __('Edit the slider button url.', 'surgical-hospital'),
				'section'     => 'surgical_hospital_slider_section',
				'type'        => 'url',
			)
		);
	}

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

	$wp_customize->add_control(
		'surgical_hospital_slider_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more slider options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(SURGICAL_HOSPITAL_BUY_NOW) ." '>Check Surgical Hospital PRO version.</a>
					</div>
				</div>
			",
			'section' => 'surgical_hospital_slider_section'
		)
	);

	// Project section
	$wp_customize->add_section('surgical_hospital_projetcs_sec', array(
	    'priority'       => 5,
	    'capability'     => 'edit_theme_options',
	    'title'          => __('Our Best Project Section', 'surgical-hospital'),
	    'panel'          => 'surgical_hospital_panel',
	));

	// Enable/disable section
	$wp_customize->add_setting('surgical_hospital_projetcs_sec_show', array(
	    'capability'        => 'edit_theme_options',
	    'default'           => 0,
	    'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
	));

	$wp_customize->add_control('surgical_hospital_projetcs_sec_show', array(
	    'label'    => __('Enable Our Projects Section', 'surgical-hospital'),
	    'section'  => 'surgical_hospital_projetcs_sec',
	    'type'     => 'checkbox',
	));

	// Section heading text
	$wp_customize->add_setting('surgical_hospital_projetcs_main_text', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	));

	$wp_customize->add_control('surgical_hospital_projetcs_main_text', array(
	    'label'   => esc_html__('Add Section Small Title', 'surgical-hospital'),
	    'section' => 'surgical_hospital_projetcs_sec',
	    'type'    => 'text',
	));

	// Section heading
	$wp_customize->add_setting('surgical_hospital_projetcs_main_heading', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	));

	$wp_customize->add_control('surgical_hospital_projetcs_main_heading', array(
	    'label'   => esc_html__('Add Section Small Heading', 'surgical-hospital'),
	    'section' => 'surgical_hospital_projetcs_sec',
	    'type'    => 'text',
	));

	// Number of tabs
	$wp_customize->add_setting('surgical_hospital_projetcs_number', array(
	    'default'           => 6,
	    'sanitize_callback' => 'absint',
	));

	$wp_customize->add_control('surgical_hospital_projetcs_number', array(
	    'label'       => esc_html__('No of Tabs to show', 'surgical-hospital'),
	    'section'     => 'surgical_hospital_projetcs_sec',
	    'type'        => 'number',
	    'input_attrs' => array(
	        'step' => 1,
	        'min'  => 0,
	        'max'  => 6,
	    ),
	));

	// Dynamically adding tabs
	$featured_post = absint(get_theme_mod('surgical_hospital_projetcs_number', 6));
	for ( $j = 1; $j <= $featured_post; $j++ ) {
	    $wp_customize->add_setting('surgical_hospital_projetcs_text'.$j, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		));
		$wp_customize->add_control('surgical_hospital_projetcs_text'.$j, array(
		    'label'   => esc_html__('Edit Tab Text ', 'surgical-hospital').$j, 
		    'section' => 'surgical_hospital_projetcs_sec',
		    'type'    => 'text',
		));

	    $categories = get_categories();
	    $cat_posts = array('select' => 'Select');
	    foreach ($categories as $category) {
	        $cat_posts[$category->slug] = $category->name;
	    }

	    $wp_customize->add_setting('surgical_hospital_offer_section_category'.$j, array(
	        'default'           => 'uncategorized',
	        'sanitize_callback' => 'surgical_hospital_sanitize_choices',
	    ));

	    $wp_customize->add_control('surgical_hospital_offer_section_category'.$j, array(
	        'type'    => 'select',
	        'choices' => $cat_posts,
	        'label'   => __('Select Category to display projects', 'surgical-hospital'),
	        'section' => 'surgical_hospital_projetcs_sec',
	    ));

	    // Icon setting
		$wp_customize->add_setting('surgical_hospital_services_icon' . $j, array(
		    'default'           => 'fas fa-user',
		    'sanitize_callback' => 'sanitize_text_field',
		));

		$wp_customize->add_control('surgical_hospital_services_icon' . $j, array(
			/* translators: %s: Counting. */
		    'label'       => sprintf(__('Add Icon for Post %s', 'surgical-hospital'), $j),
		    'section'     => 'surgical_hospital_projetcs_sec',
		    'type'        => 'text',
		    'description' => wp_kses(
		        sprintf(
				/* translators: %s: Counting. */
		            __('Enter a Font Awesome icon class (e.g., <code>fas fa-user</code>). You can find more icons at <a href="%s" target="_blank" rel="noopener noreferrer">Font Awesome Icons</a>.', 'surgical-hospital'),
		            esc_url('https://fontawesome.com/icons')
		        ),
		        array(
		            'a'    => array(
		                'href'   => array(),
		                'target' => array(),
		                'rel'    => array(),
		            ),
		            'code' => array(),
		        )
		    ),
		));
	}

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

	$wp_customize->add_control(
		'surgical_hospital_project_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more project options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(SURGICAL_HOSPITAL_BUY_NOW) ." '>Check Surgical Hospital PRO version.</a>
					</div>
				</div>
			",
			'section' => 'surgical_hospital_projetcs_sec'
		)
	);

	/*
	* Customizer Footer Section
	*/
	/*Footer Options*/
	$wp_customize->add_section('surgical_hospital_footer_section', array(
		'priority'       => 8,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Footer Options', 'surgical-hospital'),
		'panel'       => 'surgical_hospital_panel',
	));
	
	/*Footer Enable Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_footer',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'surgical_hospital_enable_footer',
		array(
			'label'       => __('Enable Footer', 'surgical-hospital'),
			'description' => __('Checked to show Footer', 'surgical-hospital'),
			'section'     => 'surgical_hospital_footer_section',
			'type'        => 'checkbox',
		)
	);

	/*Footer bg image Option*/
	$wp_customize->add_setting('surgical_hospital_footer_bg_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw',
    ));
    $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'surgical_hospital_footer_bg_image',array(
        'label' => __('Footer Background Image','surgical-hospital'),
        'section' => 'surgical_hospital_footer_section',
    )));

	/** Footer bg Image Attachment */
    $wp_customize->add_setting('surgical_hospital_background_attachment', array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'scroll',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
    ));

    $wp_customize->add_control('surgical_hospital_background_attachment', array(
        'label'    => __('Footer Background Attachment', 'surgical-hospital'),
        'section'  => 'surgical_hospital_footer_section',
        'settings' => 'surgical_hospital_background_attachment',
        'type'     => 'select',
        'choices'  => array(
            'fixed' => __('fixed','surgical-hospital'),
            'scroll' => __('scroll','surgical-hospital'),
        ),
    ));

	/*Footer Social Menu Option*/
	$wp_customize->add_setting(
		'surgical_hospital_footer_social_menu',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_footer_social_menu',
		array(
			'label'       => __('Enable Footer Social Menu', 'surgical-hospital'),
			'description' => __('Checked to show the footer social menu. Go to Dashboard >> Appearance >> Menus >> Create New Menu >> Add Custom Link >> Add Social Menu >> Checked Social Menu >> Save Menu.', 'surgical-hospital'),
			'section'     => 'surgical_hospital_footer_section',
			'type'        => 'checkbox',
		)
	);	

	/*Go To Top Option*/
	$wp_customize->add_setting(
		'surgical_hospital_enable_go_to_top_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'surgical_hospital_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_enable_go_to_top_option',
		array(
			'label'       => __('Enable Go To Top', 'surgical-hospital'),
			'description' => __('Checked to enable Go To Top option.', 'surgical-hospital'),
			'section'     => 'surgical_hospital_footer_section',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting('surgical_hospital_go_to_top_position',array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'Right',
        'sanitize_callback' => 'surgical_hospital_sanitize_choices'
    ));
    $wp_customize->add_control('surgical_hospital_go_to_top_position',array(
        'type' => 'select',
        'section' => 'surgical_hospital_footer_section',
        'label' => esc_html__('Go To Top Positions','surgical-hospital'),
        'choices' => array(
            'Right' => __('Right','surgical-hospital'),
            'Left' => __('Left','surgical-hospital'),
            'Center' => __('Center','surgical-hospital')
        ),
    ) );

	/*Footer Copyright Text Enable*/
	$wp_customize->add_setting(
		'surgical_hospital_copyright_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'surgical_hospital_copyright_option',
		array(
			'label'       => __('Edit Copyright Text', 'surgical-hospital'),
			'description' => __('Edit the Footer Copyright Section.', 'surgical-hospital'),
			'section'     => 'surgical_hospital_footer_section',
			'type'        => 'text',
		)
	);

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

	$wp_customize->add_control(
		'surgical_hospital_footer_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more footer options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(SURGICAL_HOSPITAL_BUY_NOW) ." '>Check Surgical Hospital PRO version.</a>
					</div>
				</div>
			",
			'section' => 'surgical_hospital_footer_section'
		)
	);
}
add_action( 'customize_register', 'Surgical_Hospital_Customize_register' );

/**
 * Render the site title for the selective refresh partial.
 *
 * @return void
 */
function Surgical_Hospital_Customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @return void
 */
function Surgical_Hospital_Customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function Surgical_Hospital_Customize_preview_js() {
	wp_enqueue_script( 'surgical-hospital-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), SURGICAL_HOSPITAL_VERSION, true );
}
add_action( 'customize_preview_init', 'Surgical_Hospital_Customize_preview_js' );

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class Surgical_Hospital_Customize {

	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function get_instance() {

		static $surgical_hospital_instance = null;

		if ( is_null( $surgical_hospital_instance ) ) {
			$surgical_hospital_instance = new self;
			$surgical_hospital_instance->setup_actions();
		}

		return $surgical_hospital_instance;
	}

	/**
	 * Constructor method.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function __construct() {}

	/**
	 * Sets up initial actions.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function setup_actions() {

		// Register panels, sections, settings, controls, and partials.
		add_action( 'customize_register', array( $this, 'sections' ) );

		// Register scripts and styles for the controls.
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
	}

	/**
	 * Sets up the customizer sections.
	 *
	 * @since  1.0.0
	 * @access public
	 * @param  object  $surgical_hospital_manager
	 * @return void
	*/
	public function sections( $surgical_hospital_manager ) {
		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/revolution/inc/section-pro.php' );

		// Register custom section types.
		$surgical_hospital_manager->register_section_type( 'Surgical_Hospital_Customize_Section_Pro' );

		// Register sections.
		$surgical_hospital_manager->add_section( new Surgical_Hospital_Customize_Section_Pro( $surgical_hospital_manager,'surgical_hospital_go_pro', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Surgical Hospital Pro', 'surgical-hospital' ),
			'pro_text' => esc_html__( 'Buy Pro', 'surgical-hospital' ),
			'pro_url'    => esc_url( SURGICAL_HOSPITAL_BUY_NOW ),
		) )	);

		// Register sections.
		$surgical_hospital_manager->add_section( new Surgical_Hospital_Customize_Section_Pro( $surgical_hospital_manager,'surgical_hospital_lite_documentation', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Lite Documentation', 'surgical-hospital' ),
			'pro_text' => esc_html__( 'Instruction', 'surgical-hospital' ),
			'pro_url'    => esc_url( SURGICAL_HOSPITAL_LITE_DOC ),
		) )	);

		$surgical_hospital_manager->add_section( new Surgical_Hospital_Customize_Section_Pro( $surgical_hospital_manager, 'surgical_hospital_live_demo', array(
		    'priority'   => 1,
		    'title'      => esc_html__( 'Pro Theme Demo', 'surgical-hospital' ),
		    'pro_text'   => esc_html__( 'Live Preview', 'surgical-hospital' ),
		    'pro_url'    => esc_url( SURGICAL_HOSPITAL_LIVE_DEMO ),
		) ) );	

	}

	/**
	 * Loads theme customizer CSS.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function enqueue_control_scripts() {

		wp_enqueue_script( 'surgical-hospital-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'surgical-hospital-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/css/customize-controls.css' );
	}
}

// Doing this customizer thang!
Surgical_Hospital_Customize::get_instance();