<?php
/**
 * Pixel Transport Theme Customizer
 *
 * @package Pixel Transport
 */

// Customize Controls.
require get_template_directory() . '/inc/custom-settings-control/customize-controls.php';

// Customize Controls.
require get_template_directory() . '/inc/custom-range-controls.php';

// Sanitization For Customize Controls.
require get_template_directory() . '/inc/custom-settings-control/sanitization.php'; 

/**
 * Provide postMessage support for the Theme Customizer's site title and description.
 */
function pixel_transport_customize_register( $wp_customize ) {

	// General Settings Panel.
    $wp_customize->add_panel( 'pixel_transport_general_settings_panel',
        array(
            'title'      => esc_html__( 'General Settings', 'pixel-transport' ),
            'priority'   => 2,
            'capability' => 'edit_theme_options',
        )
    );

	// Header Settings Panel.
	$wp_customize->add_panel( 'pixel_transport_header_settings_panel',
		array(
			'title'      => esc_html__( 'Header Settings', 'pixel-transport' ),
			'priority'   => 2,
			'capability' => 'edit_theme_options',
		)
	);

	// Frontpage Sections Settings Panel.
	$wp_customize->add_panel( 'pixel_transport_frontpage_sections_settings_panel',
		array(
			'title'      => esc_html__( 'Frontpage Sections Settings', 'pixel-transport' ),
			'priority'   => 3,
			'capability' => 'edit_theme_options',
		)
	);

	// Footer Settings Panel.
	$wp_customize->add_panel( 'pixel_transport_footer_settings_panel',
		array(
			'title'      => esc_html__( 'Footer Settings', 'pixel-transport' ),
			'priority'   => 3,
			'capability' => 'edit_theme_options',
		)
	);

	// Site Identity

	$wp_customize->get_section( 'title_tagline' )->panel = 'pixel_transport_header_settings_panel';

	$wp_customize->add_setting(
		'pixel_transport_site_logo',
		array(
			'default'           => false,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new pixel_transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_site_logo',
			array(
				'label'    => esc_html__( 'ON / OFF Site Logo', 'pixel-transport' ),
				'section'  => 'title_tagline',
				'settings' => 'pixel_transport_site_logo',
			)
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_site_title_text',
		array(
			'default'           => true,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new pixel_transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_site_title_text',
			array(
				'label'    => esc_html__( 'ON / OFF Site Title', 'pixel-transport' ),
				'section'  => 'title_tagline',
				'settings' => 'pixel_transport_site_title_text',
			)
		)
	);

$wp_customize->add_setting(
        'pixel_transport_title_font_size',
        array(
            'default'    => 25,
            'sanitize_callback' => 'pixel_transport_sanitize_number_range',
        )
    );

    $wp_customize->add_control(
        new pixel_transport_Slider(
            $wp_customize,
            'pixel_transport_title_font_size',
            array(
                'label'    => esc_html__( 'Site Title Font Size', 'pixel-transport' ),
                'section'  => 'title_tagline',
                'label' => esc_html__('Site Title Font Size', 'pixel-transport'),
                'input_attrs' => array(
					'reset'			   => 25,
		            'step'             => 1,
					'min'              => 0,
					'max'              => 50,
		        ),
            )
        )
    );


	$wp_customize->add_setting(
		'pixel_transport_site_tagline_text',
		array(
			'default'           => false,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new pixel_transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_site_tagline_text',
			array(
				'label'    => esc_html__( 'ON / OFF Site Tagline', 'pixel-transport' ),
				'section'  => 'title_tagline',
				'settings' => 'pixel_transport_site_tagline_text',
			)
		)
	);

	$wp_customize->add_setting(
        'pixel_transport_site_tagline_font_size',
        array(
            'default'    => 15,
            'sanitize_callback' => 'pixel_transport_sanitize_number_range',
        )
    );

    $wp_customize->add_control(
        new pixel_transport_Slider(
            $wp_customize,
            'pixel_transport_site_tagline_font_size',
            array(
                'label'    => esc_html__( 'Tagline Font Size', 'pixel-transport' ),
                'section'  => 'title_tagline',
                'label' => esc_html__('Tagline Font Size', 'pixel-transport'),
                'input_attrs' => array(
					'reset'			   => 15,
		            'step'             => 1,
					'min'              => 0,
					'max'              => 50,
		        ),
            )
        )
    );

	//Woo Coomerce
    $wp_customize->add_setting('pixel_transport_per_columns',array(
        'default'=> 3,
        'sanitize_callback' => 'pixel_transport_sanitize_number_absint'
    ));
    $wp_customize->add_control('pixel_transport_per_columns',array(
        'label' => __('Product Per Row','pixel-transport'),
        'section'=> 'woocommerce_product_catalog',
        'type'=> 'number',
        'input_attrs' => array(
            'min' => 1,
            'max' => 6,
            'step' => 1,
        ),
    ));
    $wp_customize->add_setting('pixel_transport_product_per_page',array(
        'default'=> 10,
        'sanitize_callback' => 'pixel_transport_sanitize_number_absint'
    ));
    $wp_customize->add_control('pixel_transport_product_per_page',array(
        'label' => __('Product Per Page','pixel-transport'),
        'section'=> 'woocommerce_product_catalog',
        'type'=> 'number',
        'input_attrs' => array(
            'min' => 1,
            'max' => 20,
            'step' => 1,
        ),
    ));

    $wp_customize->add_section(
		'woocommerce_product_extra_section',
		array(
			'panel'      => 'woocommerce',
			'title'    => esc_html__( 'Extra WooCommerce Settings', 'pixel-transport' ),
		)
	);

    $wp_customize->add_setting( 'pixel_transport_single_product_sidebar', array(
		'default'           => true,
		'transport'         => 'refresh',
		'sanitize_callback' => 'pixel_transport_sanitize_checkbox',
	) );
	$wp_customize->add_control( new pixel_transport_On_Off_Custom_Control( $wp_customize, 'pixel_transport_single_product_sidebar', array(
		'label'       => esc_html__( 'Show / Hide Product Page Sidebar', 'pixel-transport' ),
		'section'     => 'woocommerce_product_extra_section',
		'type'        => 'toggle',
		'settings'    => 'pixel_transport_single_product_sidebar',
	) ) );
    
	// Header Options

	$wp_customize->add_section(
		'pixel_transport_header_section',
		array(
			'panel'      => 'pixel_transport_header_settings_panel',
			'title'    => esc_html__( 'Header Options', 'pixel-transport' ),
		)
	);

	//MENU TYPOGRAPHY
	
	$wp_customize->add_setting('pixel_transport_menu_font_weight',array(
        'default' => '',
        'sanitize_callback' => 'pixel_transport_sanitize_choices'
	));
	$wp_customize->add_control('pixel_transport_menu_font_weight',array(
     'type' => 'radio',
     'label'     => __('Menu Font Weight', 'pixel-transport'),
     'section' => 'pixel_transport_header_section',
     'type' => 'select',
     'choices' => array(
         '100' => __('100','pixel-transport'),
         '200' => __('200','pixel-transport'),
         '300' => __('300','pixel-transport'),
         '400' => __('400','pixel-transport'),
         '500' => __('500','pixel-transport'),
         '600' => __('600','pixel-transport'),
         '700' => __('700','pixel-transport'),
         '800' => __('800','pixel-transport'),
         '900' => __('900','pixel-transport')
     ),
	) );
	
	$wp_customize->add_setting('pixel_transport_menu_text_tranform',array(
		'default' => 'Capitalize',
		'sanitize_callback' => 'pixel_transport_sanitize_choices'
 	));
 	$wp_customize->add_control('pixel_transport_menu_text_tranform',array(
		'type' => 'select',
		'label' => __('Menu Text Transform','pixel-transport'),
		'section' => 'pixel_transport_header_section',
		'choices' => array(
		   'Uppercase' => __('Uppercase','pixel-transport'),
		   'Lowercase' => __('Lowercase','pixel-transport'),
		   'Capitalize' => __('Capitalize','pixel-transport'),
		),
	) );
	$wp_customize->add_setting('pixel_transport_menu_font_size', array(
	    'default'	=> 14,
        'sanitize_callback' => 'pixel_transport_sanitize_number_range',
	));
	$wp_customize->add_control(new pixel_transport_Slider($wp_customize, 'pixel_transport_menu_font_size', array(
        'section' => 'pixel_transport_header_section',
        'label' => esc_html__('Menu Font Size', 'pixel-transport'),
        'input_attrs' => array(
					'reset'			   => 14,
		            'step'             => 1,
					'min'              => 0,
					'max'              => 35,
		        ),
	)));


	$wp_customize->add_setting(
		'pixel_transport_sticky_header',
		array(
			'default'           => false,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new pixel_transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_sticky_header',
			array(
				'label'    => esc_html__( 'ON / OFF Sticky Header', 'pixel-transport' ),
				'section'  => 'pixel_transport_header_section',
				'settings' => 'pixel_transport_sticky_header',
			)
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_header_section_on_off_setting',
		array(
			'default'           => true,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Pixel_Transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_header_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Topbar Section', 'pixel-transport' ),
				'section'  => 'pixel_transport_header_section',
				'settings' => 'pixel_transport_header_section_on_off_setting',
			)
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_phone_number',
		array(
			'default'           => '1(868)225-6155',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_phone_number',
		array(
			'label'           => sprintf( esc_html__( 'Phone Number', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_header_section',
			'settings'        => 'pixel_transport_phone_number' ,
			'type'            => 'text',
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_email_address',
		array(
			'default'           => 'info@example.com',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_email_address',
		array(
			'label'           => sprintf( esc_html__( 'Email Address', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_header_section',
			'settings'        => 'pixel_transport_email_address' ,
			'type'            => 'text',
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_button_url',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_button_url',
		array(
			'label'           => sprintf( esc_html__( 'Button Url', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_header_section',
			'settings'        => 'pixel_transport_button_url' ,
			'type'            => 'url',
		)
	);

	// Social Option

	$wp_customize->add_section(
		'pixel_transport_social_section',
		array(
			'panel'      => 'pixel_transport_header_settings_panel',
			'title'    => esc_html__( 'Social Options', 'pixel-transport' ),
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_facebook_link',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_facebook_link',
		array(
			'label'           => sprintf( esc_html__( 'Facebook Url', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_social_section',
			'settings'        => 'pixel_transport_facebook_link' ,
			'type'            => 'url',
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_twitter_link',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_twitter_link',
		array(
			'label'           => sprintf( esc_html__( 'Twitter Url', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_social_section',
			'settings'        => 'pixel_transport_twitter_link' ,
			'type'            => 'url',
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_instagram_link',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_instagram_link',
		array(
			'label'           => sprintf( esc_html__( 'Instagram Url', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_social_section',
			'settings'        => 'pixel_transport_instagram_link' ,
			'type'            => 'url',
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_youtube_link',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_youtube_link',
		array(
			'label'           => sprintf( esc_html__( 'Youtube Url', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_social_section',
			'settings'        => 'pixel_transport_youtube_link' ,
			'type'            => 'url',
		)
	);

	// Banner Option

	$wp_customize->add_section(
		'pixel_transport_banner_section',
		array(
			'panel'      => 'pixel_transport_frontpage_sections_settings_panel',
			'title'    => esc_html__( 'Banner Options', 'pixel-transport' ),
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_banner_section_on_off_setting',
		array(
			'default'           => false,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Pixel_Transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_banner_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Banner Section', 'pixel-transport' ),
				'section'  => 'pixel_transport_banner_section',
				'settings' => 'pixel_transport_banner_section_on_off_setting',
			)
		)
	);

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

	$wp_customize->add_control(
		'pixel_transport_banner_heading',
		array(
			'label'           => sprintf( esc_html__( 'Banner Heading', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_banner_section',
			'settings'        => 'pixel_transport_banner_heading' ,
			'type'            => 'text',
		)
	);

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

	$wp_customize->add_control(
		'pixel_transport_banner_text',
		array(
			'label'           => sprintf( esc_html__( 'Banner Content', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_banner_section',
			'settings'        => 'pixel_transport_banner_text' ,
			'type'            => 'text',
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_banner_button_link',
		array(
			'default'           => '',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'pixel_transport_banner_button_link',
		array(
			'label'           => sprintf( esc_html__( 'Banner Button Link', 'pixel-transport' ), ),
			'section'         => 'pixel_transport_banner_section',
			'settings'        => 'pixel_transport_banner_button_link' ,
			'type'            => 'url',
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_banner_image',
		array(
        	'default'           => '',
        	'sanitize_callback' => 'pixel_transport_sanitize_image',

    	)
    );
    
    $wp_customize->add_control(
     	new WP_Customize_Image_Control(
    		$wp_customize, 'pixel_transport_banner_image', 
    		array(
    			'label'           => sprintf( esc_html__( 'Banner Image', 'pixel-transport' ), ),
		        'settings'  => 'pixel_transport_banner_image',
		        'section'   => 'pixel_transport_banner_section'
    		) 
    	)
    );

    // Project Option

	$wp_customize->add_section(
		'pixel_transport_project_section',
		array(
			'panel'      => 'pixel_transport_frontpage_sections_settings_panel',
			'title'    => esc_html__( 'Project Options', 'pixel-transport' ),
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_project_section_on_off_setting',
		array(
			'default'           => false,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Pixel_Transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_project_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Project Section', 'pixel-transport' ),
				'section'  => 'pixel_transport_project_section',
				'settings' => 'pixel_transport_project_section_on_off_setting',
			)
		)
	);

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

	$wp_customize->add_control(
        'pixel_transport_project_heading',
        array(
            'label'           => sprintf( esc_html__( 'Project Heading', 'pixel-transport' ), ),
            'section'         => 'pixel_transport_project_section',
            'settings'        => 'pixel_transport_project_heading' ,
            'type'            => 'text',
        )
    );

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

    $wp_customize->add_control(
        'pixel_transport_project_text',
        array(
            'label'           => sprintf( esc_html__( 'Project Heading Text', 'pixel-transport' ), ),
            'section'         => 'pixel_transport_project_section',
            'settings'        => 'pixel_transport_project_text' ,
            'type'            => 'text',
        )
    );

	// Tab 1

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

    $wp_customize->add_control(
        'pixel_transport_project_tab1',
        array(
            'label'           => sprintf( esc_html__( 'Project Tab 1', 'pixel-transport' ), ),
            'section'         => 'pixel_transport_project_section',
            'settings'        => 'pixel_transport_project_tab1' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
	    'pixel_transport_project1',
	    array(
	        'default'           => '',
	        'sanitize_callback' => 'pixel_transport_sanitize_number',
	    )
	);

	$wp_customize->add_control(
	    'pixel_transport_project1',
	    array(
	        'label'       => esc_html__( 'No of project to show in tab 1', 'pixel-transport' ),
	        'section'     => 'pixel_transport_project_section',
	        'settings'    => 'pixel_transport_project1',
	        'type'        => 'number',
	        'input_attrs' => array(
	            'min' => 1,
	            'max' => 6,
	        ),
	    )
	);

	$featured_post1 = get_theme_mod('pixel_transport_project1','');
    	for ( $j = 1; $j <= $featured_post1; $j++ ) {

	    $wp_customize->add_setting(
	        'pixel_transport_project_image1'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'pixel_transport_sanitize_image',
	        )
	    );
	    
	    $wp_customize->add_control(
	        new WP_Customize_Image_Control(
	            $wp_customize, 'pixel_transport_project_image1'.$j, 
	            array(
	                'label'           => sprintf( esc_html__( 'Project Image', 'pixel-transport' ), ).$j,
	                'settings'  => 'pixel_transport_project_image1'.$j,
	                'section'   => 'pixel_transport_project_section'
	            ) 
	        )
	    );

	    $wp_customize->add_setting(
	        'pixel_transport_project_title1'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'sanitize_text_field',
	        )
	    );

	    $wp_customize->add_control(
	        'pixel_transport_project_title1'.$j,
	        array(
	            'label'           => sprintf( esc_html__( 'Project Title', 'pixel-transport' ), ).$j,
	            'section'         => 'pixel_transport_project_section',
	            'settings'        => 'pixel_transport_project_title1'.$j,
	            'type'            => 'text',
	        )
	    );
	}

	// Tab 2

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

    $wp_customize->add_control(
        'pixel_transport_project_tab2',
        array(
            'label'           => sprintf( esc_html__( 'Project Tab 2', 'pixel-transport' ), ),
            'section'         => 'pixel_transport_project_section',
            'settings'        => 'pixel_transport_project_tab2' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
	    'pixel_transport_project2',
	    array(
	        'default'           => '',
	        'sanitize_callback' => 'pixel_transport_sanitize_number',
	    )
	);

	$wp_customize->add_control(
	    'pixel_transport_project2',
	    array(
	        'label'       => esc_html__( 'No of project to show in tab 2', 'pixel-transport' ),
	        'section'     => 'pixel_transport_project_section',
	        'settings'    => 'pixel_transport_project2',
	        'type'        => 'number',
	        'input_attrs' => array(
	            'min' => 1,
	            'max' => 6,
	        ),
	    )
	);

	$featured_post1 = get_theme_mod('pixel_transport_project2','');
    	for ( $j = 1; $j <= $featured_post1; $j++ ) {

	    $wp_customize->add_setting(
	        'pixel_transport_project_image2'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'pixel_transport_sanitize_image',
	        )
	    );
	    
	    $wp_customize->add_control(
	        new WP_Customize_Image_Control(
	            $wp_customize, 'pixel_transport_project_image2'.$j, 
	            array(
	                'label'           => sprintf( esc_html__( 'Project Image', 'pixel-transport' ), ).$j,
	                'settings'  => 'pixel_transport_project_image2'.$j,
	                'section'   => 'pixel_transport_project_section'
	            ) 
	        )
	    );

	    $wp_customize->add_setting(
	        'pixel_transport_project_title2'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'sanitize_text_field',
	        )
	    );

	    $wp_customize->add_control(
	        'pixel_transport_project_title2'.$j,
	        array(
	            'label'           => sprintf( esc_html__( 'Project Title', 'pixel-transport' ), ).$j,
	            'section'         => 'pixel_transport_project_section',
	            'settings'        => 'pixel_transport_project_title2'.$j,
	            'type'            => 'text',
	        )
	    );
	}

	// Tab 3

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

    $wp_customize->add_control(
        'pixel_transport_project_tab3',
        array(
            'label'           => sprintf( esc_html__( 'Project Tab 3', 'pixel-transport' ), ),
            'section'         => 'pixel_transport_project_section',
            'settings'        => 'pixel_transport_project_tab3' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
	    'pixel_transport_project3',
	    array(
	        'default'           => '',
	        'sanitize_callback' => 'pixel_transport_sanitize_number',
	    )
	);

	$wp_customize->add_control(
	    'pixel_transport_project3',
	    array(
	        'label'       => esc_html__( 'No of project to show in tab 3', 'pixel-transport' ),
	        'section'     => 'pixel_transport_project_section',
	        'settings'    => 'pixel_transport_project3',
	        'type'        => 'number',
	        'input_attrs' => array(
	            'min' => 1,
	            'max' => 6,
	        ),
	    )
	);

	$featured_post1 = get_theme_mod('pixel_transport_project3','');
    	for ( $j = 1; $j <= $featured_post1; $j++ ) {

	    $wp_customize->add_setting(
	        'pixel_transport_project_image3'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'pixel_transport_sanitize_image',
	        )
	    );
	    
	    $wp_customize->add_control(
	        new WP_Customize_Image_Control(
	            $wp_customize, 'pixel_transport_project_image3'.$j, 
	            array(
	                'label'           => sprintf( esc_html__( 'Project Image', 'pixel-transport' ), ).$j,
	                'settings'  => 'pixel_transport_project_image3'.$j,
	                'section'   => 'pixel_transport_project_section'
	            ) 
	        )
	    );

	    $wp_customize->add_setting(
	        'pixel_transport_project_title3'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'sanitize_text_field',
	        )
	    );

	    $wp_customize->add_control(
	        'pixel_transport_project_title3'.$j,
	        array(
	            'label'           => sprintf( esc_html__( 'Project Title', 'pixel-transport' ), ).$j,
	            'section'         => 'pixel_transport_project_section',
	            'settings'        => 'pixel_transport_project_title3'.$j,
	            'type'            => 'text',
	        )
	    );
	}

	// Tab 4

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

    $wp_customize->add_control(
        'pixel_transport_project_tab4',
        array(
            'label'           => sprintf( esc_html__( 'Project Tab 4', 'pixel-transport' ), ),
            'section'         => 'pixel_transport_project_section',
            'settings'        => 'pixel_transport_project_tab4' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
	    'pixel_transport_project4',
	    array(
	        'default'           => '',
	        'sanitize_callback' => 'pixel_transport_sanitize_number',
	    )
	);

	$wp_customize->add_control(
	    'pixel_transport_project4',
	    array(
	        'label'       => esc_html__( 'No of project to show in tab 4', 'pixel-transport' ),
	        'section'     => 'pixel_transport_project_section',
	        'settings'    => 'pixel_transport_project4',
	        'type'        => 'number',
	        'input_attrs' => array(
	            'min' => 1,
	            'max' => 6,
	        ),
	    )
	);

	$featured_post1 = get_theme_mod('pixel_transport_project4','');
    	for ( $j = 1; $j <= $featured_post1; $j++ ) {

	    $wp_customize->add_setting(
	        'pixel_transport_project_image4'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'pixel_transport_sanitize_image',
	        )
	    );
	    
	    $wp_customize->add_control(
	        new WP_Customize_Image_Control(
	            $wp_customize, 'pixel_transport_project_image4'.$j, 
	            array(
	                'label'           => sprintf( esc_html__( 'Project Image', 'pixel-transport' ), ).$j,
	                'settings'  => 'pixel_transport_project_image4'.$j,
	                'section'   => 'pixel_transport_project_section'
	            ) 
	        )
	    );

	    $wp_customize->add_setting(
	        'pixel_transport_project_title4'.$j,
	        array(
	            'default'           => '',
	            'sanitize_callback' => 'sanitize_text_field',
	        )
	    );

	    $wp_customize->add_control(
	        'pixel_transport_project_title4'.$j,
	        array(
	            'label'           => sprintf( esc_html__( 'Project Title', 'pixel-transport' ), ).$j,
	            'section'         => 'pixel_transport_project_section',
	            'settings'        => 'pixel_transport_project_title4'.$j,
	            'type'            => 'text',
	        )
	    );
	}

	// Global Color Options

	$wp_customize->add_section(
		'pixel_transport_global_color_section',
		array(
			'panel'      => 'pixel_transport_general_settings_panel',
			'title'    => esc_html__( 'Global Color Options', 'pixel-transport' ),
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_global_color',
		array(
			'default'           => '#F7AB06',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'pixel_transport_global_color',
			array(
				'label'    => __( 'Global Color', 'pixel-transport' ),
				'section'  => 'pixel_transport_global_color_section',
			)
		)
	);

	// Global Font Family Options

	$wp_customize->add_section(
		'pixel_transport_global_font_section',
		array(
			'panel'      => 'pixel_transport_general_settings_panel',
			'title'    => esc_html__( 'Global Font Family Options', 'pixel-transport' ),
		)
	);

	$wp_customize->add_setting(
		'pixel_transport_global_font_setting',
		array(
			'default'           => '',
			'sanitize_callback' => 'pixel_transport_sanitize_google_fonts',
		)
	);
	
	$wp_customize->add_control(
		'pixel_transport_global_font_setting',
		array(
			'label'    => esc_html__( 'Global Font Family', 'pixel-transport' ),
			'section'  => 'pixel_transport_global_font_section',
			'settings' => 'pixel_transport_global_font_setting',
			'type'     => 'select',
			'choices'  => pixel_transport_get_all_google_font_families(),
		)
	);	

	// Footer Option

	$wp_customize->add_section(
        'pixel_transport_footer_widgets_section',
        array(
            'panel'      => 'pixel_transport_footer_settings_panel',
            'title'    => esc_html__( 'Footer Widgets Options', 'pixel-transport' ),
        )
    );

	$wp_customize->add_setting(
		'pixel_transport_footer_widgets_section_on_off_setting',
		array(
			'default'           => true,
			'sanitize_callback' => 'pixel_transport_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new pixel_transport_On_Off_Custom_Control(
			$wp_customize,
			'pixel_transport_footer_widgets_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Footer Widgets', 'pixel-transport' ),
				'section'  => 'pixel_transport_footer_widgets_section',
				'settings' => 'pixel_transport_footer_widgets_section_on_off_setting',
			)
		)
	);

	$wp_customize->add_setting( 'pixel_transport_footer_widget_background_color', array(
		    'default' => '',
		    'sanitize_callback' => 'sanitize_hex_color'
		));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'pixel_transport_footer_widget_background_color', array(
		    'label'     => __('Footer Widget Background Color', 'pixel-transport'),
		    'description' => __('It will change the complete footer widget background color.', 'pixel-transport'),
		    'section' => 'pixel_transport_footer_widgets_section',
		    'settings' => 'pixel_transport_footer_widget_background_color',
		)));

		$wp_customize->add_setting('pixel_transport_footer_widget_background_image',array(
		    'default'   => '',
		    'sanitize_callback' => 'esc_url_raw',
		));
		$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'pixel_transport_footer_widget_background_image',array(
		    'label' => __('Footer Widget Background Image','pixel-transport'),
		    'section' => 'pixel_transport_footer_widgets_section'
		)));


	$wp_customize->add_section(
        'pixel_transport_copyright_section',
        array(
            'panel'      => 'pixel_transport_footer_settings_panel',
            'title'    => esc_html__( 'Copyright Options', 'pixel-transport' ),
        )
    );

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

    $wp_customize->add_control(
        'pixel_transport_footer_text',
        array(
            'label'           => sprintf( esc_html__( 'Edit Copyright Text', 'pixel-transport' ), ),
            'section'         => 'pixel_transport_copyright_section',
            'settings'        => 'pixel_transport_footer_text' ,
            'type'            => 'text',
        )
    );

    // Add Settings and Controls for Scroll top
	$wp_customize->add_setting('pixel_transport_scroll_top_position',array(
        'default' => 'Right',
        'sanitize_callback' => 'pixel_transport_sanitize_choices'
	));
	$wp_customize->add_control('pixel_transport_scroll_top_position',array(
        'type' => 'radio',
        'label'     => __('Scroll to top Position', 'pixel-transport'),
        'description'   => __('This option work for scroll to top', 'pixel-transport'),
       'section' => 'pixel_transport_copyright_section',
       'choices' => array(
            'Right' => __('Right','pixel-transport'),
            'Left' => __('Left','pixel-transport'),
            'Center' => __('Center','pixel-transport')
     ),
	) );

}
add_action( 'customize_register', 'pixel_transport_customize_register' );

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

/**
 * Create the website's slogan for the partial selective refresh.
 *
 * @return void
 */
function pixel_transport_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class Pixel_Transport_Customize_Buttons {
	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function Pixel_Transport_get_instance() {

		static $pixel_transport_instance = null;

		if ( is_null( $pixel_transport_instance ) ) {
			$pixel_transport_instance = new self;
			$pixel_transport_instance->Pixel_Transport_setup_actions();
		}

		return $pixel_transport_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 Pixel_Transport_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  $pixel_transport_manager
	 * @return void
	*/
	public function sections( $pixel_transport_manager ) {
		load_template( trailingslashit( get_template_directory() ) . '/inc/pixel-transport-section-pro.php' );

		$pixel_transport_manager->register_section_type( 'Pixel_Transport_Customize_Section_Pro' );

		$pixel_transport_manager->add_section( new Pixel_Transport_Customize_Section_Pro( $pixel_transport_manager,'pixel_transport_buy_now', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Buy Pixel Transport Pro', 'pixel-transport' ),
			'pro_text' => esc_html__( 'Buy Pro Theme', 'pixel-transport' ),
			'pro_url'    => esc_url( PIXEL_TRANSPORT_BUY_NOW ),
		) )	);

		$pixel_transport_manager->add_section( new Pixel_Transport_Customize_Section_Pro( $pixel_transport_manager, 'pixel_transport_live_demo', array(
		    'priority'   => 1,
		    'title'      => esc_html__( 'Preview Pro Theme', 'pixel-transport' ),
		    'pro_text'   => esc_html__( 'View Live Demo', 'pixel-transport' ),
		    'pro_url'    => esc_url( PIXEL_TRANSPORT_LIVE_DEMO ),
		) ) );	
	}

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

		wp_enqueue_script( 'pixel-transport-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'pixel-transport-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/css/customize-controls.css' );
	}
}
Pixel_Transport_Customize_Buttons::Pixel_Transport_get_instance();