<?php
/*
* Display Logo and nav
*/
?>

<?php
$holiday_vacation_sticky = get_theme_mod('holiday_vacation_sticky');
    $holiday_vacation_data_sticky = "false";
    if ($holiday_vacation_sticky) {
    $holiday_vacation_data_sticky = "true";
    }
    global $wp_customize;
?>

<div class="headerbox <?php if( is_user_logged_in() && !isset( $wp_customize ) ){ echo "login-user";} ?>" data-sticky="<?php echo esc_attr($holiday_vacation_data_sticky); ?>">
  <div class="container">
    <div class="row">
      <div class="col-lg-3 col-md-4 col-sm-4 col-12 align-self-center">
       <?php $holiday_vacation_logo_settings = get_theme_mod( 'holiday_vacation_logo_settings','Different Line');
          if($holiday_vacation_logo_settings == 'Different Line'){ ?>
            <div class="logo">
              <?php if( has_custom_logo() ) holiday_vacation_the_custom_logo(); ?>
              <?php if(get_theme_mod('holiday_vacation_site_title',true) == 1){ ?>
                <?php if (is_front_page() || is_home()) : ?>
                  <h1 class="text-capitalize">
                    <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                  </h1>
                <?php else : ?>
                  <p class="text-capitalize site-title">
                    <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                  </p>
                <?php endif; ?>
              <?php }?>
              <?php $holiday_vacation_description = get_bloginfo( 'description', 'display' );
              if ( $holiday_vacation_description || is_customize_preview() ) : ?>
                <?php if(get_theme_mod('holiday_vacation_site_tagline',false)){ ?>
                  <p class="site-description mb-0"><?php echo esc_html($holiday_vacation_description); ?></p>
                <?php }?>
              <?php endif; ?>
            </div>
          <?php }else if($holiday_vacation_logo_settings == 'Same Line'){ ?>
            <div class="logo logo-same-line mb-md-0 text-center text-lg-start">
              <div class="row">
                <div class="col-lg-5 col-md-5 align-self-md-center">
                  <?php if( has_custom_logo() ) holiday_vacation_the_custom_logo(); ?>
                </div>
                <div class="col-lg-7 col-md-7 align-self-md-center">
                  <?php if(get_theme_mod('holiday_vacation_site_title',true) == 1){ ?>
                    <?php if (is_front_page() || is_home()) : ?>
                      <h1 class="text-capitalize">
                          <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                      </h1>
                    <?php else : ?>
                      <p class="text-capitalize site-title">
                          <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                      </p>
                    <?php endif; ?>
                    <?php }?>
                    <?php $holiday_vacation_description = get_bloginfo( 'description', 'display' );
                    if ( $holiday_vacation_description || is_customize_preview() ) : ?>
                    <?php if(get_theme_mod('holiday_vacation_site_tagline',false)){ ?>
                      <p class="site-description mb-0"><?php echo esc_html($holiday_vacation_description); ?></p>
                    <?php }?>
                  <?php endif; ?>
                </div>
              </div>
            </div>
          <?php }?>
      </div>
      <div class="col-lg-7 col-md-4 col-sm-4 col-6 align-self-center">
        <?php
          get_template_part( 'template-parts/navigation/site', 'nav' );
        ?>
      </div>
      <div class="col-lg-2 col-md-4 col-sm-4 col-6 offcanvas-div d-flex align-items-center align-self-center">
        <?php if(get_theme_mod('holiday_vacation_header_sidebar', true)){ ?>
          <button type="button" data-bs-toggle="offcanvas" data-bs-target="#demo">
                <i class="fas fa-bars"></i>
          </button>
        <div class="offcanvas offcanvas-end" id="demo">
          <div class="offcanvas-header"> 
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas"><i class="fas fa-times"></i></button>
          </div>
          <div class="offcanvas-body">
            <?php $holiday_vacation_logo_settings = get_theme_mod( 'holiday_vacation_logo_settings','Different Line');
          if($holiday_vacation_logo_settings == 'Different Line'){ ?>
            <div class="logo">
              <?php if( has_custom_logo() ) holiday_vacation_the_custom_logo(); ?>
              <?php if(get_theme_mod('holiday_vacation_site_title',true) == 1){ ?>
                <h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
              <?php }?>
              <?php $holiday_vacation_description = get_bloginfo( 'description', 'display' );
              if ( $holiday_vacation_description || is_customize_preview() ) : ?>
                <?php if(get_theme_mod('holiday_vacation_site_tagline',false)){ ?>
                  <p class="site-description mb-0"><?php echo esc_html($holiday_vacation_description); ?></p>
                <?php }?>
              <?php endif; ?>
            </div>
          <?php }else if($holiday_vacation_logo_settings == 'Same Line'){ ?>
            <div class="logo logo-same-line mb-md-0 text-center text-lg-start">
              <div class="row">
                <div class="col-lg-5 col-md-5 align-self-md-center">
                  <?php if( has_custom_logo() ) holiday_vacation_the_custom_logo(); ?>
                </div>
                <div class="col-lg-7 col-md-7 align-self-md-center">
                  <?php if(get_theme_mod('holiday_vacation_site_title',true) == 1){ ?>
                    <h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                    <?php }?>
                    <?php $holiday_vacation_description = get_bloginfo( 'description', 'display' );
                    if ( $holiday_vacation_description || is_customize_preview() ) : ?>
                    <?php if(get_theme_mod('holiday_vacation_site_tagline',false)){ ?>
                      <p class="site-description mb-0"><?php echo esc_html($holiday_vacation_description); ?></p>
                    <?php }?>
                  <?php endif; ?>
                </div>
              </div>
            </div>
          <?php }?>
            <div class="social-media">
              <?php                 
                $holiday_vacation_header_fb_new_tab = esc_attr(get_theme_mod('holiday_vacation_header_fb_new_tab','true'));
                $holiday_vacation_header_twt_new_tab = esc_attr(get_theme_mod('holiday_vacation_header_twt_new_tab','true'));
                $holiday_vacation_header_ins_new_tab = esc_attr(get_theme_mod('holiday_vacation_header_ins_new_tab','true'));
                $holiday_vacation_header_ut_new_tab = esc_attr(get_theme_mod('holiday_vacation_header_ut_new_tab','true'));
                $holiday_vacation_header_pint_new_tab = esc_attr(get_theme_mod('holiday_vacation_header_pint_new_tab','true'));
                ?>
              <?php if( get_theme_mod( 'holiday_vacation_facebook_url' ) != '') { ?>
                <a <?php if($holiday_vacation_header_fb_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'holiday_vacation_facebook_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('holiday_vacation_facebook_icon','fab fa-facebook-f')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'holiday_vacation_twitter_url' ) != '') { ?>
                <a <?php if($holiday_vacation_header_twt_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'holiday_vacation_twitter_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('holiday_vacation_twitter_icon','fab fa-twitter')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'holiday_vacation_instagram_url' ) != '') { ?>
                <a <?php if($holiday_vacation_header_ins_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'holiday_vacation_instagram_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('holiday_vacation_instagram_icon','fab fa-instagram')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'holiday_vacation_youtube_url' ) != '') { ?>
                <a <?php if($holiday_vacation_header_ut_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'holiday_vacation_youtube_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('holiday_vacation_youtube_icon','fab fa-youtube')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'holiday_vacation_pint_url' ) != '') { ?>
                <a <?php if($holiday_vacation_header_pint_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'holiday_vacation_pint_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('holiday_vacation_pinterest_icon','fab fa-pinterest')); ?>"></i></a>
              <?php } ?>
            </div>
            <div class="search_inner">
            <?php get_search_form(); ?>
          </div>
          </div>
        </div>
        <?php } ?>
      </div>
    </div>
  </div>
</div>