<?php
/**
 * Header Layout
 * @package Solar Energy Engine
 */

$solar_energy_engine_default = solar_energy_engine_get_default_theme_options();
?>

<?php
$solar_energy_engine_sticky = get_theme_mod('solar_energy_engine_sticky');
    $solar_energy_engine_data_sticky = "false";
    if ($solar_energy_engine_sticky) {
    $solar_energy_engine_data_sticky = "true";
    }
    global $wp_customize;
?>
<header id="site-header" class="site-header-layout header-layout" role="banner">
    <div class="header-navbar <?php if( is_user_logged_in() && !isset( $wp_customize ) ){ echo "login-user";} ?>" data-sticky="<?php echo esc_attr($solar_energy_engine_data_sticky); ?>">
        <div class="wrapper header-wrapper">
            <div class="theme-header-areas header-areas-left">
                <div class="header-titles">
                    <?php
                    solar_energy_engine_site_logo();
                    solar_energy_engine_site_description();
                    ?>
                </div>
            </div>
            <?php $solar_energy_engine_header_social_ed = get_theme_mod( 'solar_energy_engine_header_social_ed', $solar_energy_engine_default['solar_energy_engine_header_social_ed'] ); 
                if( $solar_energy_engine_header_social_ed ){ ?>
                <div class="theme-header-areas header-areas-left">
                    <div class="social-media">
                        <?php $solar_energy_engine_header_center_facebook = esc_url( get_theme_mod( 'solar_energy_engine_header_center_facebook',$solar_energy_engine_default['solar_energy_engine_header_center_facebook'] ) );
                            if( $solar_energy_engine_header_center_facebook ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $solar_energy_engine_header_center_facebook ); ?>"><span class="dashicons dashicons-facebook-alt"></span></a>
                        <?php } ?>
                        <?php $solar_energy_engine_header_center_twitter = esc_url( get_theme_mod( 'solar_energy_engine_header_center_twitter',$solar_energy_engine_default['solar_energy_engine_header_center_twitter'] ) );
                            if( $solar_energy_engine_header_center_twitter ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $solar_energy_engine_header_center_twitter ); ?>"><span class="dashicons dashicons-twitter"></span></a>
                        <?php } ?>
                        <?php $solar_energy_engine_header_center_linkedin = esc_url( get_theme_mod( 'solar_energy_engine_header_center_linkedin',$solar_energy_engine_default['solar_energy_engine_header_center_linkedin'] ) );
                            if( $solar_energy_engine_header_center_linkedin ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $solar_energy_engine_header_center_linkedin ); ?>"><span class="dashicons dashicons-linkedin"></span></a>
                        <?php } ?>
                        <?php $solar_energy_engine_header_center_instagram = esc_url( get_theme_mod( 'solar_energy_engine_header_center_instagram',$solar_energy_engine_default['solar_energy_engine_header_center_instagram'] ) );
                            if( $solar_energy_engine_header_center_instagram ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $solar_energy_engine_header_center_instagram ); ?>"><span class="dashicons dashicons-instagram"></span></a>
                        <?php } ?>
                        <?php $solar_energy_engine_header_center_youtube = esc_url( get_theme_mod( 'solar_energy_engine_header_center_youtube',$solar_energy_engine_default['solar_energy_engine_header_center_youtube'] ) );
                            if( $solar_energy_engine_header_center_youtube ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $solar_energy_engine_header_center_youtube ); ?>"><span class="dashicons dashicons-youtube"></span></a>
                        <?php } ?>
                    </div>
                </div>
            <?php } ?>
            <div class="theme-header-areas header-areas-right">
                <div class="site-navigation">
                    <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e('Horizontal', 'solar-energy-engine'); ?>" role="navigation">
                        <ul class="primary-menu theme-menu">
                            <?php
                            if (has_nav_menu('solar-energy-engine-primary-menu')) {
                                wp_nav_menu(
                                    array(
                                        'container' => '',
                                        'items_wrap' => '%3$s',
                                        'theme_location' => 'solar-energy-engine-primary-menu',
                                    )
                                );
                            } else {
                                wp_list_pages(
                                    array(
                                        'match_menu_classes' => true,
                                        'show_sub_menu_icons' => true,
                                        'title_li' => false,
                                        'walker' => new solar_energy_engine_Walker_Page(),
                                    )
                                );
                            } ?>
                        </ul>
                    </nav>
                </div>
                <div class="navbar-controls twp-hide-js">
                    <button type="button" class="navbar-control navbar-control-offcanvas">
                        <span class="navbar-control-trigger" tabindex="-1">
                            <?php solar_energy_engine_the_theme_svg('menu'); ?>
                        </span>
                    </button>
                </div>
            </div>
            <?php
            $solar_energy_engine_header_button_ed = get_theme_mod( 'solar_energy_engine_header_button_ed', $solar_energy_engine_default['solar_energy_engine_header_button_ed'] ); 
                if( $solar_energy_engine_header_button_ed ){ ?>
                <div class="theme-header-areas header-areas-right">
                    <?php $solar_energy_engine_solar_energy_engine_header_layout_button_text = esc_html( get_theme_mod( 'solar_energy_engine_header_layout_button_text',$solar_energy_engine_default['solar_energy_engine_header_layout_button_text'] ) );
                        $solar_energy_engine_solar_energy_engine_header_layout_button_link = esc_html( get_theme_mod( 'solar_energy_engine_header_layout_button_link' ) );

                        if( $solar_energy_engine_solar_energy_engine_header_layout_button_text || $solar_energy_engine_solar_energy_engine_header_layout_button_link ){ ?>
                        <a href="<?php echo esc_url( $solar_energy_engine_solar_energy_engine_header_layout_button_link ); ?>" class="btn-fancy btn-fancy-primary"><?php echo esc_html( $solar_energy_engine_solar_energy_engine_header_layout_button_text ); ?></a>
                    <?php } ?>
                </div>
            <?php } ?>
        </div>
    </div>
</header>