<?php
function expert_ac_repair_upper_header_settings( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';

	/*=========================================
	top header
	=========================================*/
	$wp_customize->add_section(
        'expert_ac_repair_topbar',
        array(
        	'priority'      => 2,
            'title' 		=> __('Header Informations','expert-ac-repair'),
			'panel'  		=> 'expert_ac_repair_frontpage_sections',
		)
    );

    $wp_customize->add_setting( 
		'expert_ac_repair_top_header' , 
			array(
			'default' => true,
			'sanitize_callback' => 'expert_ac_repair_sanitize_checkbox',
			'capability' => 'edit_theme_options',
		) 
	);
	$wp_customize->add_control(
	'expert_ac_repair_top_header', 
		array(
			'label'	      => esc_html__( 'Show / Hide Topbar', 'expert-ac-repair' ),
			'section'     => 'expert_ac_repair_topbar',
			'settings'    => 'expert_ac_repair_top_header',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting('expert_ac_repair_timming',array(
		'default'=> 'Our open service request times: Mon-Fri 08:00 to 16:00',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_ac_repair_timming',array(
		'label'	=> __('Add Timing','expert-ac-repair'),
		'section'=> 'expert_ac_repair_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_ac_repair_calender',array(
		'default'=> 'Schedule a Service',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_ac_repair_calender',array(
		'label'	=> __('Add Calendar Text','expert-ac-repair'),
		'section'=> 'expert_ac_repair_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_ac_repair_calender_link',array(
		'default'=> '#',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('expert_ac_repair_calender_link',array(
		'label'	=> __('Add Calendar Link','expert-ac-repair'),
		'section'=> 'expert_ac_repair_topbar',
		'type'=> 'url'
	));

	$wp_customize->add_setting( 'expert_ac_repair_upgrade_page_settings_156454s',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control( new Expert_Ac_Repair_Control_Upgrade(
        $wp_customize, 'expert_ac_repair_upgrade_page_settings_156454s',
            array(
                'priority'      => 200,
                'section'       => 'expert_ac_repair_topbar',
                'settings'      => 'expert_ac_repair_upgrade_page_settings_156454s',
                'label'         => __( 'Expert AC Repair Pro comes with additional features.', 'expert-ac-repair' ),
                'choices'       => array( __( '15+ Ready-Made Sections', 'expert-ac-repair' ), __( 'One-Click Demo Import', 'expert-ac-repair' ), __( 'WooCommerce Integrated', 'expert-ac-repair' ), __( 'Drag & Drop Section Reordering', 'expert-ac-repair' ),__( 'Advanced Typography Control', 'expert-ac-repair' ),__( 'Intuitive Customization Options', 'expert-ac-repair' ),__( '24/7 Support', 'expert-ac-repair' ), )
            )
        )
    );

	// Contact Details Section
	$wp_customize->add_section( 'expert_ac_repair_contact_details', array(
    	'title'      => __( 'Contact Details', 'expert-ac-repair' ),
    	'description' => __( 'Add your contact details', 'expert-ac-repair' ),
		'panel' => 'expert_ac_repair_frontpage_sections',
		'priority' => 2,
	) );

	$wp_customize->add_setting('expert_ac_repair_location_text',array(
		'default'=> 'Our Location',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_ac_repair_location_text',array(
		'label'	=> __('Add Location Text','expert-ac-repair'),
		'section'=> 'expert_ac_repair_contact_details',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_ac_repair_location',array(
		'default'=> 'Flat 201, Reynolds Neck Str.',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_ac_repair_location',array(
		'label'	=> __('Add Location','expert-ac-repair'),
		'section'=> 'expert_ac_repair_contact_details',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_ac_repair_mail_text',array(
		'default'=> 'Mail Us On',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_ac_repair_mail_text',array(
		'label'	=> __('Add Mail Text','expert-ac-repair'),
		'section'=> 'expert_ac_repair_contact_details',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_ac_repair_mail',array(
		'default'=> 'example@example.com',
		'sanitize_callback'	=> 'sanitize_email'
	));
	$wp_customize->add_control('expert_ac_repair_mail',array(
		'label'	=> __('Add Mail Address','expert-ac-repair'),
		'section'=> 'expert_ac_repair_contact_details',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_ac_repair_call_text',array(
		'default'=> 'Call Us',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_ac_repair_call_text',array(
		'label'	=> __('Add Call Text','expert-ac-repair'),
		'section'=> 'expert_ac_repair_contact_details',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_ac_repair_call',array(
		'default'=> '+11234567890',
		'sanitize_callback'	=> 'expert_ac_repair_sanitize_phone_number'
	));
	$wp_customize->add_control('expert_ac_repair_call',array(
		'label'	=> __('Add Phone Number','expert-ac-repair'),
		'section'=> 'expert_ac_repair_contact_details',
		'type'=> 'text'
	));

	$wp_customize->add_setting( 'expert_ac_repair_upgrade_page_settings_156454',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control( new Expert_Ac_Repair_Control_Upgrade(
        $wp_customize, 'expert_ac_repair_upgrade_page_settings_156454',
            array(
                'priority'      => 200,
                'section'       => 'expert_ac_repair_contact_details',
                'settings'      => 'expert_ac_repair_upgrade_page_settings_156454',
                'label'         => __( 'Expert AC Repair Pro comes with additional features.', 'expert-ac-repair' ),
                'choices'       => array( __( '15+ Ready-Made Sections', 'expert-ac-repair' ), __( 'One-Click Demo Import', 'expert-ac-repair' ), __( 'WooCommerce Integrated', 'expert-ac-repair' ), __( 'Drag & Drop Section Reordering', 'expert-ac-repair' ),__( 'Advanced Typography Control', 'expert-ac-repair' ),__( 'Intuitive Customization Options', 'expert-ac-repair' ),__( '24/7 Support', 'expert-ac-repair' ), )
            )
        )
    );

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