<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Bussiness_Epic
 */
?><!doctype html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="http://gmpg.org/xfn/11">

    <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
}
else { do_action( 'wp_body_open' ); } ?>

<div id="page" class="site">
    <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e('Skip to content', 'business-epic') ?></a>
    <a href="#" class="scrollup"><i class="fa fa-long-arrow-up" aria-hidden="true"></i></a>
    <header id="masthead" class="site-header" role="banner">
        <!-- Start Top header Section -->
        <?php
        /**
         * The template for displaying all pages.
         *
         * This is the template that displays all pages by default.
         * Please note that this is the WordPress construct of pages
         * and that other 'pages' on your WordPress site may use a
         * different template.
         *
         * @link https://codex.wordpress.org/Template_Hierarchy
         *
         * @subpackage Business Epic
         */
        // retrieving Customizer Value
        $section_option = business_epic_get_option('business_epic_top_header_section');
        if ($section_option == 'show') {
            $mobile_icon = business_epic_get_option('business_epic_top_header_section_phone_number_icon');
            $mobile_value = business_epic_get_option('business_epic_top_header_phone_no');
            $email_icon = business_epic_get_option('business_epic_email_icon');
            $email_value = business_epic_get_option('business_epic_top_header_email');
            $social_menu = business_epic_get_option('business_epic_social_link_hide_option');
            ?>
            <div class="top-header">
                <div class="container">
                    <div class="row">


                        <!-- Start top contact info Section -->
                        <div class="col-xs-12 col-sm-6">
                            <div class="top-header-contact-info">

                                <?php
                                // echo  $mobile_icon;
                                if (!empty($mobile_value)) {
                                    ?>
                                    <a class="top-phone" href="<?php echo esc_url('tel:' . $mobile_value) ?>"><i
                                            class="fa  <?php echo esc_attr($mobile_icon); ?>"></i><?php echo esc_html($mobile_value); ?>
                                    </a>

                                <?php }

                                if (!empty($email_value)) {
                                    ?>
                                    <a class="top-email" href="<?php echo esc_url('mailto:' . $email_value); ?>"><i
                                            class="fa <?php echo esc_attr($email_icon); ?>"></i> <?php echo esc_html($email_value); ?>
                                    </a>
                                <?php } ?>
                            </div>
                        </div>
                        <!-- End top contact info Section -->


                        <!-- Start top social icon Section -->
                        <div class="col-xs-12 col-sm-6">
                            <div class="header-search">
                                <p class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></p>
                                <?php get_search_form(); ?>
                            </div>

                            <?php
                            if ($social_menu == 1) {

                                ?>
                                <div class="top-header-socialicon">

                                    <?php
                                    if (has_nav_menu('social-link')) {
                                        wp_nav_menu(array('theme_location' => 'social-link', 'menu_class' => 'menu', 'menu_id' => 'menu-social-menu'));

                                    }
                                    ?>

                                </div>

                            <?php } ?>
                        </div>
                        <!-- End top social icon Section -->


                    </div>
                </div>
            </div>
        <?php } ?>
        <!-- End Top header Section -->
        <!-- Start logo and menu Section -->
        <div class="main-header">
            <div class="container">
                <!-- Start Site title Section -->
                <div class="site-branding">
                    <h1 class="site-title">
                        <!-- <img src="images/logo.png" alt=""> -->
                        <?php
                        if (has_custom_logo()) { ?>
                            <a class="navbar-brand" href="<?php echo esc_url(home_url('/')); ?>">
                                <?php the_custom_logo(); ?>
                            </a>
                        <?php } else {
                        if (is_front_page() && is_home()) : ?>
                            <h1 class="site-title">
                                <a href="<?php echo esc_url(home_url('/')); ?>"
                                   rel="home"><?php bloginfo('name'); ?></a>
                            </h1>
                        <?php else : ?>
                            <p class="site-title">
                                <a href="<?php echo esc_url(home_url('/')); ?>"
                                   rel="home"><?php bloginfo('name'); ?></a>
                            </p>
                            <?php
                        endif;
                        ?>
                    </h1>
                    <?php
                    $description = get_bloginfo('description', 'display');
                    if ($description || is_customize_preview()) : ?>
                        <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
                        <?php
                    endif;
                    } ?>
                </div>
                <!-- End Site title Section -->
                <!-- Start Menu Section -->
                <div class="menu">
                    <!--<nav id="site-navigation" class="main-navigation" role="navigation"> -->
                    <div class="nav-wrapper">
                        <!-- for toogle menu -->
                        <div class="visible-xs visible-sm  clearfix"><span id="showbutton" class="clearfix"><img
                                    class="img-responsive grow"
                                    src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/button.png" alt=""/></span>
                        </div>
                        <div class=""></div>

                        <nav class="column-12 im-hiding">
                            <div class="clearfix">
                                <?php
                                if (has_nav_menu('primary')) {
                                    wp_nav_menu(array(
                                            'theme_location' => 'primary',
                                            'menu_class' => 'main-nav',
                                            'depth' => 4,

                                        )
                                    );
                                }
                                ?>
                        </nav>
                        <!-- / main nav -->
                    </div>
                    <!-- </nav> -->
                </div>
                <!-- End Menu Section -->

            </div>
        </div>
        <!-- End logo and menu Section -->
    </header>