<?php 
/**
 * The header Menu for our theme
 *
 * @package benqu
 */

$enable_top_bar = cs_get_option('enable_top_bar');
$header_top_date = cs_get_option('header_top_date');
$breakingnewtext = cs_get_option('breakingnewtext');
$enable_social_profile = cs_get_option('enable_social_profile');
$benqu_social_opt = cs_get_option('benqu_social_opt');
$enable_header_search = cs_get_option('enable_header_search');
$display_sidebar_nav = cs_get_option('display_sidebar_nav');
$hide_login = cs_get_option('hide_login');
$header_btn_info = cs_get_option('header-btn-info');
papyrfy_header_search_two();
?>
<header class="benqu-main-header pfy-header-2 pfy-header-4 header__6">

		<?php if(true == $enable_top_bar):?>
			<div class="pfy-top-bar" id="pfytopbar">
					<div class="container">
							<div class="row">
									<div class="col-12">
											<div class="pfy-top-left">
													<?php if($header_top_date == true):?>
													<div class="topbar-date">
															<span><i class="fal fa-calendar-alt"></i> <?php echo wp_date(get_option('date_format')); ?></span>
													</div>
													<?php endif;?>
													<div class="tp-news-ticker">
															<div class="breaking-heading"><i class="far fa-fire-alt"></i> <?php echo esc_html($breakingnewtext);?></div>
															<?php get_template_part( 'template-parts/breaking-news' );?>
													</div>
											</div>
									</div>
							</div>
					</div>
			</div>
    <?php endif;?>

    <div class="pfy-logo-wrap">
        <div class="container">
            <div class="header-menu-opt d-flex justify-content-between align-items-center">

								<?php if(true == $enable_social_profile): ?>
									<?php if(!empty($benqu_social_opt)): ?>
										<div class="social-info">
												<?php foreach($benqu_social_opt as $icon): ?>
												<a href="<?php echo esc_url($icon['link']); ?>"><i class="<?php echo esc_attr($icon['icon']);?>"></i></a>
												<?php endforeach;?>
										</div>
									<?php endif;?>
								<?php endif;?>

                <div class="pfy-logo d-flex align-items-center">
                    <?php benqu_logo(); benqu_light_logo();?>
                </div>

                <div class="menu-right d-flex align-items-center">
                    <?php if(class_exists('Woocommerce') ) : 
                        $benqu_cart_url = wc_get_cart_url();	
                    ?>
                        <a href="<?php echo esc_url($benqu_cart_url);?>" class="icon-box">
                            <i class="far fa-cart-arrow-down"></i>
                            <i class="total-cart widget_cart_counter"><?php echo sprintf (_n( '%d', '%d', WC()->cart->cart_contents_count, 'benqu' ), WC()->cart->cart_contents_count ); ?></i>
                        </a>
                    <?php endif;?>

										<?php if($enable_header_search == true): ?>
											<span class="pfy-search-btn"><i class="far fa-search"></i></span>
										<?php endif;?>

										<?php if($display_sidebar_nav == true): ?>
											<span class="pfy-sidebarnav"><img src="<?php echo get_template_directory_uri()?>/assets/img/nav.svg" alt="<?php esc_attr_e('Nav', 'benqu');?>"></span>
										<?php endif;?>
									</div>
            </div>
        </div>
    </div>

		<div id="stickyHeader" class="header-menu">
        <div class="container">
            <div class="row align-items-center">
                <div class="col-xl-8 col-lg-8 col-md-7">
                    <div class="mainmenu">
                        <div class="site-navigation">
                            <?php benqu_mainmenu();?>
                        </div>
                        <div class="hamburger_menu d-lg-none">
                            <a href="javascript:void(0);" class="active">
                                <div class="icon bar">
                                    <span><i class="far fa-bars"></i></span>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
                <div class="col-xl-4 col-lg-4 col-md-5">
                    <div class="header-right d-flex justify-content-end align-items-center">
                        <?php if($enable_header_search == true): ?>
													<div class="bnq-search">
															<?php benqu_header_search();?>
													</div>
                        <?php endif;?>

                        <?php if(!empty($header_btn_info['text']) && $hide_login == true):?>
                        <div class="menu-login-btn">
                            <a href="<?php echo esc_url($header_btn_info['url']);?>" class="pfy-btn pfy-btn-primery login-btn"><?php echo esc_html($header_btn_info['text']);?></a>                    
                        </div>
                        <?php endif;?>
                    </div>
                </div>
            </div>
        </div>
    </div>

</header>
<?php  get_template_part( 'inc/sidebar-nav' ); ?>
<div class="body-overlay"></div>
<?php  get_template_part( 'inc/mobile-menu' ); ?>
