<?php
/**
 * The template part for Top Header
 *
 * @package VW Bakers 
 * @subpackage vw-bakers
 * @since vw-bakers 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'vw_bakers_sticky_header', false) == 1 || get_theme_mod( 'vw_bakers_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="topbar">
    <?php if (get_theme_mod('vw_bakers_hide_show_topbar_section', true) == 1 || get_theme_mod( 'vw_bakers_resp_topbar_hide_show', true) == 1) {  ?>
      <div class="container">
        <div class="d-flex justify-content-center  py-2">
          <?php if(get_theme_mod('vw_bakers_topbar_text') != '') {?>
            <i class="<?php echo esc_attr(get_theme_mod('vw_bakers_topbar_icon','fa-solid fa-bullhorn')); ?>"></i><p class="topbar-text mb-0 ms-2 text-capitalize text-center"><?php echo esc_html(get_theme_mod('vw_bakers_topbar_text')) ?></p>
          <?php }?>  
        </div>
      </div>
    <?php }?>  
  </div>  
  <div class="menu-header py-3">
    <div class="container">
      <div class="row">
        <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-4 col-sm-12 col-12 align-self-center logo-img-sec">
          <div class="logo text-start pb-0 pb-md-0">
            <?php if ( has_custom_logo() ) : ?>
              <div class="site-logo"><?php the_custom_logo(); ?></div>
            <?php endif; ?>
            <?php $vw_bakers_blog_info = get_bloginfo( 'name' ); ?>
              <?php if ( ! empty( $vw_bakers_blog_info ) ) : ?>
                <?php if ( is_front_page() && is_home() ) : ?>
                  <?php if( get_theme_mod('vw_bakers_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php else : ?>
                  <?php if( get_theme_mod('vw_bakers_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php endif; ?>
              <?php endif; ?>
              <?php
                $vw_bakers_description = get_bloginfo( 'description', 'display' );
                if ( $vw_bakers_description || is_customize_preview() ) :
              ?>
              <?php if( get_theme_mod('vw_bakers_tagline_hide_show',false) == 1){ ?>
                <p class="site-description mb-0">
                  <?php echo esc_html($vw_bakers_description); ?>
                </p>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
        <div class="col-xxl-8 col-xl-8 col-lg-6 col-md-5 col-sm-4 col-4 align-self-center">
          <?php get_template_part('template-parts/header/navigation'); ?>
        </div>
        <div class="col-xxl-1 col-xl-1 col-lg-3 col-md-3 col-sm-8 col-8 align-items-center d-flex gap-4 topbar-search">
          <?php if (get_theme_mod('vw_bakers_search_hide_show', true)){ ?>
            <div class="search-box">
              <span><a href="#"><i class='<?php echo esc_attr(get_theme_mod('vw_bakers_search_open_icon','fas fa-search')); ?>'></i></a></span>
            </div>
            <div class="serach_outer">
              <div class="closepop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('vw_bakers_search_close_icon','fa fa-window-close')); ?>"></i></a></div>
              <div class="serach_inner">
                <?php get_search_form(); ?>
              </div>
            </div>
          <?php } ?>
          <div class="myaccount">
            <a href="<?php echo esc_html(get_theme_mod('vw_bakers_myaccount_button_link')); ?>"><i class="<?php echo esc_attr(get_theme_mod('vw_bakers_myaccount_icon','fa-solid fa-user')); ?>"></i></a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>