<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Classic Marketing Agency
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

<?php if ( function_exists( 'wp_body_open' ) ) {
  wp_body_open();
} else {
  do_action( 'wp_body_open' );
} ?>

<?php if ( get_theme_mod('classic_marketing_agency_preloader', false) ) { ?>
  <div id="preloader">
    <div id="status">&nbsp;</div>
  </div>
<?php } ?>

<a class="screen-reader-text skip-link" href="#content"><?php esc_html_e( 'Skip to content', 'classic-marketing-agency' ); ?></a>

<div id="pageholder" <?php if( get_theme_mod( 'classic_marketing_agency_box_layout', false) ) { echo 'class="boxlayout"'; } ?>>

<div id="header" class="position-relative">
  <div class="headerbox pb-3">
    <?php if ( get_theme_mod('classic_marketing_agency_topbar', false) ) { ?>
        <div class="header-top py-md-2 py-3">
          <div class="container">
            <div class="row">
              <div class="col-lg-9 col-md-8 contact-box align-self-center">
                <?php if ( get_theme_mod('classic_marketing_agency_phone_number') ) { ?>
                  <a class="phn me-md-5 py-md-0 py-1" href="tel:<?php echo esc_url( get_theme_mod('classic_marketing_agency_phone_number') ); ?>"><i class="fas fa-phone me-2"></i><?php echo esc_html(get_theme_mod ('classic_marketing_agency_phone_number')); ?></a>
                <?php } ?>
                <?php if ( get_theme_mod('classic_marketing_agency_email_address') ) { ?>
                  <a class="email py-md-0 pt-1 pb-2" href="mailto:<?php echo esc_attr( get_theme_mod('classic_marketing_agency_email_address') ); ?>"><i class="fas fa-envelope-open me-2"></i><?php echo esc_html(get_theme_mod ('classic_marketing_agency_email_address')); ?></a>
                <?php } ?>
              </div>
              <div class="col-lg-3 col-md-4 social-media align-self-center text-md-end text-center">
                <span class="social-icons">
                  <?php if ( get_theme_mod('classic_marketing_agency_fb_link') ) { ?>
                    <a title="<?php echo esc_attr('facebook', 'classic-marketing-agency'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_marketing_agency_fb_link')); ?>"><i class="fab fa-facebook"></i></a>
                  <?php } ?>
                  <?php if ( get_theme_mod('classic_marketing_agency_twitt_link') ) { ?>
                    <a title="<?php echo esc_attr('twitter', 'classic-marketing-agency'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_marketing_agency_twitt_link')); ?>"><i class="fab fa-twitter"></i></a>
                  <?php } ?>
                  <?php if ( get_theme_mod('classic_marketing_agency_linkedin_link') ) { ?>
                    <a title="<?php echo esc_attr('linkedin', 'classic-marketing-agency'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_marketing_agency_linkedin_link')); ?>"><i class="fab fa-linkedin-in"></i></a>
                  <?php } ?>
                  <?php if ( get_theme_mod('classic_marketing_agency_insta_link') ) { ?>
                    <a title="<?php echo esc_attr('instagram', 'classic-marketing-agency'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_marketing_agency_insta_link')); ?>"><i class="fab fa-instagram"></i></a>
                  <?php } ?>
                  <?php if ( get_theme_mod('classic_marketing_agency_behance_link') ) { ?>
                    <a title="<?php echo esc_attr('behance', 'classic-marketing-agency'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_marketing_agency_behance_link')); ?>"><i class="fab fa-behance"></i></a>
                  <?php } ?>
                </span>
              </div>
            </div>
          </div>
        </div>
    <?php } ?>

    <div class="mainhead <?php echo ( get_theme_mod( 'classic_marketing_agency_sticky_header', false ) == 1 ) ? 'header-sticky' : 'close-sticky'; ?>">
      <div class="header">
        <div class="container">
          <div class="row m-0 menu-bg">
            <div class="col-lg-3 col-md-4 align-self-center px-md-0">
              <div class="classic-marketing-agency-logo text-center text-md-start">
                <?php classic_marketing_agency_the_custom_logo(); ?>
                <div class="site-branding-text">
                  <?php if (get_theme_mod('classic_marketing_agency_title_enable', false)) { ?>
                    <?php if (is_front_page() && is_home()) : ?>
                      <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></h1>
                    <?php else : ?>
                      <p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></p>
                    <?php endif; ?>
                  <?php } ?>
                  <?php $classic_marketing_agency_description = get_bloginfo('description', 'display');
                  if ($classic_marketing_agency_description || is_customize_preview()) : ?>
                    <?php if (get_theme_mod('classic_marketing_agency_tagline_enable', false)) { ?>
                      <span class="site-description"><?php echo esc_html($classic_marketing_agency_description); ?></span>
                    <?php } ?>
                  <?php endif; ?>
                </div>
              </div>
            </div>
            <div class="col-lg-6 col-md-4 align-self-center">
              <div class="toggle-nav text-center">
                <?php if (has_nav_menu('primary')) { ?>
                  <button role="tab"><?php esc_html_e('Menu', 'classic-marketing-agency'); ?></button>
                <?php } ?>
              </div>
              <div id="mySidenav" class="nav sidenav px-lg-5">
                <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e('Top Menu', 'classic-marketing-agency'); ?>">
                  <ul class="mobile_nav">
                    <?php wp_nav_menu(array(
                      'theme_location' => 'primary',
                      'container_class' => 'main-menu',
                      'items_wrap' => '%3$s',
                      'fallback_cb' => 'wp_page_menu',
                    )); ?>
                  </ul>
                  <a href="javascript:void(0)" class="close-button"><?php esc_html_e('CLOSE', 'classic-marketing-agency'); ?></a>
                </nav>
              </div>
            </div>
            <div class="col-lg-3 col-md-4 align-self-center text-center text-md-end my-md-0 mt-3 product-icon">
              <?php if (class_exists('woocommerce')) { ?>
                <span class="product-account">
                  <a class="log-btn" href="<?php echo esc_url(get_permalink(get_option('woocommerce_myaccount_page_id'))); ?>" title="<?php esc_attr_e('Login', 'classic-marketing-agency'); ?>"><?php esc_html_e('Log In', 'classic-marketing-agency'); ?></a>
                  <a class="sign-btn ms-3" href="<?php echo esc_url(wp_registration_url()); ?>" title="<?php esc_attr_e('Sign Up', 'classic-marketing-agency'); ?>"><?php esc_html_e('Sign Up', 'classic-marketing-agency'); ?></a>
                </span>
              <?php } ?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>