<?php
    $wp_customize->remove_control('header_image');
   
	$wp_customize->add_section('constructionarc_header', array(
		'title'		=>	esc_html__('Header Layout','construction-arc'),
		'panel'		=> 'constructionarc_header_settings',
	));
    $wp_customize->add_setting('constructionarc_header_nav', array(
        'transport' => 'postMessage',
        'sanitize_callback' => 'wp_kses_post',
        'priority' => -1,
    ));
    $wp_customize->add_control(new constructionarc_Custom_Control_Tab($wp_customize, 'constructionarc_header_nav', array(
        'type' => 'tab',
        'section' => 'constructionarc_header',
        'buttons' => array(
            array(
                'name' => esc_html__('Content', 'construction-arc'),
                'fields' => array(
                    'constructionarc_header_layout',
                    'constructionarc_menu_sidebar',
                    'constructionarc_enable_search',
                ),
                'active' => true,
            ),
            array(
                'name' => esc_html__('Style', 'construction-arc'),
                'fields' => array(
                ),
            ),
            array(
                'name' => esc_html__('Menu Style', 'construction-arc'),
                'fields' => array(
                    'constructionarc_header_full_nav_bg_color',
                    'constructionarc_menu_seperator',
                    'constructionarc_menu_item_color',
                    'constructionarc_menu_item_link_color',
                    'constructionarc_menu_bg_color',
                    'constructionarc_submenu_seperator',
                    'constructionarc_submenu_bg_color',
                    'constructionarc_submenu_item_color',
                    'constructionarc_submenu_item_link_color',
                    'constructionarc_submenu_item_bg_color',
                )
            )
        ),
    )));
		
    $wp_customize->add_setting('constructionarc_header_layout', array(
        'default' => 'layout_two',
        'sanitize_callback' => 'constructionarc_themes_sanitize_select'       
    ));
    $wp_customize->add_control('constructionarc_header_layout', array(
        'label' => esc_html__('Header Layout', 'construction-arc'),
        'section' => 'constructionarc_header',
        'type' => 'select',
        'choices' => array(
            'layout_one' => esc_html__('Layout One' , 'construction-arc'),
            'layout_two' => esc_html__('Layout Two' ,'construction-arc')
        )
    ));

    $wp_customize->add_setting('constructionarc_enable_search', array(
        'default' => 'enable',
        'transport' => 'postMessage',
        'sanitize_callback' => 'constructionarc_themes_sanitize_switch',    
    ));
    $wp_customize->add_control(new constructionarc_Switch_Control($wp_customize, 'constructionarc_enable_search', array(
        'label' => esc_html__('Header Search', 'construction-arc'),
        'section' => 'constructionarc_header',
        'switch_label' => array(
            'enable' => esc_html__('Enable', 'construction-arc'),
            'disable' => esc_html__('Disable', 'construction-arc'),
        ),
    )));


    /** Menu Style */
    $wp_customize->add_setting("constructionarc_header_full_nav_bg_color", array(
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage',
        'default' => ''
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control($wp_customize, 
        "constructionarc_header_full_nav_bg_color", 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('Full Menu Background', 'construction-arc')
        )
    ));

    $wp_customize->add_setting('constructionarc_menu_seperator', array(
        'sanitize_callback' => 'constructionarc_sanitize_text'
    ));
    $wp_customize->add_control(new constructionarc_Separator_Control( $wp_customize, 
        'constructionarc_menu_seperator', array(
        'section' => 'constructionarc_header'
    )));
    
    $wp_customize->add_setting('constructionarc_menu_item_color', array(
        'default' => '',
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control( $wp_customize, 
        'constructionarc_menu_item_color', 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('Menu Link Color', 'construction-arc')
        )
    ));
    
    $wp_customize->add_setting('constructionarc_menu_item_link_color', array(
        'default' => '',
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control( $wp_customize, 
        'constructionarc_menu_item_link_color', 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('Menu Link Color - Hover', 'construction-arc')
        )
    ));
    
    $wp_customize->add_setting('constructionarc_menu_bg_color', array(
        'default' => '',
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control( $wp_customize, 
        'constructionarc_menu_bg_color', 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('Background Color - Hover', 'construction-arc')
        )
    ));
    
    $wp_customize->add_setting('constructionarc_submenu_seperator', array(
        'sanitize_callback' => 'constructionarc_sanitize_text'
    ));
    $wp_customize->add_control(new constructionarc_Separator_Control( $wp_customize, 
        'constructionarc_submenu_seperator', array(
        'section' => 'constructionarc_header'
    )));

    $wp_customize->add_setting('constructionarc_submenu_bg_color', array(
        'default' => '',
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control( $wp_customize, 
        'constructionarc_submenu_bg_color', 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('Submenu Background Color', 'construction-arc')
        )
    ));

    $wp_customize->add_setting('constructionarc_submenu_item_color', array(
        'default' => '',
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control( $wp_customize, 
        'constructionarc_submenu_item_color', 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('SubMenu Link Color', 'construction-arc')
        )
    ));
    
    $wp_customize->add_setting('constructionarc_submenu_item_link_color', array(
        'default' => '',
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control( $wp_customize, 
        'constructionarc_submenu_item_link_color', 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('SubMenu Link Color - Hover', 'construction-arc')
        )
    ));
    
    $wp_customize->add_setting('constructionarc_submenu_item_bg_color', array(
        'default' => '',
        'sanitize_callback' => 'constructionarc_themes_sanitize_color_alpha',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control(new constructionarc_Alpha_Color_Control( $wp_customize, 
        'constructionarc_submenu_item_bg_color', 
        array(
            'section' => 'constructionarc_header',
            'label' => esc_html__('SubMenu Item BG Color - Hover', 'construction-arc')
        )
    ));

    $wp_customize->selective_refresh->add_partial( 'constructionarc_header_layout', array (
        'settings' => array( 
            'constructionarc_enable_search',
            'constructionarc_header_bg_type',
        ),
        'selector' => '#masthead',
        'container_inclusive' => true,
        'render_callback' => function () {
            $layout = get_theme_mod('constructionarc_header_layout','layout_two');
            return get_template_part('header/header', str_replace("layout_","", $layout));
        }
    ));


$wp_customize->add_setting('constructionarc_pro_main_header', array(
    'sanitize_callback' => 'constructionarc_sanitize_text'
));
$wp_customize->add_control(new constructionarc_Themes_Upgrade_Text($wp_customize, 'constructionarc_pro_main_header', array(
    'section' => 'constructionarc_header',
    'label' => esc_html__('For More Settings,', 'construction-arc'),
    'choices' => array(
        esc_html__('Six(6) different header layouts', 'construction-arc'),
        esc_html__('Advanced user friendly customizer', 'construction-arc'),
        esc_html__('Select background options ( color / gradient / image )', 'construction-arc'),
        esc_html__('Show/Hide sticky menu', 'construction-arc'),
        esc_html__('Change title & info color', 'construction-arc'),
        esc_html__('Change Menu Wrapper color', 'construction-arc'),
        esc_html__('Change Menu Hover/Active Color', 'construction-arc'),
        esc_html__('Seven(7) Menu Hover Styles', 'construction-arc'),
    ),
    'priority' => 250,
)));