<?php
/**
 * Party Villa: Customizer
 *
 * @subpackage Party Villa
 * @since 1.0
 */

use WPTRT\Customize\Section\Party_Villa_Button;

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

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

	$manager->add_section(
		new Party_Villa_Button( $manager, 'party_villa_pro', [
			'title'      => __( 'Party Villa Pro', 'party-villa' ),
			'priority'    => 0,
			'button_text' => __( 'Go Pro', 'party-villa' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/party-villa-wordpress-theme/', 'party-villa')
		] )
	);

} );

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

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

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

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

} );

function party_villa_customize_register( $wp_customize ) {

	$wp_customize->add_setting('party_villa_logo_size',array(
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_logo_size',array(
		'type' => 'range',
		'label' => __('Logo Size','party-villa'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('party_villa_logo_margin',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('party_villa_logo_margin',array(
		'label' => __('Logo Margin','party-villa'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('party_villa_logo_top_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_logo_top_margin',array(
		'type' => 'number',
		'description' => __('Top','party-villa'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('party_villa_logo_bottom_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_logo_bottom_margin',array(
		'type' => 'number',
		'description' => __('Bottom','party-villa'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('party_villa_logo_left_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_logo_left_margin',array(
		'type' => 'number',
		'description' => __('Left','party-villa'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('party_villa_logo_right_margin',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
 	));
 	$wp_customize->add_control('party_villa_logo_right_margin',array(
		'type' => 'number',
		'description' => __('Right','party-villa'),
		'section' => 'title_tagline',
    ));

	$wp_customize->add_setting('party_villa_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'party_villa_sanitize_checkbox'
	));
	$wp_customize->add_control('party_villa_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','party-villa'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('party_villa_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','party-villa'),
		'section' => 'title_tagline',
	));

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

	$wp_customize->add_setting('party_villa_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'party_villa_sanitize_checkbox'
	));
	$wp_customize->add_control('party_villa_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','party-villa'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('party_villa_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','party-villa'),
		'section' => 'title_tagline',
	));

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

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

	$wp_customize->add_section( 'party_villa_theme_options_section', array(
    	'title'      => __( 'General Settings', 'party-villa' ),
		'priority'   => 30,
		'panel' => 'party_villa_panel_id'
	) );

	$wp_customize->add_setting('party_villa_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'party_villa_sanitize_choices'
	));
	$wp_customize->add_control('party_villa_theme_options',array(
		'type' => 'select',
		'label' => __('Blog Page Sidebar Layout','party-villa'),
		'section' => 'party_villa_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','party-villa'),
		   'Right Sidebar' => __('Right Sidebar','party-villa'),
		   'One Column' => __('One Column','party-villa'),
		   'Three Columns' => __('Three Columns','party-villa'),
		   'Four Columns' => __('Four Columns','party-villa'),
		   'Grid Layout' => __('Grid Layout','party-villa')
		),
	));

	$wp_customize->add_setting('party_villa_single_post_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'party_villa_sanitize_choices'
	));
	$wp_customize->add_control('party_villa_single_post_sidebar',array(
        'type' => 'select',
        'label' => __('Single Post Sidebar Layout','party-villa'),
        'section' => 'party_villa_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','party-villa'),
            'Right Sidebar' => __('Right Sidebar','party-villa'),
            'One Column' => __('One Column','party-villa')
        ),
	));

	$wp_customize->add_setting('party_villa_page_sidebar',array(
		'default' => 'One Column',
		'sanitize_callback' => 'party_villa_sanitize_choices'
	));
	$wp_customize->add_control('party_villa_page_sidebar',array(
        'type' => 'select',
        'label' => __('Page Sidebar Layout','party-villa'),
        'section' => 'party_villa_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','party-villa'),
            'Right Sidebar' => __('Right Sidebar','party-villa'),
            'One Column' => __('One Column','party-villa')
        ),
	));

	$wp_customize->add_setting('party_villa_archive_page_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'party_villa_sanitize_choices'
	));
	$wp_customize->add_control('party_villa_archive_page_sidebar',array(
        'type' => 'select',
        'label' => __('Archive & Search Page Sidebar Layout','party-villa'),
        'section' => 'party_villa_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','party-villa'),
            'Right Sidebar' => __('Right Sidebar','party-villa'),
            'One Column' => __('One Column','party-villa'),
		   	'Three Columns' => __('Three Columns','party-villa'),
		   	'Four Columns' => __('Four Columns','party-villa'),
            'Grid Layout' => __('Grid Layout','party-villa')
        ),
	));

	$wp_customize->add_setting( 'party_villa_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'party_villa_sanitize_choices'
	));
	
	$wp_customize->add_control( 'party_villa_boxfull_width', array(
		'label'    => __( 'Section Width', 'party-villa' ),
		'section'  => 'party_villa_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'party-villa'),
			'container-fluid' => __('Full Width', 'party-villa'),
			'none' => __('None', 'party-villa')
		),
	));

	$wp_customize->add_setting( 'party_villa_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'party_villa_sanitize_choices'
	));
	$wp_customize->add_control( 'party_villa_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'party-villa' ),
		'section'  => 'party_villa_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'party-villa'),
			'fadeInUp' => __('fadeInUp', 'party-villa'),
			'zoomIn'    => __('zoomIn', 'party-villa'),
			'None'    => __('None', 'party-villa')
		),
	));

	//Header
	$wp_customize->add_section( 'party_villa_header_section' , array(
    	'title'    => __( 'Header', 'party-villa' ),
		'priority' => null,
		'panel' => 'party_villa_panel_id'
	) );

	$wp_customize->add_setting('party_villa_phone_number',array(
    	'default' => '',
    	'sanitize_callback'	=> 'party_villa_sanitize_phone_number'
	));
	$wp_customize->add_control('party_villa_phone_number',array(
	   	'type' => 'text',
	   	'label' => __('Add Phone Number','party-villa'),
	   	'section' => 'party_villa_header_section',
	));

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

	$wp_customize->add_setting( 'party_villa_phonebdr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'party_villa_phonebdr_color', array(
		'label' => 'Phone Border Color',
		'section' => 'party_villa_header_section',
	)));

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

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

	//home page slider
	$wp_customize->add_section( 'party_villa_slider_section' , array(
    	'title'    => __( 'Slider Settings', 'party-villa' ),
		'priority' => null,
		'panel' => 'party_villa_panel_id'
	) );

	$wp_customize->add_setting('party_villa_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'party_villa_sanitize_checkbox'
	));
	$wp_customize->add_control('party_villa_slider_hide_show',array(
	   	'type' => 'checkbox',
	   	'label' => __('Show / Hide Slider','party-villa'),
	   	'section' => 'party_villa_slider_section',
	));

	$wp_customize->add_setting( 'party_villa_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'party_villa_sanitize_choices'
	));
	$wp_customize->add_control( 'party_villa_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'party-villa' ),
		'section'  => 'party_villa_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'party-villa'),
			'bounceInRight' => __('bounceInRight', 'party-villa'),
			'bounceInUp'    => __('bounceInUp', 'party-villa'),
			'bounceInDown'    => __('bounceInDown', 'party-villa'),
			'zoomIn'  => __('zoomIn', 'party-villa'),
			'zoomOut' => __('zoomOut', 'party-villa'),
			'fadeInDown'    => __('fadeInDown', 'party-villa'),
			'fadeInUp'    => __('fadeInUp', 'party-villa'),
			'fadeInLeft'  => __('fadeInLeft', 'party-villa'),
			'fadeInRight' => __('fadeInRight', 'party-villa'),
			'flip-up'    => __('flip-up', 'party-villa'),
			'none'    => __('none', 'party-villa')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'party_villa_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'party_villa_sanitize_dropdown_pages'
		));
		$wp_customize->add_control( 'party_villa_slider' . $count, array(
			'label' => __('Select Slider Image Page', 'party-villa' ),
			'description'=> __('Image size (1400px x 600px)','party-villa'),
			'section' => 'party_villa_slider_section',
			'type' => 'dropdown-pages'
		));
	}

	$wp_customize->add_setting('party_villa_slider_excerpt_length',array(
		'default' => '20',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','party-villa'),
		'section' => 'party_villa_slider_section',
	));

	$wp_customize->add_setting('party_villa_slider_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_slider_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','party-villa'),
		'section' => 'party_villa_slider_section',
	));

	$wp_customize->add_setting('party_villa_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','party-villa'),
		'section' => 'party_villa_slider_section',
	));

	$wp_customize->add_setting('party_villa_slider_opacity',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_slider_opacity',array(
		'type' => 'range',
		'label' => __('Image Opacity','party-villa'),
		'section' => 'party_villa_slider_section',
		'input_attrs' => array(
			'min' => 0,
			'max' => 1,
			'step' => 0.1
		)
	));

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

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

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

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

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

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

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

	//Services Section
	$wp_customize->add_section('party_villa_services_section',array(
		'title'	=> __('Services Section','party-villa'),
		'description'=> __('Note : This section will appear below the slider.','party-villa'),
		'panel' => 'party_villa_panel_id',
	));

    $wp_customize->add_setting('party_villa_section_title',array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('party_villa_section_title',array(
		'label'	=> __('Section Title','party-villa'),
		'section' => 'party_villa_services_section',
		'type' => 'text'
	));

	$wp_customize->add_setting('party_villa_section_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
	));
	$wp_customize->add_control('party_villa_section_title_font_size',array(
		'type' => 'number',
		'label' => __('Font Size','party-villa'),
		'section' => 'party_villa_services_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('party_villa_category_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'party_villa_sanitize_choices',
	));
	$wp_customize->add_control('party_villa_category_setting',array(
		'type' => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','party-villa'),
		'section' => 'party_villa_services_section',
	));

	$wp_customize->add_setting( 'party_villa_service_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'party_villa_service_color', array(
		'label' => 'Heading Color',
		'section' => 'party_villa_services_section',
	)));

	$wp_customize->add_setting( 'party_villa_servicebdr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'party_villa_servicebdr_color', array(
		'label' => 'Heading Broder Color',
		'section' => 'party_villa_services_section',
	)));

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

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

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

	$wp_customize->add_setting( 'party_villa_service_btnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'party_villa_service_btnbg_color', array(
		'label' => 'Button Bg Color',
		'section' => 'party_villa_services_section',
	)));

	//Footer
    $wp_customize->add_section( 'party_villa_footer', array(
    	'title'  => __( 'Footer Setting', 'party-villa' ),
		'priority' => null,
		'panel' => 'party_villa_panel_id'
	) );

	$wp_customize->add_setting('party_villa_show_back_totop',array(
       'default' => true,
       'sanitize_callback'	=> 'party_villa_sanitize_checkbox'
    ));
    $wp_customize->add_control('party_villa_show_back_totop',array(
       'type' => 'checkbox',
       'label' => __('Show / Hide Back to Top','party-villa'),
       'section' => 'party_villa_footer'
    ));

    $wp_customize->add_setting('party_villa_footer_copy',array(
		'default' => 'Part Villa WordPress Theme',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('party_villa_footer_copy',array(
		'label'	=> __('Copyright Text','party-villa'),
		'section' => 'party_villa_footer',
		'setting' => 'party_villa_footer_copy',
		'type' => 'text'
	));

	$wp_customize->add_setting('party_villa_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'party_villa_sanitize_float'
 	));
 	$wp_customize->add_control('party_villa_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','party-villa'),
		'section' => 'party_villa_footer',
	));

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

	$wp_customize->add_section(
		new Party_Villa_Button( $wp_customize, 'party_villa_pro_link', [
			'title'      => __( 'Party Villa Pro', 'party-villa' ),
			'priority'    => 0,
			'button_text' => __( 'Go Pro', 'party-villa' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/party-villa-wordpress-theme/', 'party-villa'),
			'panel' => 'party_villa_panel_id'
		] )
	);

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

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

	$wp_customize->add_setting( 'party_villa_tbtext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'party_villa_tbtext_color', array(
		'label' => 'T/B Text Color',
		'section' => 'party_villa_footer',
	)));

	$wp_customize->add_setting( 'party_villa_tbbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'party_villa_tbbg_color', array(
		'label' => 'T/B Bg Color',
		'section' => 'party_villa_footer',
	)));

	$wp_customize->add_setting( 'party_villa_footerbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'party_villa_footerbg_color', array(
		'label' => 'Overlay Color',
		'section' => 'party_villa_footer',
	)));

	$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' => 'party_villa_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'party_villa_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'party_villa_customize_register' );

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

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

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

function party_villa_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' ) ) );
}