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

	/*=========================================
	top header
	=========================================*/
	$wp_customize->add_section(
        'pet_house_topbar',
        array(
        	'priority'      => 3,
            'title' 		=> __('Header Informations','pet-house'),
			'panel'  		=> 'pet_house_frontpage_sections',
		)
    );

    $wp_customize->add_setting( 
		'pet_house_topbar' , 
			array(
			'default' => true,
			'sanitize_callback' => 'pet_house_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'pet_house_topbar', 
		array(
			'label'	      => esc_html__( 'Hide / Show Topbar', 'pet-house' ),
			'section'     => 'pet_house_topbar',
			'settings'    => 'pet_house_topbar',
			'type'        => 'checkbox'
		) 
	);

    $wp_customize->add_setting('pet_house_topbar_text',array(
		'default'=> '100% Secure Delivery Without Contacting The Courier.',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('pet_house_topbar_text',array(
		'label'	=> __('Topbar Text','pet-house'),
		'section'=> 'pet_house_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting( 
		'pet_house_currency_switcher' , 
			array(
			'default' => true,
			'sanitize_callback' => 'pet_house_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'pet_house_currency_switcher', 
		array(
			'label'	      => esc_html__( 'Show / Hide Currency Switcher', 'pet-house' ),
			'section'     => 'pet_house_topbar',
			'settings'    => 'pet_house_currency_switcher',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting( 
		'pet_house_cart_language_translator' , 
			array(
			'default' => true,
			'sanitize_callback' => 'pet_house_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'pet_house_cart_language_translator', 
		array(
			'label'	      => esc_html__( 'Show / Hide Language Translator Option', 'pet-house' ),
			'section'     => 'pet_house_topbar',
			'settings'    => 'pet_house_cart_language_translator',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting('pet_house_category_text',array(
		'default' => 'Select Category',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'pet_house_category_text', array(
	   'settings' => 'pet_house_category_text',
	   'section'   => 'pet_house_topbar',
	   'label' => __('Add Category Text', 'pet-house'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('pet_house_product_category_number',array(
		'default' => '',
		'sanitize_callback' => 'pet_house_sanitize_number_absint',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'pet_house_product_category_number', array(
	   'settings' => 'pet_house_product_category_number',
	   'section'   => 'pet_house_topbar',
	   'label' => __('Add Category Limit', 'pet-house'),
	   'type'      => 'number'
	));

	$wp_customize->add_setting( 'pet_house_upgrade_page_settings_99',
	array(
		'sanitize_callback' => 'sanitize_text_field'
		)
	);
	$wp_customize->add_control( new Pet_House_Control_Upgrade(
		$wp_customize, 'pet_house_upgrade_page_settings_99',
			array(
				'priority'      => 200,
				'section'       => 'pet_house_topbar',
				'settings'      => 'pet_house_upgrade_page_settings_99',
				'label'         => __( 'Pet House Pro comes with additional features.', 'pet-house' ),
				'choices'       => array( __( '15+ Ready-Made Sections', 'pet-house' ), __( 'One-Click Demo Import', 'pet-house' ), __( 'WooCommerce Integrated', 'pet-house' ), __( 'Drag & Drop Section Reordering', 'pet-house' ),__( 'Advanced Typography Control', 'pet-house' ),__( 'Intuitive Customization Options', 'pet-house' ),__( '24/7 Support', 'pet-house' ), )
			)
		)
	); 

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