<?php
/**
 * Displays Middle Header
 *
 * @package Gym Nutrition Shop
 */
?>

<div class="middle-header py-3">
    <div class="container-fluid">
    	<div class="row">
            <div class="col-lg-3 col-md-12 align-self-center logo-box">
                <div class="navbar-brand ">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $gym_nutrition_shop_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $gym_nutrition_shop_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('gym_nutrition_shop_logo_title_text',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('gym_nutrition_shop_logo_title_text',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
                            $gym_nutrition_shop_description = get_bloginfo( 'description', 'display' );
                            if ( $gym_nutrition_shop_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('gym_nutrition_shop_theme_description',false) != ''){ ?>
                            <p class="site-description pb-2"><?php echo esc_html($gym_nutrition_shop_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>  
            <div class="col-lg-6 col-md-6 align-self-center product-search">
                <?php if(class_exists('woocommerce')){ ?>
                    <?php get_product_search_form(); ?>
                <?php }?>
            </div> 
            <div class="col-lg-3 col-md-6 align-self-center ps-0">
                <div class="social-plugin">
                    <div class="social-icons">
                        <?php if(get_theme_mod('gym_nutrition_shop_facebook_url') != ''){ ?>
                            <a href="<?php echo esc_url(get_theme_mod('gym_nutrition_shop_facebook_url','')); ?>"><i class="<?php echo esc_attr( get_theme_mod('gym_nutrition_shop_facebook_icon') ); ?>"></i></a>
                        <?php }?>
                        <?php if(get_theme_mod('gym_nutrition_shop_twitter_url') != ''){ ?>
                            <a href="<?php echo esc_url(get_theme_mod('gym_nutrition_shop_twitter_url','')); ?>"><i class="<?php echo esc_attr( get_theme_mod('gym_nutrition_shop_twitter_icon') ); ?>"></i></a>
                        <?php }?>
                        <?php if(get_theme_mod('gym_nutrition_shop_intagram_url') != ''){ ?>
                            <a href="<?php echo esc_url(get_theme_mod('gym_nutrition_shop_intagram_url','')); ?>"><i class="<?php echo esc_attr( get_theme_mod('gym_nutrition_shop_intagram_icon') ); ?>"></i></a>
                        <?php }?>
                    </div>
                    <?php if(class_exists('GTranslate')){ ?>
                        <span class="text-center translate-btn">
                            <?php echo do_shortcode('[gtranslate]');?>
                        </span>
                    <?php }?>
                    <?php if(class_exists('Alg_WC_Currency_Switcher')){ ?>
                        <span class="currency">
                            <?php echo do_shortcode('[woocommerce_currency_switcher_drop_down_box]');?>
                        </span>
                    <?php }?>
                </div>
            </div>  
        </div>
    </div>
</div>