<?php
/**
 * The template part for Top Header
 *
 * @package Virtual Assistant 
 * @subpackage virtual-assistant
 * @since virtual-assistant 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'virtual_assistant_sticky_header', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="main-topbar">
    <div class="menu-sec">
      <div class="container">
        <div class="row">
          <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-3 col-sm-12 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 $virtual_assistant_blog_info = get_bloginfo( 'name' ); ?>
                <?php if ( ! empty( $virtual_assistant_blog_info ) ) : ?>
                  <?php if ( is_front_page() && is_home() ) : ?>
                    <?php if( get_theme_mod('virtual_assistant_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('virtual_assistant_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
                  $virtual_assistant_description = get_bloginfo( 'description', 'display' );
                  if ( $virtual_assistant_description || is_customize_preview() ) :
                ?>
                <?php if( get_theme_mod('virtual_assistant_tagline_hide_show',false) == 1){ ?>
                  <p class="site-description mb-0 text-start">
                    <?php echo esc_html($virtual_assistant_description); ?>
                  </p>
                <?php } ?>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-6 col-sm-3 col-3 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-9 col-9 align-items-center d-flex top-btn gap-4">
            <div class="cart">
              <a href="<?php echo esc_html(get_theme_mod('virtual_assistant_cart_button_link')); ?>"><i class="<?php echo esc_attr(get_theme_mod('virtual_assistant_cart_icon','fa-solid fa-cart-shopping')); ?>"></i></a>
            </div>
            <div class="myaccount">
              <a href="<?php echo esc_html(get_theme_mod('virtual_assistant_myaccount_button_link')); ?>"><i class="<?php echo esc_attr(get_theme_mod('virtual_assistant_myaccount_icon','fa-solid fa-user')); ?>"></i></a>
            </div>
            <div class="toggle-btn">
              <a href="#" id="sidebar-pop"><i class="fa-solid fa-bars"></i></a>
            </div>
            <div class="header-sidebar">
              <div class="close-pop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('virtual_assistant_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 $virtual_assistant_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $virtual_assistant_blog_info ) ) : ?>
                          <?php if ( is_front_page() && is_home() ) : ?>
                            <?php if( get_theme_mod('virtual_assistant_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('virtual_assistant_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
                          $virtual_assistant_description = get_bloginfo( 'description', 'display' );
                          if ( $virtual_assistant_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('virtual_assistant_tagline_hide_show',false) == 1){ ?>
                          <p class="site-description mb-0">
                            <?php echo esc_html($virtual_assistant_description); ?>
                          </p>
                        <?php } ?>
                  <?php endif; ?>
                </div>
                <?php if(get_theme_mod('virtual_assistant_openclose_text') != '') {?>
                  <p class="mt-3"><?php echo esc_html(get_theme_mod('virtual_assistant_openclose_text')) ?></p>
                <?php }?>
                <div class="phone-box mb-3">
                  <div class="row">
                    <?php if( get_theme_mod( 'virtual_assistant_phone_text') != '' || get_theme_mod( 'virtual_assistant_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('virtual_assistant_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('virtual_assistant_phone_text',''));?></h6>
                        <p class="mb-0"><a href="tel:<?php echo esc_attr( get_theme_mod('virtual_assistant_phone_number','') ); ?>"><?php echo esc_html(get_theme_mod('virtual_assistant_phone_number',''));?></a></p>
                      </div>
                    <?php }?>
                  </div>
                </div>
                <div class="mail-box mb-4">
                  <div class="row">
                    <?php if( get_theme_mod( 'virtual_assistant_email_text') != '' || get_theme_mod( 'virtual_assistant_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('virtual_assistant_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('virtual_assistant_email_text',''));?></h6>
                          <p class="mb-0"><a href="mailto:<?php echo esc_attr(get_theme_mod('virtual_assistant_email_address',''));?>"><?php echo esc_html(get_theme_mod('virtual_assistant_email_address',''));?><span class="screen-reader-text"><?php esc_html_e( 'support@example.com','virtual-assistant' );?></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 else : ?>
                  <div class="topbar-social-icon">
                    <div class="widget">
                      <div class="custom-social-icons" >
                        <a href="https://youtube.com" target="_blank"><i class="fab fa-youtube"></i></a>
                        <a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a>
                        <a href="https://twitter.com" target="_blank"><i class="fab fa-twitter"></i></a>
                        <a href="https://dribbble.com" target="_blank"><i class="fa-solid fa-basketball"></i></a>
                        <a href="https://facebook.com" target="_blank"><i class="fab fa-facebook"></i></a>
                      </div>
                    </div>
                  </div>
                <?php endif; ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>