<?php
/**
 * The template part for Top Header
 *
 * @package VW Machine Learning 
 * @subpackage vw-machine-learning
 * @since vw-machine-learning 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'vw_machine_learning_sticky_header', false) == 1 || get_theme_mod( 'vw_machine_learning_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="container">
    <div class="main-topbar py-2">
      <div class="row">
        <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-4 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 $vw_machine_learning_blog_info = get_bloginfo( 'name' ); ?>
              <?php if ( ! empty( $vw_machine_learning_blog_info ) ) : ?>
                <?php if ( is_front_page() && is_home() ) : ?>
                  <?php if( get_theme_mod('vw_machine_learning_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('vw_machine_learning_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
                $vw_machine_learning_description = get_bloginfo( 'description', 'display' );
                if ( $vw_machine_learning_description || is_customize_preview() ) :
              ?>
              <?php if( get_theme_mod('vw_machine_learning_tagline_hide_show',false) == 1){ ?>
                <p class="site-description mb-0 text-start">
                  <?php echo esc_html($vw_machine_learning_description); ?>
                </p>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
        <div class="col-xxl-7 col-xl-6 col-lg-6 col-md-2 col-sm-3 col-12 align-self-center">
          <?php get_template_part('template-parts/header/navigation'); ?>
        </div>
        <div class="col-xxl-3 col-xl-4 col-lg-4 col-md-6 col-sm-9 col-12 align-items-center d-flex justify-content-between top-icons">
          <?php if (get_theme_mod('vw_machine_learning_top_phone_title') != '' || get_theme_mod('vw_machine_learning_phone_number') != '') { ?>
            <div class="phone-box">
              <div class="row">
                <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-3 align-self-center">
                  <i class="<?php echo esc_attr(get_theme_mod('vw_machine_learning_top_phone_icon','fa-solid fa-phone')); ?>"></i>
                </div>
                <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-9 col-9 align-self-center">
                  <p class="phone-title text-capitalize mb-0"><?php echo esc_html(get_theme_mod('vw_machine_learning_top_phone_title')); ?></p>
                  <p class="phone-no mb-0"><a href="tel:<?php echo esc_attr( get_theme_mod('vw_machine_learning_phone_number','') ); ?>"><?php echo esc_html(get_theme_mod('vw_machine_learning_phone_number',''));?></a></p>
                </div>
              </div>
            </div>
          <?php }?>
          <?php if ( get_theme_mod('vw_machine_learning_topbar_button_url') != '' || get_theme_mod('vw_machine_learning_topbar_button_label') != '' ) {?>
            <div class ="topbar-btn">
              <a href="<?php echo esc_url(get_theme_mod('vw_machine_learning_topbar_button_url'));?>" class="text-capitalize"><?php echo esc_html(get_theme_mod('vw_machine_learning_topbar_button_label'));?>
              </a>
            </div>
          <?php }?>
        </div>
      </div>
    </div>
  </div>
</div>