<?php
/**
 * Displays main header
 *
 * @package Gardener Lite
 */
?>

<?php if(get_theme_mod('gardener_lite_top_header_setting',1)){ ?>
<div class="top_header py-2">
    <div class="container">
        <div class="row">
          <div class="col-lg-8 col-md-9 col-sm-9 align-self-center text-center text-md-start">
              <?php if(get_theme_mod('gardener_lite_email') != ''){ ?>
                  <span class="me-3"><i class="<?php echo esc_html( get_theme_mod('gardener_lite_mail_icon') ); ?>"></i><a href="mailto:<?php echo esc_html(get_theme_mod('gardener_lite_email','')); ?>"><?php echo esc_html(get_theme_mod('gardener_lite_email','')); ?></a></span><span class="me-3">|</span>
              <?php }?>
              <?php if(get_theme_mod('gardener_lite_phone') != ''){ ?>
                  <span class="me-3"><i class="<?php echo esc_html( get_theme_mod('gardener_lite_phone_icon') ); ?>"></i><a href="tel:<?php echo esc_html(get_theme_mod('gardener_lite_phone','')); ?>"><?php echo esc_html(get_theme_mod('gardener_lite_phone','')); ?></a></span class="me-3"><span class="me-3">|</span>
              <?php }?>
              <?php if(get_theme_mod('gardener_lite_address') != ''){ ?>
                  <span><i class="<?php echo esc_html( get_theme_mod('gardener_lite_location_icon') ); ?>"></i><?php echo esc_html(get_theme_mod('gardener_lite_address','')); ?></span>
              <?php }?>
          </div>
            <div class="col-lg-4 col-md-3 col-sm-3 align-self-center">
                <div class="social-link text-center text-md-end">
                    <?php if(get_theme_mod('gardener_lite_facebook_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('gardener_lite_facebook_url','')); ?>"><i class="fab fa-facebook-f me-3"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('gardener_lite_twitter_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('gardener_lite_twitter_url','')); ?>"><i class="fab fa-twitter me-3"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('gardener_lite_intagram_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('gardener_lite_intagram_url','')); ?>"><i class="fab fa-instagram me-3"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('gardener_lite_linkedin_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('gardener_lite_linkedin_url','')); ?>"><i class="fab fa-linkedin-in me-3"></i></a>
                    <?php }?>
                    <?php if(get_theme_mod('gardener_lite_youtube_url') != ''){ ?>
                        <a href="<?php echo esc_url(get_theme_mod('gardener_lite_youtube_url','')); ?>"><i class="fab fa-youtube"></i></a>
                    <?php }?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php }?>

<div class="main-header" data-sticky="<?php echo esc_attr($gardener_lite_data_sticky); ?>">
    <div class="container">
        <div class="row">
            <div class="col-lg-3 col-md-4 col-sm-4 col-12 align-self-center">
                <div class="navbar-brand text-center text-md-start">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $gardener_lite_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $gardener_lite_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                              <?php if( get_theme_mod('gardener_lite_logo_title',true) != ''){ ?>
                                <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('gardener_lite_logo_title',true) != ''){ ?>
                                <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
                            $gardener_lite_description = get_bloginfo( 'description', 'display' );
                            if ( $gardener_lite_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('gardener_lite_theme_description',false) != ''){ ?>
                          <p class="site-description"><?php echo esc_html($gardener_lite_description); ?></p>
                        <?php }?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-lg-6 col-md-2 col-sm-3 col-4 align-self-center">
                <?php get_template_part('template-parts/navigation/nav'); ?>
            </div>
            <div class="col-lg-1 col-md-2 col-sm-1 col-2 align-self-center">
                <div class="cart_no text-center">
                    <?php if(class_exists('woocommerce')){ ?>
                        <?php global $woocommerce; ?>
                        <a class="cart-customlocation" href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php esc_attr_e( 'shopping cart','gardener-lite' ); ?>"><i class="fas fa-shopping-bag"></i></a>
                    <?php }?>
                </div>
            </div>
            <div class="col-lg-2 col-md-4 col-sm-4 col-6 align-self-center">
                <?php if(class_exists('woocommerce')){ ?>
                    <div class="user-account text-center text-md-end">
                        <?php if ( is_user_logged_in() ) { ?>
                            <a href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','gardener-lite'); ?>"><?php esc_html_e('My Account','gardener-lite'); ?></a>
                        <?php }
                        else { ?>
                            <a href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Sign In','gardener-lite'); ?>"><?php esc_html_e('Sign In','gardener-lite'); ?></a>
                        <?php } ?>
                    </div>
                <?php }?>
            </div>
        </div>
    </div>
</div>
