<?php
/**
 * The template part for Top Header
 *
 * @package Manufacturing Plant 
 * @subpackage manufacturing-plant
 * @since manufacturing-plant 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'manufacturing_plant_sticky_header', false) == 1 || get_theme_mod( 'manufacturing_plant_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="main-topbar">
    <div class="container">
      <div class="row">
        <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-3 col-sm-7 col-12 align-self-center">
          <div class="logo pb-0 pb-md-0">
            <?php if ( has_custom_logo() ) : ?>
              <div class="site-logo"><?php the_custom_logo(); ?></div>
            <?php endif; ?>
            <?php $manufacturing_plant_blog_info = get_bloginfo( 'name' ); ?>
              <?php if ( ! empty( $manufacturing_plant_blog_info ) ) : ?>
                <?php if ( is_front_page() && is_home() ) : ?>
                  <?php if( get_theme_mod('manufacturing_plant_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php else : ?>
                  <?php if( get_theme_mod('manufacturing_plant_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php endif; ?>
              <?php endif; ?>
              <?php
                $manufacturing_plant_description = get_bloginfo( 'description', 'display' );
                if ( $manufacturing_plant_description || is_customize_preview() ) :
              ?>
              <?php if( get_theme_mod('manufacturing_plant_tagline_hide_show',false) == 1){ ?>
                <p class="site-description mb-0 text-start">
                  <?php echo esc_html($manufacturing_plant_description); ?>
                </p>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
        <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-6 col-sm-2 col-5 align-self-center header-sec-top">
          <?php get_template_part('template-parts/header/navigation'); ?>
        </div>
        <div class="col-xxl-1 col-xl-1 col-lg-1 col-md-3 col-sm-3 col-7 align-items-center d-flex justify-content-end top-icons gap-4">
          <?php if(get_theme_mod('manufacturing_plant_cart_button_link') != '') {?>
            <div class="cart-box">
              <a href="<?php echo esc_html(get_theme_mod('manufacturing_plant_cart_button_link')); ?>"><i class="<?php echo esc_attr(get_theme_mod('manufacturing_plant_cart_icon','fa-solid fa-cart-shopping')); ?>"></i></a>
            </div>
          <?php } ?>
          <?php if(get_theme_mod('manufacturing_plant_account_button_link') != '') {?>
            <div class="account-box">
              <a href="<?php echo esc_html(get_theme_mod('manufacturing_plant_account_button_link')); ?>"><i class="<?php echo esc_attr(get_theme_mod('manufacturing_plant_account_icon','fa-solid fa-user')); ?>"></i></a>
            </div>
          <?php } ?>
          <div class="toggle-btn">
            <a href="#" id="sidebar-pop"><i class="<?php echo esc_attr(get_theme_mod('manufacturing_plant_baropen_icon','fa-solid fa-bars')); ?>"></i></a>
          </div>
        </div>
        <div class="header-sidebar">
          <div class="close-pop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('manufacturing_plant_barclose_icon','fas fa-window-close')); ?>"></i></a>
          </div>
          <div class="menu-drawer">
            <div class="logo">
              <?php if ( has_custom_logo() ) : ?>
                <div class="site-logo"><?php the_custom_logo(); ?></div>
                <?php endif; ?>
                <?php $manufacturing_plant_blog_info = get_bloginfo( 'name' ); ?>
                  <?php if ( ! empty( $manufacturing_plant_blog_info ) ) : ?>
                    <?php if ( is_front_page() && is_home() ) : ?>
                      <?php if( get_theme_mod('manufacturing_plant_logo_title_hide_show',true) == 1){ ?>
                        <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                      <?php } ?>
                    <?php else : ?>
                      <?php if( get_theme_mod('manufacturing_plant_logo_title_hide_show',true) == 1){ ?>
                        <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                      <?php } ?>
                    <?php endif; ?>
                  <?php endif; ?>
                  <?php
                    $manufacturing_plant_description = get_bloginfo( 'description', 'display' );
                    if ( $manufacturing_plant_description || is_customize_preview() ) :
                  ?>
                  <?php if( get_theme_mod('manufacturing_plant_tagline_hide_show',false) == 1){ ?>
                    <p class="site-description mb-0">
                      <?php echo esc_html($manufacturing_plant_description); ?>
                    </p>
                  <?php } ?>
              <?php endif; ?>
            </div>
            <?php if(get_theme_mod('manufacturing_plant_openclose_text') != '') {?>
              <p class="mt-3"><?php echo esc_html(get_theme_mod('manufacturing_plant_openclose_text')) ?></p>
            <?php }?>
            <div class="phone-box mb-3">
              <div class="row">
                <?php if( get_theme_mod( 'manufacturing_plant_phone_text') != '' || get_theme_mod( 'manufacturing_plant_phone_number') != '') { ?>
                  <div class="col-xl-2 col-lg-2 col-md-2 col-2 align-self-center text-start">
                    <div class="phone">
                      <i class="<?php echo esc_attr(get_theme_mod('manufacturing_plant_phone_no_icon','fas fa-phone')); ?>"></i>
                    </div>
                  </div>
                  <div class="col-xl-10 col-lg-10 col-md-10 col-10 align-self-center text-start">
                    <h6 class="text-capitalize"><?php echo esc_html(get_theme_mod('manufacturing_plant_phone_text',''));?></h6>
                    <p class="mb-0"><a href="tel:<?php echo esc_attr( get_theme_mod('manufacturing_plant_phone_number','') ); ?>"><?php echo esc_html(get_theme_mod('manufacturing_plant_phone_number',''));?></a></p>
                  </div>
                <?php }?>
              </div>
            </div>
            <div class="mail-box mb-4">
              <div class="row">
                <?php if( get_theme_mod( 'manufacturing_plant_email_text') != '' || get_theme_mod( 'manufacturing_plant_email_address') != '') { ?>
                    <div class="col-xl-2 col-lg-2 col-md-2 col-2 align-self-center text-start">
                      <div class="envelope">
                        <i class="<?php echo esc_attr(get_theme_mod('manufacturing_plant_email_address_icon','fas fa-envelope-open')); ?>"></i>
                      </div>
                    </div>
                    <div class="col-xl-10 col-lg-10 col-md-10 col-10 align-self-center text-start">
                      <h6 class="text-capitalize"><?php echo esc_html(get_theme_mod('manufacturing_plant_email_text',''));?></h6>
                      <p class="mb-0"><a href="mailto:<?php echo esc_attr(get_theme_mod('manufacturing_plant_email_address',''));?>"><?php echo esc_html(get_theme_mod('manufacturing_plant_email_address',''));?><span class="screen-reader-text"><?php esc_html_e( 'support@example.com','manufacturing-plant' );?></span></a></p>
                    </div>
                <?php }?>
              </div>
            </div>
            <?php if ( is_active_sidebar( 'social-widget-sidemenu' ) ) : ?>
              <div class="topbar-social-icon">
                <?php dynamic_sidebar('social-widget-sidemenu'); ?>
              </div>
            <?php endif; ?>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>