<?php
/**
 * Fitness Club Gym: Customizer
 *
 * @subpackage Fitness Club Gym
 * @since 1.0
 */

use WPTRT\Customize\Section\Fitness_Club_Gym_Button;

add_action( 'customize_register', function( $manager ) {

	$manager->register_section_type( Fitness_Club_Gym_Button::class );

	$manager->add_section(
		new Fitness_Club_Gym_Button( $manager, 'fitness_club_gym_pro', [
			'title'      => __( 'Fitness Club Gym Pro', 'fitness-club-gym' ),
			'priority'    => 0,
			'button_text' => __( 'Go Pro', 'fitness-club-gym' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/fitness-club-wordpress-theme/', 'fitness-club-gym')
		] )
	);

} );

// Load the JS and CSS.
add_action( 'customize_controls_enqueue_scripts', function() {

	$version = wp_get_theme()->get( 'Version' );

	wp_enqueue_script(
		'fitness-club-gym-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/js/customize-controls.js' ),
		[ 'customize-controls' ],
		$version,
		true
	);

	wp_enqueue_style(
		'fitness-club-gym-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/css/customize-controls.css' ),
		[ 'customize-controls' ],
 		$version
	);

} );

function fitness_club_gym_customize_register( $wp_customize ) {

	$wp_customize->add_setting('fitness_club_gym_logo_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_logo_size',array(
		'type' => 'range',
		'description' => __('Logo Size (0-100%)','fitness-club-gym'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('fitness_club_gym_logo_margin',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('fitness_club_gym_logo_margin',array(
		'label' => __('Logo Margin','fitness-club-gym'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('fitness_club_gym_logo_top_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_logo_top_margin',array(
		'type' => 'number',
		'description' => __('Top','fitness-club-gym'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('fitness_club_gym_logo_bottom_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_logo_bottom_margin',array(
		'type' => 'number',
		'description' => __('Bottom','fitness-club-gym'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('fitness_club_gym_logo_left_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_logo_left_margin',array(
		'type' => 'number',
		'description' => __('Left','fitness-club-gym'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('fitness_club_gym_logo_right_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
 	));
 	$wp_customize->add_control('fitness_club_gym_logo_right_margin',array(
		'type' => 'number',
		'description' => __('Right','fitness-club-gym'),
		'section' => 'title_tagline',
    ));

	$wp_customize->add_setting('fitness_club_gym_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_checkbox'
	));
	$wp_customize->add_control('fitness_club_gym_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','fitness-club-gym'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('fitness_club_gym_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','fitness-club-gym'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting( 'fitness_club_gym_site_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_site_title_color', array(
		'label' => 'Title Color',
		'section' => 'title_tagline',
	)));

	$wp_customize->add_setting('fitness_club_gym_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_checkbox'
	));
	$wp_customize->add_control('fitness_club_gym_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','fitness-club-gym'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting( 'fitness_club_gym_site_tagline_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_site_tagline_color', array(
		'label' => 'Tagline Color',
		'section' => 'title_tagline',
	)));

	$wp_customize->add_panel( 'fitness_club_gym_panel_id', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'theme_supports' => '',
		'title' => __( 'Theme Settings', 'fitness-club-gym' ),
		'description' => __( 'Description of what this panel does.', 'fitness-club-gym' ),
	) );

	$wp_customize->add_section( 'fitness_club_gym_theme_options_section', array(
    	'title'      => __( 'General Settings', 'fitness-club-gym' ),
		'priority'   => 30,
		'panel' => 'fitness_club_gym_panel_id'
	) );

	$wp_customize->add_setting('fitness_club_gym_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices'
	));
	$wp_customize->add_control('fitness_club_gym_theme_options',array(
		'type' => 'select',
		'label' => __('Blog Page Sidebar Layout','fitness-club-gym'),
		'section' => 'fitness_club_gym_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','fitness-club-gym'),
		   'Right Sidebar' => __('Right Sidebar','fitness-club-gym'),
		   'One Column' => __('One Column','fitness-club-gym'),
		   'Three Columns' => __('Three Columns','fitness-club-gym'),
		   'Four Columns' => __('Four Columns','fitness-club-gym'),
		   'Grid Layout' => __('Grid Layout','fitness-club-gym')
		),
	));

	$wp_customize->add_setting('fitness_club_gym_single_post_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices'
	));
	$wp_customize->add_control('fitness_club_gym_single_post_sidebar',array(
        'type' => 'select',
        'label' => __('Single Post Sidebar Layout','fitness-club-gym'),
        'section' => 'fitness_club_gym_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','fitness-club-gym'),
            'Right Sidebar' => __('Right Sidebar','fitness-club-gym'),
            'One Column' => __('One Column','fitness-club-gym')
        ),
	));

	$wp_customize->add_setting('fitness_club_gym_page_sidebar',array(
		'default' => 'One Column',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices'
	));
	$wp_customize->add_control('fitness_club_gym_page_sidebar',array(
        'type' => 'select',
        'label' => __('Page Sidebar Layout','fitness-club-gym'),
        'section' => 'fitness_club_gym_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','fitness-club-gym'),
            'Right Sidebar' => __('Right Sidebar','fitness-club-gym'),
            'One Column' => __('One Column','fitness-club-gym')
        ),
	));

	$wp_customize->add_setting('fitness_club_gym_archive_page_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices'
	));
	$wp_customize->add_control('fitness_club_gym_archive_page_sidebar',array(
        'type' => 'select',
        'label' => __('Archive & Search Page Sidebar Layout','fitness-club-gym'),
        'section' => 'fitness_club_gym_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','fitness-club-gym'),
            'Right Sidebar' => __('Right Sidebar','fitness-club-gym'),
            'One Column' => __('One Column','fitness-club-gym'),
		   	'Three Columns' => __('Three Columns','fitness-club-gym'),
		   	'Four Columns' => __('Four Columns','fitness-club-gym'),
            'Grid Layout' => __('Grid Layout','fitness-club-gym')
        ),
	));

	$wp_customize->add_setting( 'fitness_club_gym_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices'
	));
	
	$wp_customize->add_control( 'fitness_club_gym_boxfull_width', array(
		'label'    => __( 'Section Width', 'fitness-club-gym' ),
		'section'  => 'fitness_club_gym_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'fitness-club-gym'),
			'container-fluid' => __('Full Width', 'fitness-club-gym'),
			'none' => __('None', 'fitness-club-gym')
		),
	));

	$wp_customize->add_setting( 'fitness_club_gym_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices'
	));
	$wp_customize->add_control( 'fitness_club_gym_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'fitness-club-gym' ),
		'section'  => 'fitness_club_gym_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'fitness-club-gym'),
			'fadeInUp' => __('fadeInUp', 'fitness-club-gym'),
			'zoomIn'    => __('zoomIn', 'fitness-club-gym'),
			'None'    => __('None', 'fitness-club-gym')
		),
	));

	//Header
	$wp_customize->add_section( 'fitness_club_gym_header_section' , array(
    	'title'    => __( 'Header', 'fitness-club-gym' ),
		'priority' => null,
		'panel' => 'fitness_club_gym_panel_id'
	) );

	$wp_customize->add_setting('fitness_club_gym_timing',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('fitness_club_gym_timing',array(
	   	'type' => 'text',
	   	'label' => __('Add Timing','fitness-club-gym'),
	   	'section' => 'fitness_club_gym_header_section',
	));

	$wp_customize->add_setting('fitness_club_gym_phone_number',array(
    	'default' => '',
    	'sanitize_callback'	=> 'fitness_club_gym_sanitize_phone_number'
	));
	$wp_customize->add_control('fitness_club_gym_phone_number',array(
	   	'type' => 'text',
	   	'label' => __('Add Phone Number','fitness-club-gym'),
	   	'section' => 'fitness_club_gym_header_section',
	));

	$wp_customize->add_setting( 'fitness_club_gym_tophdricon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_tophdricon_color', array(
		'label' => 'Top Icon Color',
		'section' => 'fitness_club_gym_header_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_tophdrtext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_tophdrtext_color', array(
		'label' => 'Top Text Color',
		'section' => 'fitness_club_gym_header_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_tophdrbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_tophdrbg_color', array(
		'label' => 'Top Background Color',
		'section' => 'fitness_club_gym_header_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_menu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_menu_color', array(
		'label' => 'Menu Color',
		'section' => 'fitness_club_gym_header_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_menuhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_menuhvr_color', array(
		'label' => 'Menu Hover Color',
		'section' => 'fitness_club_gym_header_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_menubg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_menubg_color', array(
		'label' => 'Menu Background Color',
		'section' => 'fitness_club_gym_header_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_headerbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_headerbg_color', array(
		'label' => 'Header Background Color',
		'section' => 'fitness_club_gym_header_section',
	)));

	//home page slider
	$wp_customize->add_section( 'fitness_club_gym_slider_section' , array(
    	'title'    => __( 'Slider Settings', 'fitness-club-gym' ),
		'priority' => null,
		'panel' => 'fitness_club_gym_panel_id'
	) );

	$wp_customize->add_setting('fitness_club_gym_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'fitness_club_gym_sanitize_checkbox'
	));
	$wp_customize->add_control('fitness_club_gym_slider_hide_show',array(
	   	'type' => 'checkbox',
	   	'label' => __('Show / Hide Slider','fitness-club-gym'),
	   	'section' => 'fitness_club_gym_slider_section',
	));

	$wp_customize->add_setting( 'fitness_club_gym_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices'
	));
	$wp_customize->add_control( 'fitness_club_gym_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'fitness-club-gym' ),
		'section'  => 'fitness_club_gym_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'fitness-club-gym'),
			'bounceInRight' => __('bounceInRight', 'fitness-club-gym'),
			'bounceInUp'    => __('bounceInUp', 'fitness-club-gym'),
			'bounceInDown'    => __('bounceInDown', 'fitness-club-gym'),
			'zoomIn'  => __('zoomIn', 'fitness-club-gym'),
			'zoomOut' => __('zoomOut', 'fitness-club-gym'),
			'fadeInDown'    => __('fadeInDown', 'fitness-club-gym'),
			'fadeInUp'    => __('fadeInUp', 'fitness-club-gym'),
			'fadeInLeft'  => __('fadeInLeft', 'fitness-club-gym'),
			'fadeInRight' => __('fadeInRight', 'fitness-club-gym'),
			'flip-up'    => __('flip-up', 'fitness-club-gym'),
			'none'    => __('none', 'fitness-club-gym')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'fitness_club_gym_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'fitness_club_gym_sanitize_dropdown_pages'
		));
		$wp_customize->add_control( 'fitness_club_gym_slider' . $count, array(
			'label' => __('Select Slider Image Page', 'fitness-club-gym' ),
			'description'=> __('Image size (1400px x 600px)','fitness-club-gym'),
			'section' => 'fitness_club_gym_slider_section',
			'type' => 'dropdown-pages'
		));
	}

	$wp_customize->add_setting('fitness_club_gym_slider_excerpt_length',array(
		'default' => '15',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','fitness-club-gym'),
		'section' => 'fitness_club_gym_slider_section',
	));

	$wp_customize->add_setting('fitness_club_gym_slider_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_slider_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','fitness-club-gym'),
		'section' => 'fitness_club_gym_slider_section',
	));

	$wp_customize->add_setting('fitness_club_gym_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','fitness-club-gym'),
		'section' => 'fitness_club_gym_slider_section',
	));

	$wp_customize->add_setting('fitness_club_gym_slider_opacity',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_slider_opacity',array(
		'type' => 'range',
		'label' => __('Image Opacity','fitness-club-gym'),
		'section' => 'fitness_club_gym_slider_section',
		'input_attrs' => array(
			'min' => 0,
			'max' => 1,
			'step' => 0.01
		)
	));

	$wp_customize->add_setting( 'fitness_club_gym_slidertitle_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_slidertitle_color', array(
		'label' => 'Title Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_slidertext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_slidertext_color', array(
		'label' => 'Text Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_sliderbtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_sliderbtn_color', array(
		'label' => 'Button Text Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_sliderbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_sliderbtnbg_color', array(
		'label' => 'Button Background Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_sliderbtnhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_sliderbtnhvr_color', array(
		'label' => 'Button Hover Text Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_sliderbtnhvrbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_sliderbtnhvrbg_color', array(
		'label' => 'Button Hover Background Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_np_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_np_color', array(
		'label' => 'Pre/Next Arrow Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_npbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_npbg_color', array(
		'label' => 'Pre/Next Arrow Background Color',
		'section' => 'fitness_club_gym_slider_section',
	)));

	//Services Section
	$wp_customize->add_section('fitness_club_gym_service_section',array(
		'title'	=> __('Service Section','fitness-club-gym'),
		'description'=> __('Note : This section will appear below the slider.','fitness-club-gym'),
		'panel' => 'fitness_club_gym_panel_id',
	));

    $wp_customize->add_setting('fitness_club_gym_section_title',array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('fitness_club_gym_section_title',array(
		'label'	=> __('Section Title','fitness-club-gym'),
		'section' => 'fitness_club_gym_service_section',
		'type' => 'text'
	));

	$wp_customize->add_setting('fitness_club_gym_section_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_section_title_font_size',array(
		'type' => 'number',
		'label' => __('Font Size','fitness-club-gym'),
		'section' => 'fitness_club_gym_service_section',
	));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_pst[]= 'select';
	foreach($categories as $category){
		if($i==0){
			$default = $category->slug;
			$i++;
		}
		$cat_pst[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('fitness_club_gym_category_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'fitness_club_gym_sanitize_choices',
	));
	$wp_customize->add_control('fitness_club_gym_category_setting',array(
		'type' => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','fitness-club-gym'),
		'section' => 'fitness_club_gym_service_section',
	));

	$wp_customize->add_setting('fitness_club_gym_service_img_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_service_img_size',array(
		'type' => 'number',
		'label' => __('Image Size','fitness-club-gym'),
		'section' => 'fitness_club_gym_service_section',
	));

	$wp_customize->add_setting('fitness_club_gym_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','fitness-club-gym'),
		'section' => 'fitness_club_gym_service_section',
	));

	$wp_customize->add_setting('fitness_club_gym_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','fitness-club-gym'),
		'section' => 'fitness_club_gym_service_section',
	));

	$wp_customize->add_setting( 'fitness_club_gym_service_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_service_color', array(
		'label' => 'Title Color',
		'section' => 'fitness_club_gym_service_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_servicebdr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_servicebdr_color', array(
		'label' => 'Title Border Color',
		'section' => 'fitness_club_gym_service_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_servicebox_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_servicebox_color', array(
		'label' => 'Box Bg Color',
		'section' => 'fitness_club_gym_service_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_servicebox_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_servicebox_title_color', array(
		'label' => 'Box Title Color',
		'section' => 'fitness_club_gym_service_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_servicebox_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_servicebox_text_color', array(
		'label' => 'Box Text Color',
		'section' => 'fitness_club_gym_service_section',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_servicebtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_servicebtn_color', array(
		'label' => 'Button Text Color',
		'section' => 'fitness_club_gym_service_section',
	)));

	//Footer
    $wp_customize->add_section( 'fitness_club_gym_footer', array(
    	'title'  => __( 'Footer Settings', 'fitness-club-gym' ),
		'priority' => null,
		'panel' => 'fitness_club_gym_panel_id'
	) );

	$wp_customize->add_setting('fitness_club_gym_show_back_totop',array(
       'default' => true,
       'sanitize_callback'	=> 'fitness_club_gym_sanitize_checkbox'
    ));
    $wp_customize->add_control('fitness_club_gym_show_back_totop',array(
       'type' => 'checkbox',
       'label' => __('Show / Hide Back to Top','fitness-club-gym'),
       'section' => 'fitness_club_gym_footer'
    ));

    $wp_customize->add_setting('fitness_club_gym_footer_copy',array(
		'default' => 'Fitness Club WordPress Theme',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('fitness_club_gym_footer_copy',array(
		'label'	=> __('Copyright Text','fitness-club-gym'),
		'section' => 'fitness_club_gym_footer',
		'setting' => 'fitness_club_gym_footer_copy',
		'type' => 'text'
	));

	$wp_customize->add_setting('fitness_club_gym_footer_copy_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
	));
	$wp_customize->add_control('fitness_club_gym_footer_copy_font_size',array(
		'type' => 'number',
		'label' => __('Font Size','fitness-club-gym'),
		'section' => 'fitness_club_gym_footer',
	));

	$wp_customize->add_setting('fitness_club_gym_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'fitness_club_gym_sanitize_float'
 	));
 	$wp_customize->add_control('fitness_club_gym_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','fitness-club-gym'),
		'section' => 'fitness_club_gym_footer',
	));

	$wp_customize->add_setting( 'fitness_club_gym_footer_wedgets_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_footer_wedgets_color', array(
		'label' => 'Wedgits Title Color',
		'section' => 'fitness_club_gym_footer',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_footer_wedgets_menus_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_footer_wedgets_menus_color', array(
		'label' => 'Wedgits Menus Color',
		'section' => 'fitness_club_gym_footer',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_footer_wedgets_menus_icon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_footer_wedgets_menus_icon_color', array(
		'label' => 'Wedgits Menus Icons Color',
		'section' => 'fitness_club_gym_footer',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_copyright_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_copyright_color', array(
		'label' => 'Copyright Text Color',
		'section' => 'fitness_club_gym_footer',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_copyrightbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_copyrightbg_color', array(
		'label' => 'Copyright Bg Color',
		'section' => 'fitness_club_gym_footer',
	)));

	$wp_customize->add_setting( 'fitness_club_gym_footerbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fitness_club_gym_footerbg_color', array(
		'label' => 'Footer Bg Color',
		'section' => 'fitness_club_gym_footer',
	)));

	$wp_customize->register_section_type( Fitness_Club_Gym_Button::class );

	$wp_customize->add_section(
		new Fitness_Club_Gym_Button( $wp_customize, 'fitness_club_gym_pro_link', [
			'title'      => __( 'Fitness Club Gym Pro', 'fitness-club-gym' ),
			'priority'    => 0,
			'button_text' => __( 'Go Pro', 'fitness-club-gym' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/fitness-club-wordpress-theme/', 'fitness-club-gym'),
			'panel' => 'fitness_club_gym_panel_id'
		] )
	);

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

	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.site-title a',
		'render_callback' => 'fitness_club_gym_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'fitness_club_gym_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'fitness_club_gym_customize_register' );

function fitness_club_gym_customize_partial_blogname() {
	bloginfo( 'name' );
}

function fitness_club_gym_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

function fitness_club_gym_is_static_front_page() {
	return ( is_front_page() && ! is_home() );
}

function fitness_club_gym_is_view_with_layout_option() {
	// This option is available on all pages. It's also available on archives when there isn't a sidebar.
	return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );
}