<?php
/**
 * The header for our theme
 *
 * @package Consultancy Services
 */
?>
<!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="https://gmpg.org/xfn/11">
    <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
    <a class="skip-link screen-reader-text" href="#primary"><?php esc_html_e( 'Skip to content', 'consultancy-services' ); ?></a>

    <?php
    $consultancy_services_preloader_wrap = absint( get_theme_mod( 'consultancy_services_enable_preloader', 0 ) );
    if ( $consultancy_services_preloader_wrap === 1 ) : ?>
        <div id="loader">
            <div class="loader-container">
                <div id="preloader" class="loader-2">
                    <div class="dot"></div>
                </div>
            </div>
        </div>
    <?php endif; ?>

    <header id="masthead" class="site-header">
            <div class="headermain">
                <div class="header-info-box">
                    <?php if (get_theme_mod('consultancy_services_show_topbar', 0)) : ?>
                        <div class="top-head">
                            <div class="container">
                                <div class="flex-row">
                                    <div class="top-left">
                                        <?php if ( get_theme_mod( 'consultancy_services_header_info_email','support@example.com' ) ) : ?>
                                            <span class="main-box mail">
                                                <i class="far fa-envelope"></i><a class="top-detail" href="mailto:<?php echo esc_attr( get_theme_mod( 'consultancy_services_header_info_email','support@example.com' ) ); ?>">
                                                    <?php echo esc_html( get_theme_mod( 'consultancy_services_header_info_email','support@example.com' ) ); ?>
                                                </a>
                                            </span>
                                        <?php endif; ?>
                                        <?php if (get_theme_mod('consultancy_services_add_location','09N Steet Name, New York.') !== '') : ?>
                                            <span class="location">
                                                <i class="far fa-eye"></i><span class="top-detail"><?php echo esc_html(get_theme_mod('consultancy_services_add_location', '09N Steet Name, New York.')); ?></span>
                                            </span>
                                        <?php endif; ?>
                                        <?php if (get_theme_mod('consultancy_services_header_info_time','Mon To Fri - 8 am To 7 pm.')): ?>
                                            <span class="address">
                                                <i class="far fa-clock"></i><span class="top-detail"><?php echo esc_html(get_theme_mod('consultancy_services_header_info_time','Mon To Fri - 8 am To 7 pm.')); ?></span>
                                            </span>
                                        <?php endif; ?>
                                        <span class="translate-btn">
                                            <?php if (get_theme_mod('consultancy_services_cart_language_translator', true) && class_exists('GTranslate')) : ?>
                                                <div class="translate-lang position-relative d-md-inline-block">
                                                    <?php echo wp_kses_post(do_shortcode('[gtranslate]')); ?>
                                                </div>
                                            <?php endif; ?>
                                        </span>
                                    </div>
                                    <div class="top-right">
                                        <div class="product-search">
                                            <form method="get" class="product-search" action="<?php echo esc_url(home_url('/')); ?>">
                                                <label for="product-search-field" class="screen-reader-text"><?php esc_html_e('Search Here', 'consultancy-services'); ?></label>
                                                <input type="search" id="product-search-field" class="search-field" placeholder="<?php esc_attr_e('Search...', 'consultancy-services'); ?>" value="<?php echo esc_attr(get_search_query()); ?>" name="s" />
                                                <input type="hidden" name="post_type" value="product" />
                                                <button type="submit">
                                                    <span class="search-icon" aria-hidden="true"><i class="fas fa-search"></i></span>
                                                    <span class="screen-reader-text"><?php esc_html_e('Search', 'consultancy-services'); ?></span>
                                                </button>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php endif; ?>

                    <?php 
                        $consultancy_services_has_header_image = has_header_image();

                        if ( $consultancy_services_has_header_image ) {
                            $consultancy_services_header_image_url = esc_url( get_header_image() );
                        } else {
                            $consultancy_services_header_image_url = '';
                        }
                    ?>
                    <div class="header-menu-box" style="background-image: url('<?php echo $consultancy_services_header_image_url; ?>'); background-repeat: no-repeat; background-size: cover;">
                        <div class="container">
                            <div class="middle-box">
                                <div class="flex-row">
                                    <div class="middle-left">
                                        <div class="site-branding">
                                            <?php
                                            if ( function_exists( 'the_custom_logo' ) ) {
                                                the_custom_logo();
                                            }
                                            if ( is_front_page() && is_home() ) :
                                                if ( get_theme_mod( 'consultancy_services_site_title_text', true ) ) : ?>
                                                    <h1 class="site-title">
                                                        <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
                                                    </h1>
                                                <?php endif;
                                            else :
                                                if ( get_theme_mod( 'consultancy_services_site_title_text', true ) ) : ?>
                                                    <p class="site-title">
                                                        <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
                                                    </p>
                                                <?php endif;
                                            endif;
                                            $consultancy_services_description = get_bloginfo( 'description', 'display' );
                                            if ( $consultancy_services_description || is_customize_preview() ) :
                                                if ( get_theme_mod( 'consultancy_services_site_tagline_text', false ) ) : ?>
                                                    <p class="site-description"><?php echo esc_html( $consultancy_services_description ); ?></p>
                                                <?php endif;
                                            endif; ?>
                                        </div>
                                    </div>
                                    <div class="middle-right">
                                        <div class="menucontent">
                                            <div class="nav-menu-header">
                                                <nav id="site-navigation" class="main-navigation">
                                                    <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
                                                        <span class="screen-reader-text"><?php esc_html_e( 'Primary Menu', 'consultancy-services' ); ?></span>
                                                        <i class="fas fa-bars"></i>
                                                    </button>
                                                    <?php
                                                    wp_nav_menu( array(
                                                        'theme_location' => 'menu-1',
                                                        'menu_id'        => 'primary-menu',
                                                    ) );
                                                    ?>
                                                </nav>
                                            </div>
                                        </div>
                                        <div class="header-menu-right">
                                          <?php if (get_theme_mod('consultancy_services_header_link','#') || get_theme_mod('consultancy_services_header_button','Get In Touch')) : ?>
                                            <span class="header-btn text-center">
                                              <a href="<?php echo esc_url(get_theme_mod('consultancy_services_header_link','#')); ?>" class="book-appoin"><i class="fas fa-arrow-right"></i><?php echo esc_html(get_theme_mod('consultancy_services_header_button','Get In Touch')); ?></a>
                                            </span>
                                          <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            </div>  
                            
                        </div>
                    </div> 
                    <div class="notifaction-main" >
                        <div class="flex-row">
                            <div class="last-left"></div>
                            <?php 
                            $consultancy_services_note = get_theme_mod( 'consultancy_services_add_note' );
                            $consultancy_services_help_link = get_theme_mod( 'consultancy_services_help_center_link' );
                            $consultancy_services_btn_link = get_theme_mod( 'consultancy_services_sec_header_button_link' );
                            $consultancy_services_btn_text = get_theme_mod( 'consultancy_services_sec_header_button_text', 'Get More Info.' );

                            // Check if we should show the section at all
                            if ( ! empty( $consultancy_services_note ) || ! empty( $consultancy_services_help_link ) || ( $consultancy_services_btn_link && $consultancy_services_btn_text ) ) :
                            ?>
                            <div class="last-right" style="background-image: url('<?php echo get_stylesheet_directory_uri(); ?>/revolution/assets/images/header-bg.png');">
                                <div class="head-border">
                                    <?php if ( ! empty( $consultancy_services_note ) || ! empty( $consultancy_services_help_link ) ) : ?>
                                    <span class="abt-btn">
                                        <span class="text-center" href="<?php echo esc_url( $consultancy_services_help_link ); ?>">
                                            <?php if ( ! empty( $consultancy_services_note ) ) : ?>
                                                <span class="note"><?php echo esc_html__( 'Note:', 'consultancy-services' ); ?></span>
                                                <span class="note-text"><?php echo ' ' . esc_html( $consultancy_services_note ); ?></span>
                                            <?php endif; ?>
                                        </span>
                                    </span>
                                    <?php endif; ?>

                                    <?php if ( $consultancy_services_btn_link && $consultancy_services_btn_text ) : ?>
                                    <span class="sec-header-btn">
                                        <a href="<?php echo esc_url( $consultancy_services_btn_link ); ?>" class="get-info"><?php echo esc_html( $consultancy_services_btn_text ); ?></a>
                                    </span>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
    </header>
</div>