<?php
/**
 * Header template part: Header with menu below header
 */

?>
<div class="container-fluid">
  <div class="row">

    <div class="container">
      <div class="row">

          <div class="col-md-12">

            <div class="header-left">
              <?php
              // Show header logo
              cookandmeal_logo_display();
              ?>
            </div>

            <div class="header-center">
            <?php
            // Header search
            if(get_theme_mod('search_position', 'enable') !== 'disable' && !(get_theme_mod('header_center_custom', false))):
            ?>
            <div class="search-toggle-wrapper search-<?php echo esc_attr(get_theme_mod('search_position', 'enable')); ?>">
              <a class="search-toggle-btn" aria-label="<?php echo esc_attr__('Search toggle', 'cookandmeal'); ?>"><i class="fa fa-search" aria-hidden="true"></i></a>
              <div class="header-center-search-form">
                <?php get_template_part( 'searchform-block' ); ?>
              </div>
            </div>
            <?php endif; ?>
            <?php
            // Custom content
            cookandmeal_header_center_custom_display();
            ?>
            </div>

            <div class="header-right">
              <?php
              // Show social
              if(get_theme_mod('header_socialicons', true)) {
                  cookandmeal_social_display(false, 5);
              }
              ?>
              <?php
              // Header search
              if(get_theme_mod('search_position', 'enable') !== 'disable' && (get_theme_mod('header_center_custom', false))):
              ?>
              <div class="search-toggle-wrapper search-<?php echo esc_attr(get_theme_mod('search_position', 'enable')); ?>">
                <a class="search-toggle-btn" aria-label="<?php echo esc_attr__('Search toggle', 'cookandmeal'); ?>"><i class="fa fa-search" aria-hidden="true"></i></a>
                <div class="header-center-search-form">
                  <?php get_template_part( 'searchform-block' ); ?>
                </div>
              </div>
              <?php endif; ?>
              <?php if (get_theme_mod('header_cart', false) && class_exists('Woocommerce')): ?>
              <div class="woocommerce-mini-cart">
              <?php
              // Show cart dropdown
              $cart_display = cookandmeal_woocommerce_header_add_to_cart_fragment();

              echo wp_kses_post($cart_display['#shopping-cart']);
              ?>
              </div>
              <?php endif; ?>
            </div>

          </div>

        </div>
      </div>

  </div>
  <?php
  // Show mainmenu below header
  cookandmeal_mainmenu_display();
  ?>
</div>
