<?php
/**
 * Displays main header
 *
 * @package Pet Accessory Store
 */
?>

<?php
$pet_accessory_store_sticky_header = get_theme_mod('pet_accessory_store_sticky_header');
    $pet_accessory_store_data_sticky = "false";
    if ($pet_accessory_store_sticky_header) {
    $pet_accessory_store_data_sticky = "true";
    }
?>
<div class="main-header text-center text-md-start" data-sticky="<?php echo esc_attr($pet_accessory_store_data_sticky); ?>">
    <div class="container">
        <div class="row nav-box">
            <div class="col-xl-2 col-lg-3 col-md-4 col-sm-4 col-12 logo-box align-self-center">
                <div class="navbar-brand ">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $pet_accessory_store_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $pet_accessory_store_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('pet_accessory_store_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('pet_accessory_store_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
                            $pet_accessory_store_description = get_bloginfo( 'description', 'display' );
                            if ( $pet_accessory_store_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('pet_accessory_store_theme_description',false) != ''){ ?>
                            <p class="site-description pb-2"><?php echo esc_html($pet_accessory_store_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-xl-5 col-lg-6 col-md-4 col-sm-3 col-12 align-self-center header-box">
                <?php get_template_part('template-parts/navigation/nav'); ?>
            </div>
            
            <div class="col-xl-5 col-lg-3 col-md-4 col-sm-5 col-12 align-self-center header-right-box">
                <?php if ( get_theme_mod('pet_accessory_store_topbar1_wishlist_url') != "" ) {?>
                    <span class="wish-btn">
                        <a href="<?php echo esc_url(get_theme_mod('pet_accessory_store_topbar1_wishlist_url')); ?>"><i class="far fa-heart me-2"></i><?php echo esc_html('Wishlist','pet-accessory-store'); ?></a>
                    </span>
                <?php }?>
                <span class="cart_no">
                    <?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','pet-accessory-store' ); ?>"><i class="fas fa-shopping-bag me-2"></i><span><?php echo esc_html('cart','pet-accessory-store'); ?></span></a>
                    <?php }?>
                </span>
            </div>
        </div>
    </div>
</div>
