<?php

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

	/*********************
		Header settings.
		*******************/
		
		$wp_customize->add_section(
			'poster_theme_header_options',
			array(
				'title'       => __( 'Header Settings', 'poster' ),
				'capability'  => 'edit_theme_options',
				'description' => __( 'Customize Theme Header', 'poster' ),
				'priority'    => apply_filters( 'poster_theme_header_options_priority', 160 ),
			)
		);
		$wp_customize->add_setting(
				'poster_header_heading',
				array(
					'sanitize_callback' => 'wp_kses',
				));

			$wp_customize->add_control(
				new poster_Customizer_Heading_Control(
					$wp_customize,
					'poster_header_heading',
					array(
						'label'    => esc_html__( 'Choose Header Style', 'poster' ),
						'section'  => 'poster_theme_header_options',
						'priority' => 15,
					)));
	$wp_customize->add_setting(
			'poster_header_style',
			array(
				'default'           => 'stylefour',
				'type'              => 'theme_mod',
				'sanitize_callback' => 'poster_customize_sanitize_select',
				'capability'        => 'edit_theme_options',
			)
		);

		$wp_customize->add_control(
			new poster_Image_Radio_Control(
				$wp_customize,
				'poster_header_style',
				array(
					'label'       => __( 'Header Style', 'poster' ),
					'description' => __( 'Choose Theme Header Style. After Choosing & Public You need to REFRESH Website', 'poster' ),
					'section'     => 'poster_theme_header_options',
					'choices'     => array(
						'styleone'  => get_template_directory_uri() . '/images/headers/headerstyleone.png',
						'styletwo' => get_template_directory_uri() . '/images/headers/headerstyletwo.png',
						'stylethree' => get_template_directory_uri() . '/images/headers/headerstylethree.png',
						'stylefour' => get_template_directory_uri() . '/images/headers/headerstylefour.png',
						'stylefive' => get_template_directory_uri() . '/images/headers/headerstylefive.png',
					),
					'priority'    => apply_filters( 'poster_header_style_priority', 20 ),
				)
			));
			
			$wp_customize->add_setting(
				'poster_styletwo_heading',
				array(
					'sanitize_callback' => 'wp_kses',
				));

			$wp_customize->add_control(
				new poster_Customizer_Heading_Control(
					$wp_customize,
					'poster_styletwo_heading',
					array(
						'label'    => esc_html__( 'Header Settings', 'poster' ),
						'section'  => 'poster_theme_header_options',
						'priority' => 25,
					)));
			$wp_customize->add_setting(
				'poster_navbar_type',
				array(
					'default'           => 'collapse',
					'type'              => 'theme_mod',
					'sanitize_callback' => 'poster_customize_sanitize_select',
					'capability'        => 'edit_theme_options',
				));
	
			$wp_customize->add_control(
				new WP_Customize_Control(
					$wp_customize,
					'poster_navbar_type',
					array(
						'label'       => __( 'Responsive Navigation Type', 'poster' ),
						'description' => __(
							'Choose between an expanding and collapsing navbar or an offcanvas drawer.',
							'poster'
						),
						'section'     => 'poster_theme_header_options',
						'type'        => 'select',
						'choices'     => array(
							'collapse'  => __( 'Collapse', 'poster' ),
							'offcanvas' => __( 'Offcanvas', 'poster' ),
						),
						'priority'    => apply_filters( 'poster_styletwo_heading_priority', 35 ),
					)));
		//hero under menu
		$wp_customize->add_setting('poster_heroarea',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_heroarea',
			 array (                             
				'type' => 'radio',
				'label' => __('Setting For This Header Style','poster'),
				'description'        => __( 'Hero & Slider Area Under Menu', 'poster' ),
				'settings'   => 'poster_heroarea',
				'section' => 'poster_theme_header_options',
				'choices' => array(
					'enable' => __('Under Menu','poster'),
					'disable' => __('Clear Menu','poster'),
				 ),
				 'priority'    => apply_filters( 'poster_styletwo_heading_priority', 40 ),
				 'active_callback' => 'poster_header_selected_styletwo',
			 ));
			 
		//hero under menu
		$wp_customize->add_setting('poster_stickymenu',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_stickymenu',
			 array (                             
				'type' => 'radio',
				'description'        => __( 'Sticky Menu', 'poster' ),
				'settings'   => 'poster_stickymenu',
				'section' => 'poster_theme_header_options',
				'choices' => array(
					'sticky-top' => __('Enable','poster'),
					'nonfixed' => __('Disable','poster'),
				 ),
				 'priority'    => apply_filters( 'poster_styletwo_heading_priority', 30 ),
				 'active_callback' => 'poster_header_selected_styletwo',
			 ));
			 $wp_customize->add_setting('poster_styletwo_logosize', array(
				'default'           => 10,
				'transport'         => 'refresh',
				'sanitize_callback' => 'absint', // Sanitize as integer
			));
	
			$wp_customize->add_control('poster_styletwo_logosize', array(
				'type'        => 'range',
				'section'     => 'poster_theme_header_options',
				'settings'    => 'poster_styletwo_logosize',
				'description' => __('Logo Size in Percentage (%)', 'poster'),
				'active_callback' => 'poster_header_selected_styletwo',
				'priority' => 30,
				'input_attrs' => array(
					'min'  => 1,
					'max'  => 100,
					'step' => 5,
				),
			));	 
			
			//Home icon
					$wp_customize->add_setting('poster_homeicon',	
					array(
						'default'			=> true,
						'type'				=> 'theme_mod',
						'capability'		=> 'edit_theme_options',
						'sanitize_callback'	=> 'poster_customize_sanitize_checkbox'
					));
				$wp_customize->add_control('poster_homeicon',
					array (                             
						'type'    => 'checkbox',
						'label' => __('Home Icon','poster'),
						'description'        => __( 'Display Home Icon in Menu', 'poster' ),
						'settings'   => 'poster_homeicon',
						'section' => 'poster_theme_header_options',
						'priority'    => apply_filters( 'poster_homeicon_priority', 45 ),
					));
			
		$wp_customize->add_setting('poster_styletwo_headingcolor',
				array(
					'sanitize_callback' => 'wp_kses',
				));

		$wp_customize->add_control(	new poster_Customizer_Heading_Control(
					$wp_customize,
					'poster_styletwo_headingcolor',
					array(
						'label'    => esc_html__( 'Colors', 'poster' ),
						'section'  => 'poster_theme_header_options',
						 'priority'    => apply_filters( 'poster_styletwo_headingcolor_priority', 35 ),
					)));	 
		$wp_customize->add_setting( 'poster_heroarea_links' , array(
			'default'     => '#343434',
			'transport'   => 'refresh',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_heroarea_links', array(
			'description'        => __( 'Menu Link Color', 'poster' ),
			'section'    => 'poster_theme_header_options',
			'settings'   => 'poster_heroarea_links',
			'priority'    => apply_filters( 'poster_styletwo_heading_priority', 40 ),			
			'active_callback' => 'poster_header_selected_styletwo',
		) ) );		 
		$wp_customize->add_setting( 'poster_heroarea_links_hover' , array(
			'default'     => '#FF9800',
			'transport'   => 'refresh',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_heroarea_links_hover', array(
			'description'        => __( 'Menu Link Hover Color ', 'poster' ),
			'section'    => 'poster_theme_header_options',
			'settings'   => 'poster_heroarea_links_hover',
			'priority'    => apply_filters( 'poster_styletwo_heading_priority', 40 ),		
			'active_callback' => 'poster_header_selected_styletwo',
		) ) );
		
			//top menu bg
		$wp_customize->add_setting( 'poster_topnavbgcolor' , array(
			'default'     => '#3387d0',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_topnavbgcolor', array(
		'label'        => __( 'Top Navigation (Pro Only)', 'poster' ),
		'description'        => __( 'Top Navigation Background Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_topnavbgcolor',
		'priority'    => apply_filters( 'poster_topnavbgcolor_priority', 40 ),
		'active_callback' => 'poster_header_selected_styleone',
		) ) );	
		// top menu hover						
		$wp_customize->add_setting( 'poster_topnavhover' , array(
			'default'     => '#359BED',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_topnavhover', array(
		'description'        => __( 'Top Navigation Hover', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_topnavhover',
		'priority'    => apply_filters( 'poster_topnavhover_priority', 40 ),
		'active_callback' => 'poster_header_selected_styleone',
		) ) );
		// top menu text color						
		$wp_customize->add_setting( 'poster_topnavtext' , array(
			'default'     => '#fcfcfc',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );

			$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_topnavtext', array(
			'description'  => __( 'Top Navigation Text', 'poster' ),
			'section'    => 'poster_theme_header_options',
			'settings'   => 'poster_topnavtext',
			'priority'    => apply_filters( 'poster_topnavtext_priority', 50 ),
			'active_callback' => 'poster_header_selected_styleone',
			) ) );
			
		
		//Primary menu
		$wp_customize->add_setting( 'poster_primarymenubg' , array(
			'default'     => '#485561',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenubg', array(
		'label'        => __( 'Primary Navigation Menu Background Color (Pro Only)', 'poster' ),
		'description'        => __( 'First Color ', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenubg',
		'priority'    => apply_filters( 'poster_primarymenubg_priority', 60 ),
		'active_callback' => 'poster_header_selected_styleone',
		) ) );
		$wp_customize->add_setting( 'poster_primarymenubgs' , array(
			'default'     => '#56636f',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenubgs', array(
		'description'        => __( 'Second Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenubgs',
		'priority'    => apply_filters( 'poster_topnavbgcolor_priority', 60 ),
		'active_callback' => 'poster_header_selected_styleone',
		) ) );	
		
		//Primary menu text
		$wp_customize->add_setting( 'poster_primarymenutext' , array(
			'default'     => '#ffffff',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenutext', 
		array(
		'description'        => __( 'Primary Navigation Background Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenutext',
		'priority'    => apply_filters( 'poster_primarymenutext_priority', 70 ),
		'active_callback' => 'poster_header_selected_styleone',
		) ) );		
		//Primary menu text Hover
		$wp_customize->add_setting( 'poster_primarymenuhover' , array(
			'default'     => '#359BED',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenuhover', array(
		'description'        => __( 'Primary Navigation Hover', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenuhover',
		'priority'    => apply_filters( 'poster_primarymenuhover_priority', 90 ),	
		) ) );	
		$wp_customize->add_setting( 'poster_primarymenuhovertext' , array(
			'default'     => '#f3f3f3',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenuhovertext', array(
		'description'        => __( 'Primary Navigation Hover', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenuhovertext',
		'priority'    => apply_filters( 'poster_primarymenuhovertext_priority', 100 ),
		) ) );
		
		/************
		* Header Style Three
		*********/		
		
		$wp_customize->add_setting(
			'poster_topnavi_leftthree',
			array(
				'default'           => '<i class="fa fa-mobile" aria-hidden="true"></i> +123456789',
				'type'              => 'theme_mod',
				'sanitize_callback' => 'wp_kses_post',
				'capability'        => 'edit_theme_options',
			));
		$wp_customize->add_control(
			new WP_Customize_Control(
				$wp_customize,
				'poster_topnavi_leftthree',
				array( 
					'label'       => __( 'Top Navi Left Side HTML Allowed', 'poster' ),
					'section'     => 'poster_theme_header_options',
					'type'        => 'textarea',
					'priority'    => 60,
				)));
		$wp_customize->add_setting(
			'poster_topnavi_rightthree',
			array(
				'default'           => 'Get The Latest Offers On Our Products',
				'type'              => 'theme_mod',
				'sanitize_callback' => 'wp_kses_post',
				'capability'        => 'edit_theme_options',
			));
		$wp_customize->add_control(
			new WP_Customize_Control(
				$wp_customize,
				'poster_topnavi_rightthree',
				array( 
					'label'       => __( 'Top Navi Right Side HTML Allowed', 'poster' ),
					'section'     => 'poster_theme_header_options',
					'type'        => 'textarea',
					'priority'    => 60,
				)));
			$wp_customize->add_setting('poster_topnavi_enablethree',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_topnavi_enablethree',
				array (                             
				'type' => 'radio',
				'label' => __('Enable or Disable Top Bar','poster'),
				'settings'   => 'poster_topnavi_enablethree',
				'section' => 'poster_theme_header_options',
				'transport'   => 'refresh',
				'choices' => array(
					'enable' => __('Enable','poster'),
					'disable' => __('Disable','poster'),
					),
					'priority'    => apply_filters( 'poster_topnavi_enablethree', 65 ),
				));	
		//Top Navi bg
		$wp_customize->add_setting( 'poster_topnavibg_three' , array(
			'default'     => '#3e4451',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_topnavibg_three', 
		array(
		'label'        => __( 'Color (Pro Only)', 'poster' ),
		'description'        => __( 'Top Bar Background Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_topnavibg_three',
		'priority'    => apply_filters( 'poster_primarymenutext_priority', 70 ),
		) ) );
		//Top Navi text
		$wp_customize->add_setting( 'poster_topnavitext_three' , array(
			'default'     => '#e0e0e0',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_topnavitext_three', 
		array(
		'description'        => __( 'Top Bar Text Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_topnavitext_three',
		'priority'    => apply_filters( 'poster_primarymenutext_priority', 75 ),

		) ) );
		//Primary Background Color
		$wp_customize->add_setting( 'poster_primarymenubg_three' , array(
			'default'     => '#ffffff',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenubg_three', 
		array(
		'description'        => __( 'Primary Navigation Background Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenubg_three',
		'priority'    => apply_filters( 'poster_primarymenubg_three_priority', 80 ),
		) ) );
		//Primary menu text
		$wp_customize->add_setting( 'poster_primarymenutext_three' , array(
			'default'     => '#2f2b2b',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenutext_three', 
		array(
		'description'        => __( 'Primary Navigation Text Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenutext_three',
		'priority'    => apply_filters( 'poster_primarymenutext_priority', 80 ),
		) ) );
		//Primary menu text hover
		$wp_customize->add_setting( 'poster_primarymenutexthover_three' , array(
			'default'     => '#3d951e',
			'transport'   => 'postMessage',
			'sanitize_callback'	=> 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'poster_primarymenutexthover_three', 
		array(
		'description'        => __( 'Primary Navigation Text Hover Color', 'poster' ),
		'section'    => 'poster_theme_header_options',
		'settings'   => 'poster_primarymenutexthover_three',
		'priority'    => apply_filters( 'poster_primarymenutext_priority', 85 ),
		) ) );