<?php
/**
 * Legal Services Firm Theme Customizer
 *
 * @package Legal Services Firm
 */

function Legal_Services_Firm_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' => 'Legal_Services_Firm_Customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'Legal_Services_Firm_Customize_partial_blogdescription',
			)
		);
	}

	/*
    * Theme Options Panel
    */
	$wp_customize->add_panel('legal_services_firm_panel', array(
		'priority' => 25,
		'capability' => 'edit_theme_options',
		'title' => __('Legal Services Firm Theme Options', 'legal-services-firm'),
	));

	/*
	* Customizer main header section
	*/

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

	$wp_customize->add_control(
		'legal_services_firm_site_title_text',
		array(
			'label'       => __('Enable Title', 'legal-services-firm'),
			'description' => __('Enable or Disable Title from the site', 'legal-services-firm'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_site_tagline_text',
		array(
			'label'       => __('Enable Tagline', 'legal-services-firm'),
			'description' => __('Enable or Disable Tagline from the site', 'legal-services-firm'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_logo_width',
		array(
			'label'       => __('Logo Width in PX', 'legal-services-firm'),
			'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', 'legal-services-firm'),
		'panel'       => 'woocommerce',
	));

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

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

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

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

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

	$wp_customize->add_control(
		'legal_services_firm_enable_related_product',
		array(
			'label'       => __('Enable Related Product', 'legal-services-firm'),
			'description' => __('Checked to show Related Product', 'legal-services-firm'),
			'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', 'legal-services-firm'),
			'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', 'legal-services-firm'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 4,
	             'step' => 1,
	         ),
		)
	);

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

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

	$wp_customize->add_setting('legal_services_firm_woocommerce_product_sale',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
        'default'           => 'Right',
        'sanitize_callback' => 'legal_services_firm_sanitize_choices'
    ));
    $wp_customize->add_control('legal_services_firm_woocommerce_product_sale',array(
        'label'       => esc_html__( 'Woocommerce Product Sale Positions','legal-services-firm' ),
        'type' => 'select',
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'Right' => __('Right','legal-services-firm'),
            'Left' => __('Left','legal-services-firm'),
            'Center' => __('Center','legal-services-firm')
        ),
    ) );

	/*Additional Options*/
	$wp_customize->add_section('legal_services_firm_additional_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Additional Options', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));

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

	$wp_customize->add_control(
		'legal_services_firm_enable_sticky_header',
		array(
			'label'       => __('Enable Sticky Header', 'legal-services-firm'),
			'description' => __('Checked to enable sticky header', 'legal-services-firm'),
			'section'     => 'legal_services_firm_additional_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_enable_preloader',
		array(
			'label'       => __('Enable Preloader', 'legal-services-firm'),
			'description' => __('Checked to show preloader', 'legal-services-firm'),
			'section'     => 'legal_services_firm_additional_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_enable_breadcrumbs',
		array(
			'label'       => __('Enable Breadcrumbs', 'legal-services-firm'),
			'description' => __('Checked to show Breadcrumbs', 'legal-services-firm'),
			'section'     => 'legal_services_firm_additional_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_enable_pagination',
		array(
			'label'       => __('Enable Pagination', 'legal-services-firm'),
			'description' => __('Checked to show Pagination', 'legal-services-firm'),
			'section'     => 'legal_services_firm_additional_section',
			'type'        => 'checkbox',
		)
	);

		/*Pagination Select Type Option*/
	$wp_customize->add_setting('legal_services_firm_pagination_type',array(
        'default' => 'type-1',
        'sanitize_callback' => 'legal_services_firm_sanitize_choices'
	));
	$wp_customize->add_control('legal_services_firm_pagination_type',array(
        'type' => 'select',
        'label' => esc_html__('Select Pagination Type','legal-services-firm'),
        'section' => 'legal_services_firm_additional_section',
        'choices' => array(
            'type-1' => esc_html__('Type 1','legal-services-firm'),
            'type-2' => esc_html__('Type 2','legal-services-firm'),
        ),
	) );

	/*Post layout*/
	$wp_customize->add_setting('legal_services_firm_archive_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'legal_services_firm_sanitize_choices'
	));
	$wp_customize->add_control('legal_services_firm_archive_layout',array(
        'type' => 'select',
        'label' => esc_html__('Posts Layout','legal-services-firm'),
        'section' => 'legal_services_firm_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','legal-services-firm'),
            'layout-2' => esc_html__('Sidebar On Left','legal-services-firm'),
			'layout-3' => esc_html__('Full Width Layout','legal-services-firm')
        ),
	) );

	/*single post layout*/
	$wp_customize->add_setting('legal_services_firm_post_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'legal_services_firm_sanitize_choices'
	));
	$wp_customize->add_control('legal_services_firm_post_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Post Layout','legal-services-firm'),
        'section' => 'legal_services_firm_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','legal-services-firm'),
            'layout-2' => esc_html__('Sidebar On Left','legal-services-firm'),
			'layout-3' => esc_html__('Full Width Layout','legal-services-firm')
        ),
	) );

	/*single page layout*/
	$wp_customize->add_setting('legal_services_firm_page_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'legal_services_firm_sanitize_choices'
	));
	$wp_customize->add_control('legal_services_firm_page_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Page Layout','legal-services-firm'),
        'section' => 'legal_services_firm_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','legal-services-firm'),
            'layout-2' => esc_html__('Sidebar On Left','legal-services-firm'),
			'layout-3' => esc_html__('Full Width Layout','legal-services-firm')
        ),
	) );

	/*Archive Post Options*/
	$wp_customize->add_section('legal_services_firm_blog_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Blog Page Options', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));

	$wp_customize->add_setting('legal_services_firm_enable_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_blog_post_title',array(
		'label'       => __('Enable Blog Post Title', 'legal-services-firm'),
		'description' => __('Checked To Show Blog Post Title', 'legal-services-firm'),
		'section'     => 'legal_services_firm_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_blog_post_meta',array(
		'label'       => __('Enable Blog Post Meta', 'legal-services-firm'),
		'description' => __('Checked To Show Blog Post Meta Feilds', 'legal-services-firm'),
		'section'     => 'legal_services_firm_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_blog_post_tags',array(
		'label'       => __('Enable Blog Post Tags', 'legal-services-firm'),
		'description' => __('Checked To Show Blog Post Tags', 'legal-services-firm'),
		'section'     => 'legal_services_firm_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_blog_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_blog_post_image',array(
		'label'       => __('Enable Blog Post Image', 'legal-services-firm'),
		'description' => __('Checked To Show Blog Post Image', 'legal-services-firm'),
		'section'     => 'legal_services_firm_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_blog_post_content',array(
		'label'       => __('Enable Blog Post Content', 'legal-services-firm'),
		'description' => __('Checked To Show Blog Post Content', 'legal-services-firm'),
		'section'     => 'legal_services_firm_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_blog_post_button',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_blog_post_button',array(
		'label'       => __('Enable Blog Post Read More Button', 'legal-services-firm'),
		'description' => __('Checked To Show Blog Post Read More Button', 'legal-services-firm'),
		'section'     => 'legal_services_firm_blog_post_section',
		'type'        => 'checkbox',
	));

	/*Blog post Content layout*/
	$wp_customize->add_setting('legal_services_firm_blog_Post_content_layout',array(
        'default' => 'Left',
        'sanitize_callback' => 'legal_services_firm_sanitize_choices'
	));
	$wp_customize->add_control('legal_services_firm_blog_Post_content_layout',array(
        'type' => 'select',
        'label' => esc_html__('Blog Post Content Layout','legal-services-firm'),
        'section' => 'legal_services_firm_blog_post_section',
        'choices' => array(
            'Left' => esc_html__('Left','legal-services-firm'),
            'Center' => esc_html__('Center','legal-services-firm'),
            'Right' => esc_html__('Right','legal-services-firm')
        ),
	) );

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

	$wp_customize->add_control(
		'legal_services_firm_excerpt_limit',
		array(
			'label'       => __('Excerpt Limit', 'legal-services-firm'),
			'section'     => 'legal_services_firm_blog_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 2,
	             'max' => 50,
	             'step' => 2,
	         ),
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_read_more_text',
		array(
			'label'       => __('Edit Button Text ', 'legal-services-firm'),
			'section'     => 'legal_services_firm_blog_post_section',
			'type'        => 'text',
		)
	);

	/*Single Post Options*/
	$wp_customize->add_section('legal_services_firm_single_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Single Post Options', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));

	$wp_customize->add_setting('legal_services_firm_enable_single_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_single_blog_post_title',array(
		'label'       => __('Enable Single Post Title', 'legal-services-firm'),
		'description' => __('Checked To Show Single Blog Post Title', 'legal-services-firm'),
		'section'     => 'legal_services_firm_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_single_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_single_blog_post_meta',array(
		'label'       => __('Enable Single Post Meta', 'legal-services-firm'),
		'description' => __('Checked To Show Single Blog Post Meta Feilds', 'legal-services-firm'),
		'section'     => 'legal_services_firm_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_single_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_single_blog_post_tags',array(
		'label'       => __('Enable Single Post Tags', 'legal-services-firm'),
		'description' => __('Checked To Show Single Blog Post Tags', 'legal-services-firm'),
		'section'     => 'legal_services_firm_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_single_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_single_post_image',array(
		'label'       => __('Enable Single Post Image', 'legal-services-firm'),
		'description' => __('Checked To Show Single Post Image', 'legal-services-firm'),
		'section'     => 'legal_services_firm_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('legal_services_firm_enable_single_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('legal_services_firm_enable_single_blog_post_content',array(
		'label'       => __('Enable Single Post Content', 'legal-services-firm'),
		'description' => __('Checked To Show Single Blog Post Content', 'legal-services-firm'),
		'section'     => 'legal_services_firm_single_post_section',
		'type'        => 'checkbox',
	));

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

	$wp_customize->add_control(
		'legal_services_firm_enable_related_post',
		array(
			'label'       => __('Enable Related Post', 'legal-services-firm'),
			'description' => __('Checked to show Related Post', 'legal-services-firm'),
			'section'     => 'legal_services_firm_single_post_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_related_post_text',
		array(
			'label'       => __('Edit Related Post Text ', 'legal-services-firm'),
			'section'     => 'legal_services_firm_single_post_section',
			'type'        => 'text',
		)
	);	

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

	$wp_customize->add_control(
		'legal_services_firm_related_post_count',
		array(
			'label'       => __('Related Post Count', 'legal-services-firm'),
			'section'     => 'legal_services_firm_single_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 9,
	             'step' => 1,
	         ),
		)
	);

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

	$wp_customize->add_control(
		'legal_services_firm_enable_comment_section',
		array(
			'label'       => __('Enable Comment Section', 'legal-services-firm'),
			'description' => __('Checked to show Comment Section', 'legal-services-firm'),
			'section'     => 'legal_services_firm_single_post_section',
			'type'        => 'checkbox',
		)
	);

	/*
	* Customizer Global COlor
	*/

	/*Global Color Options*/
	$wp_customize->add_section('legal_services_firm_global_color_section', array(
		'priority'       => 1,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Global Color Options', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));

	$wp_customize->add_setting( 'legal_services_firm_primary_color',
		array(
		'default'           => '#CE8E3B',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control( 
		new WP_Customize_Color_Control( 
		$wp_customize, 
		'legal_services_firm_primary_color',
		array(
			'label'      => esc_html__( 'Primary Color', 'legal-services-firm' ),
			'section'    => 'legal_services_firm_global_color_section',
			'settings'   => 'legal_services_firm_primary_color',
		) ) 
	);

	$wp_customize->add_setting( 'legal_services_firm_secondary_color',
		array(
		'default'           => '#E08D21',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control( 
		new WP_Customize_Color_Control( 
		$wp_customize, 
		'legal_services_firm_secondary_color',
		array(
			'label'      => esc_html__( 'Secondary Color', 'legal-services-firm' ),
			'section'    => 'legal_services_firm_global_color_section',
			'settings'   => 'legal_services_firm_secondary_color',
		) ) 
	);

	/*Typography Options*/
	$wp_customize->add_section( 'legal_services_firm_typography_section', array(
		'panel'       => 'legal_services_firm_panel',
        'title'    => __( 'Typography Options', 'legal-services-firm' ),
        'priority' => 2,
    ) );

    $wp_customize->add_setting( 'legal_services_firm_font_family', array(
		'default'           => 'default',
		'sanitize_callback' => 'legal_services_firm_sanitize_font_family',
	) );
	
	$wp_customize->add_control( 'legal_services_firm_font_family', array(
		'label'    => __( 'Global Font Family', 'legal-services-firm' ),
		'section'  => 'legal_services_firm_typography_section',
		'type'     => 'select',
		'choices'  => array(
			'default'          => __( 'Default (Theme Font)', 'legal-services-firm' ),
			'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('legal_services_firm_header_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Header Options', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));

	$wp_customize->add_setting(
		'legal_services_firm_header_search',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => true,
			'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_header_search',
		array(
			'label'       => __('Enable Disable Search', 'legal-services-firm'),
			'description' => __('Enable or Disable header Search', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'checkbox',
		)
	);

	/*Main Header Phone Text*/
	$wp_customize->add_setting(
		'legal_services_firm_header_info_phone',
		array(
			'default'           => '+00 123 456 7890',
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'legal_services_firm_sanitize_phone_number',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_header_info_phone',
		array(
			'label'       => __('Edit Phone Number ', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'text',
		)
	);

	/*Main Header Phone Text*/
	$wp_customize->add_setting(
		'legal_services_firm_header_info_email',
		array(
			'default'           => 'lawyer1245@example.com',
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_email',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_header_info_email',
		array(
			'label'       => __('Edit Email Address ', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'text',
		)
	);

	$wp_customize->add_setting('legal_services_firm_location',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('legal_services_firm_location',array(
		'label'	=> __('Add location','legal-services-firm'),
		'section'=> 'legal_services_firm_header_section',
		'type'=> 'text'
	));

	/*Facebook Link*/
	$wp_customize->add_setting(
		'legal_services_firm_facebook_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_facebook_link_option',
		array(
			'label'       => __('Edit Facebook Link', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'url',
		)
	);

	/*Twitter Link*/
	$wp_customize->add_setting(
		'legal_services_firm_twitter_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'legal_services_firm_twitter_link_option',
		array(
			'label'       => __('Edit Twitter Link', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'legal_services_firm_youtube_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_youtube_link_option',
		array(
			'label'       => __('Edit Youtube Link', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'url',
		)
	);

	/*Instagram Link*/
	$wp_customize->add_setting(
		'legal_services_firm_instagram_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_instagram_link_option',
		array(
			'label'       => __('Edit Instagram Link', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'legal_services_firm_linked_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_linked_link_option',
		array(
			'label'       => __('Edit Linkedin Link', 'legal-services-firm'),
			'section'     => 'legal_services_firm_header_section',
			'type'        => 'url',
		)
	);

	/*
	* Customizer main slider section
	*/
	/*Main Slider Options*/
	$wp_customize->add_section('legal_services_firm_slider_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Slider Options', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));

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

	$wp_customize->add_control(
		'legal_services_firm_enable_slider',
		array(
			'label'       => __('Enable Main Slider', 'legal-services-firm'),
			'description' => __('Checked to show the main slider', 'legal-services-firm'),
			'section'     => 'legal_services_firm_slider_section',
			'type'        => 'checkbox',
		)
	);

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

		/*Main Slider Image*/
		$wp_customize->add_setting(
			'legal_services_firm_slider_image'.$legal_services_firm_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, 
				'legal_services_firm_slider_image'.$legal_services_firm_i, 
				array(
			        'label' => __('Edit Slider Image ', 'legal-services-firm') .$legal_services_firm_i,
			        'description' => __('Edit the slider image.', 'legal-services-firm'),
			        'section' => 'legal_services_firm_slider_section',
				)
			)
		);

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

		$wp_customize->add_control(
			'legal_services_firm_slider_top_text'.$legal_services_firm_i,
			array(
				'label'       => __('Edit Slider Top Text ', 'legal-services-firm') .$legal_services_firm_i,
				'description' => __('Edit the slider Top text.', 'legal-services-firm'),
				'section'     => 'legal_services_firm_slider_section',
				'type'        => 'text',
			)
		);

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

		$wp_customize->add_control(
			'legal_services_firm_slider_heading'.$legal_services_firm_i,
			array(
				'label'       => __('Edit Heading Text ', 'legal-services-firm') .$legal_services_firm_i,
				'description' => __('Edit the slider heading text.', 'legal-services-firm'),
				'section'     => 'legal_services_firm_slider_section',
				'type'        => 'text',
			)
		);

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

		$wp_customize->add_control(
			'legal_services_firm_slider_text'.$legal_services_firm_i,
			array(
				'label'       => __('Edit Content Text ', 'legal-services-firm') .$legal_services_firm_i,
				'description' => __('Edit the slider content text.', 'legal-services-firm'),
				'section'     => 'legal_services_firm_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 Text*/
		$wp_customize->add_setting(
			'legal_services_firm_slider_button1_text'.$legal_services_firm_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);
		$wp_customize->add_control(
			'legal_services_firm_slider_button1_text'.$legal_services_firm_i,
			array(
				'label'       => __('Edit Button #1 Text ', 'legal-services-firm') .$legal_services_firm_i,
				'description' => __('Edit the slider button text.', 'legal-services-firm'),
				'section'     => 'legal_services_firm_slider_section',
				'type'        => 'text',
			)
		);

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

		$wp_customize->add_control(
			'legal_services_firm_slider_button1_link'.$legal_services_firm_i,
			array(
				'label'       => __('Edit Button #1 URL ', 'legal-services-firm') .$legal_services_firm_i,
				'description' => __('Edit the slider button url.', 'legal-services-firm'),
				'section'     => 'legal_services_firm_slider_section',
				'type'        => 'url',
			)
		);

		/*Main Slider Button2 Text*/
		$wp_customize->add_setting(
			'legal_services_firm_slider_button2_text'.$legal_services_firm_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);
		$wp_customize->add_control(
			'legal_services_firm_slider_button2_text'.$legal_services_firm_i,
			array(
				'label'       => __('Edit Button #2 Text ', 'legal-services-firm') .$legal_services_firm_i,
				'description' => __('Edit the slider button text.', 'legal-services-firm'),
				'section'     => 'legal_services_firm_slider_section',
				'type'        => 'text',
			)
		);

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

		$wp_customize->add_control(
			'legal_services_firm_slider_button2_link'.$legal_services_firm_i,
			array(
				'label'       => __('Edit Button #2 URL ', 'legal-services-firm') .$legal_services_firm_i,
				'description' => __('Edit the slider button url.', 'legal-services-firm'),
				'section'     => 'legal_services_firm_slider_section',
				'type'        => 'url',
			)
		);
	}

	/*
	* Customizer project section
	*/
	/*Our Lawyer Options*/
	$wp_customize->add_section('legal_services_firm_lawyer_team_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Our Best Lawyer Section', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));

	/*Our Lawyer Enable Option*/
	$wp_customize->add_setting(
		'legal_services_firm_enable_project',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_enable_project',
		array(
			'label'       => __('Enable Our Lawyer Section', 'legal-services-firm'),
			'description' => __('Checked to show the Section', 'legal-services-firm'),
			'section'     => 'legal_services_firm_lawyer_team_section',
			'type'        => 'checkbox',
		)
	);

	/*Main Short Heading*/
	$wp_customize->add_setting(
		'legal_services_firm_project_short_heading',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_project_short_heading',
		array(
			'label'       => __('Edit Main Short Section Heading ', 'legal-services-firm'),
			'description' => __('Edit the Short Heading.', 'legal-services-firm'),
			'section'     => 'legal_services_firm_lawyer_team_section',
			'type'        => 'text',
		)
	);

	/*Main Heading*/
	$wp_customize->add_setting(
		'legal_services_firm_project_heading',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_project_heading',
		array(
			'label'       => __('Edit Main Section Heading ', 'legal-services-firm'),
			'description' => __('Edit the main section title.', 'legal-services-firm'),
			'section'     => 'legal_services_firm_lawyer_team_section',
			'type'        => 'text',
		)
	);

	for ( $legal_services_firm_i = 1; $legal_services_firm_i <= 4; $legal_services_firm_i++ ) {

        // === Tab Lawyer Image ===
        $wp_customize->add_setting('legal_services_firm_add_team_lawyer_image' . $legal_services_firm_i, array(
            'default' => '',
            'sanitize_callback' => 'esc_url_raw'
        ));
        $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'legal_services_firm_add_team_lawyer_image' . $legal_services_firm_i,array(
            'label'    => __('Add Lawyer Image ', 'legal-services-firm') . $legal_services_firm_i,
            'section'  => 'legal_services_firm_lawyer_team_section',
        )));

       // === lawyer name ===
		$wp_customize->add_setting( 'legal_services_firm_add_lawyer_name' . $legal_services_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		) );
		$wp_customize->add_control( 'legal_services_firm_add_lawyer_name' . $legal_services_firm_i, array(
		    'label'    => __( 'Add Lawyer Name ', 'legal-services-firm' ) . $legal_services_firm_i,
		    'section'  => 'legal_services_firm_lawyer_team_section',
		    'settings' => 'legal_services_firm_add_lawyer_name' . $legal_services_firm_i,
		    'type'     => 'text',
		));

		$wp_customize->add_setting( 'legal_services_firm_add_lawyer_designation' . $legal_services_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		) );
		$wp_customize->add_control( 'legal_services_firm_add_lawyer_designation' . $legal_services_firm_i, array(
		    'label'    => __( 'Add Designation ', 'legal-services-firm' ) . $legal_services_firm_i,
		    'section'  => 'legal_services_firm_lawyer_team_section',
		    'settings' => 'legal_services_firm_add_lawyer_designation' . $legal_services_firm_i,
		    'type'     => 'text',
		 ));

		$wp_customize->add_setting( 'legal_services_firm_add_lawyer_details' . $legal_services_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		) );
		$wp_customize->add_control( 'legal_services_firm_add_lawyer_details' . $legal_services_firm_i, array(
		    'label'    => __( 'Add Details ', 'legal-services-firm' ) . $legal_services_firm_i,
		    'section'  => 'legal_services_firm_lawyer_team_section',
		    'settings' => 'legal_services_firm_add_lawyer_details' . $legal_services_firm_i,
		    'type'     => 'text',
		 ));

        // === Phone ===
        $wp_customize->add_setting( 'legal_services_firm_lawyer_contact_phone' . $legal_services_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'legal_services_firm_sanitize_phone_number',
		) );
		$wp_customize->add_control( 'legal_services_firm_lawyer_contact_phone' . $legal_services_firm_i, array(
		    'label'    => __( 'Add Phone Number ', 'legal-services-firm' ) . $legal_services_firm_i,
		    'section'  => 'legal_services_firm_lawyer_team_section',
		    'settings' => 'legal_services_firm_lawyer_contact_phone' . $legal_services_firm_i,
		    'type'     => 'text',
		) );

        // === Email ==//
        $wp_customize->add_setting( 'legal_services_firm_lawyer_contact_email' . $legal_services_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_email',
		) );

		$wp_customize->add_control( 'legal_services_firm_lawyer_contact_email' . $legal_services_firm_i, array(
		    'label'    => __( 'Add Email Tab ', 'legal-services-firm' ) . $legal_services_firm_i,
		    'section'  => 'legal_services_firm_lawyer_team_section',
		    'settings' => 'legal_services_firm_lawyer_contact_email' . $legal_services_firm_i,
		    'type'     => 'email',
		) );


       // === Case Solve Percentage ===
		$wp_customize->add_setting( 'legal_services_firm_case_solve_percentage' . $legal_services_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'absint',
		) );
		$wp_customize->add_control( 'legal_services_firm_case_solve_percentage' . $legal_services_firm_i, array(
		    'label'    => __( 'Add Case Solve Percentage ', 'legal-services-firm' ) . $legal_services_firm_i,
		    'section'     => 'legal_services_firm_lawyer_team_section',
		    'settings'    => 'legal_services_firm_case_solve_percentage' . $legal_services_firm_i,
		    'type'        => 'number',
		    'input_attrs' => array(
		        'min' => 0,
		        'max' => 100,
		    ),
		) );

        // === Book Appointment Button Text ===
		$wp_customize->add_setting( 'legal_services_firm_book_appointement_btn_text' . $legal_services_firm_i, array(
		    'default' => __( 'Book An Appointment', 'legal-services-firm' ),
		    'sanitize_callback' => 'sanitize_text_field',
		) );
		$wp_customize->add_control( 'legal_services_firm_book_appointement_btn_text' . $legal_services_firm_i, array(
		    'label'    => __( 'Add Button Text ', 'legal-services-firm' ) . $legal_services_firm_i,
		    'section'  => 'legal_services_firm_lawyer_team_section',
		    'settings' => 'legal_services_firm_book_appointement_btn_text' . $legal_services_firm_i,
		    'type'     => 'text',
		) );

		// === Book Appointment Button Link ===
		$wp_customize->add_setting( 'legal_services_firm_book_appointement_btn_link' . $legal_services_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'esc_url_raw',
		) );
		$wp_customize->add_control( 'legal_services_firm_book_appointement_btn_link' . $legal_services_firm_i, array(
		    'label'    => __( "Add Button Link ", 'legal-services-firm'). $legal_services_firm_i,
		    'section'  => 'legal_services_firm_lawyer_team_section',
		    'settings' => 'legal_services_firm_book_appointement_btn_link' . $legal_services_firm_i,
		    'type'     => 'url',
		) );

		// social media
		$wp_customize->add_setting('legal_services_firm_serv_facebook_url' . $legal_services_firm_i, array(
            'default' => '',
            'sanitize_callback' => 'esc_url_raw'
        ));
        $wp_customize->add_control('legal_services_firm_serv_facebook_url' . $legal_services_firm_i, array(
            'label'    => __('Add Facebook Link ', 'legal-services-firm') . $legal_services_firm_i,
            'section'  => 'legal_services_firm_lawyer_team_section',
            'type'     => 'text',
        ));

        $wp_customize->add_setting('legal_services_firm_serv_twitter_url' . $legal_services_firm_i, array(
            'default' => '',
            'sanitize_callback' => 'esc_url_raw'
        ));
        $wp_customize->add_control('legal_services_firm_serv_twitter_url' . $legal_services_firm_i, array(
            'label'    => __('Add Twitter Link ', 'legal-services-firm') . $legal_services_firm_i,
            'section'  => 'legal_services_firm_lawyer_team_section',
            'type'     => 'text',
        ));

        $wp_customize->add_setting('legal_services_firm_serv_youtube_url' . $legal_services_firm_i, array(
            'default' => '',
            'sanitize_callback' => 'esc_url_raw'
        ));
        $wp_customize->add_control('legal_services_firm_serv_youtube_url' . $legal_services_firm_i, array(
            'label'    => __('Add Youtube Link ', 'legal-services-firm') . $legal_services_firm_i,
            'section'  => 'legal_services_firm_lawyer_team_section',
            'type'     => 'text',
        ));

        $wp_customize->add_setting('legal_services_firm_serv_insta_url' . $legal_services_firm_i, array(
            'default' => '',
            'sanitize_callback' => 'esc_url_raw'
        ));
        $wp_customize->add_control('legal_services_firm_serv_insta_url' . $legal_services_firm_i, array(
            'label'    => __('Add Instagram Link ', 'legal-services-firm') . $legal_services_firm_i,
            'section'  => 'legal_services_firm_lawyer_team_section',
            'type'     => 'text',
        ));

        $wp_customize->add_setting('legal_services_firm_serv_linkedin_url' . $legal_services_firm_i, array(
            'default' => '',
            'sanitize_callback' => 'esc_url_raw'
        ));
        $wp_customize->add_control('legal_services_firm_serv_linkedin_url' . $legal_services_firm_i, array(
            'label'    => __('Add Linkedin Link ', 'legal-services-firm') . $legal_services_firm_i,
            'section'  => 'legal_services_firm_lawyer_team_section',
            'type'     => 'text',
        ));

    }

	/*
	* Customizer Footer Section
	*/
	/*Footer Options*/
	$wp_customize->add_section('legal_services_firm_footer_section', array(
		'priority'       => 8,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Footer Options', 'legal-services-firm'),
		'panel'       => 'legal_services_firm_panel',
	));
	
	/*Footer Enable Option*/
	$wp_customize->add_setting(
		'legal_services_firm_enable_footer',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'legal_services_firm_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'legal_services_firm_enable_footer',
		array(
			'label'       => __('Enable Footer', 'legal-services-firm'),
			'description' => __('Checked to show Footer', 'legal-services-firm'),
			'section'     => 'legal_services_firm_footer_section',
			'type'        => 'checkbox',
		)
	);

	/*Footer bg image Option*/
	$wp_customize->add_setting('legal_services_firm_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,'legal_services_firm_footer_bg_image',array(
        'label' => __('Footer Background Image','legal-services-firm'),
        'section' => 'legal_services_firm_footer_section',
        'priority' => 1,
    )));


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

	$wp_customize->add_control(
		'legal_services_firm_footer_social_menu',
		array(
			'label'       => __('Enable Footer Social Menu', 'legal-services-firm'),
			'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.', 'legal-services-firm'),
			'section'     => 'legal_services_firm_footer_section',
			'type'        => 'checkbox',
		)
	);	

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

	$wp_customize->add_control(
		'legal_services_firm_enable_go_to_top_option',
		array(
			'label'       => __('Enable Go To Top', 'legal-services-firm'),
			'description' => __('Checked to enable Go To Top option.', 'legal-services-firm'),
			'section'     => 'legal_services_firm_footer_section',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting('legal_services_firm_go_to_top_position',array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'Right',
        'sanitize_callback' => 'legal_services_firm_sanitize_choices'
    ));
    $wp_customize->add_control('legal_services_firm_go_to_top_position',array(
        'type' => 'select',
        'section' => 'legal_services_firm_footer_section',
        'label' => esc_html__('Go To Top Positions','legal-services-firm'),
        'choices' => array(
            'Right' => __('Right','legal-services-firm'),
            'Left' => __('Left','legal-services-firm'),
            'Center' => __('Center','legal-services-firm')
        ),
    ) );

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

	$wp_customize->add_control(
		'legal_services_firm_copyright_option',
		array(
			'label'       => __('Edit Copyright Text', 'legal-services-firm'),
			'description' => __('Edit the Footer Copyright Section.', 'legal-services-firm'),
			'section'     => 'legal_services_firm_footer_section',
			'type'        => 'text',
		)
	);
}
add_action( 'customize_register', 'Legal_Services_Firm_Customize_register' );

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

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

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function Legal_Services_Firm_Customize_preview_js() {
	wp_enqueue_script( 'legal-services-firm-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), LEGAL_SERVICES_FIRM_VERSION, true );
}
add_action( 'customize_preview_init', 'Legal_Services_Firm_Customize_preview_js' );

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

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

		static $legal_services_firm_instance = null;

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

		return $legal_services_firm_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  $legal_services_firm_manager
	 * @return void
	*/
	public function sections( $legal_services_firm_manager ) {
		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/revolution/inc/section-pro.php' );

		// Register custom section types.
		$legal_services_firm_manager->register_section_type( 'Legal_Services_Firm_Customize_Section_Pro' );

		// Register sections.
		$legal_services_firm_manager->add_section( new Legal_Services_Firm_Customize_Section_Pro( $legal_services_firm_manager,'legal_services_firm_go_pro', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Legal Services Firm Pro', 'legal-services-firm' ),
			'pro_text' => esc_html__( 'Buy Pro', 'legal-services-firm' ),
			'pro_url'    => esc_url( LEGAL_SERVICES_FIRM_BUY_NOW ),
		) )	);

		// Register sections.
		$legal_services_firm_manager->add_section( new Legal_Services_Firm_Customize_Section_Pro( $legal_services_firm_manager,'legal_services_firm_lite_documentation', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Lite Documentation', 'legal-services-firm' ),
			'pro_text' => esc_html__( 'Instruction', 'legal-services-firm' ),
			'pro_url'    => esc_url( LEGAL_SERVICES_FIRM_LITE_DOC ),
		) )	);

		$legal_services_firm_manager->add_section( new Legal_Services_Firm_Customize_Section_Pro( $legal_services_firm_manager, 'legal_services_firm_live_demo', array(
		    'priority'   => 1,
		    'title'      => esc_html__( 'Pro Theme Demo', 'legal-services-firm' ),
		    'pro_text'   => esc_html__( 'Live Preview', 'legal-services-firm' ),
		    'pro_url'    => esc_url( LEGAL_SERVICES_FIRM_LIVE_DEMO ),
		) ) );	
	}

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

		wp_enqueue_script( 'legal-services-firm-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'legal-services-firm-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/css/customize-controls.css' );
	}
}

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