<?php
/**
 * Template part for displaying header menu
 *
 * @package Unique Gift Shop
 */

?>
<?php
    $unique_gift_shop_page_val= is_front_page() ? 'home':'page' ;

?>

<header id="<?php echo esc_attr($unique_gift_shop_page_val);?>-inner" class="elementer-menu-anchor theme-menu-wrapper full-width-menu style1 page" role="banner">
    <?php
        if(true===get_theme_mod('unique_gift_shop_enable_highlighted area',true) && is_front_page()){
            ?><a class="skip-link screen-reader-text" href="#content"><?php esc_html_e('skip to content','unique-gift-shop'); ?> </a> <?php
        }
        else{
        ?><a class="skip-link screen-reader-text" href="#main"><?php esc_html_e('skip to content','unique-gift-shop');?></a> <?php
    }
    ?>
    <div id="header-main" class="header-wrapper">
        <div id="topbar">
            <div class="container">
                <div class="row py-3">
                    <div class="col-lg-4 col-md-4 col-3 align-self-center">
                        <span class="tbr2-account">
                            <?php if(class_exists('woocommerce')){ ?>
                                <?php if ( is_user_logged_in() ) { ?>
                                    <a class="my-account" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','unique-gift-shop'); ?>"><i class="bi bi-person"></i></a>
                                <?php }
                                else { ?>
                                    <a class="my-account" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Login / Register','unique-gift-shop'); ?>"><?php esc_html_e( 'Login / Register','unique-gift-shop' );?></a>
                                <?php } ?>
                            <?php }?>
                        </span>
                    </div>
                    <div class="col-lg-4 col-md-4 col-5 align-self-center text-center">
                        <div class="logo <?php echo (has_custom_logo() ? 'has-logo' : 'no-logo'); ?>" itemscope itemtype="https://schema.org/Organization">
                            <?php 
                                // Display custom logo if available
                                if ( has_custom_logo() ) {
                                    unique_gift_shop_custom_logo();
                                }

                                // Display sticky header logo if enabled
                                if ( get_theme_mod( 'unique_gift_shop_enable_logo_stickyheader', false ) ) {
                                    $unique_gift_shop_alt_logo = esc_url( get_theme_mod( 'unique_gift_shop_logo_stickyheader' ) );
                                    if ( ! empty( $unique_gift_shop_alt_logo ) ) {
                                        ?>
                                        <a id="logo-alt" class="logo-alt" href="<?php echo esc_url( home_url( '/' ) ); ?>">
                                            <img src="<?php echo esc_url( $unique_gift_shop_alt_logo ); ?>" alt="<?php esc_attr_e( 'logo', 'unique-gift-shop' ); ?>">
                                        </a>
                                        <?php
                                    }
                                }

                                // Site title and tagline settings
                                $unique_gift_shop_show_title   = get_theme_mod( 'unique_gift_shop_display_site_title', true );
                                $unique_gift_shop_show_tagline = get_theme_mod( 'unique_gift_shop_display_site_tagline', false );
                                $unique_gift_shop_header_class = $unique_gift_shop_show_title ? 'site-title' : 'screen-reader-text';

                                // Display site title
                                if ( $unique_gift_shop_show_title && get_bloginfo( 'name' ) ) {
                                    if ( is_front_page() ) {
                                        ?>
                                        <h1 class="<?php echo esc_attr( $unique_gift_shop_header_class ); ?>">
                                            <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
                                        </h1>
                                        <?php
                                    } else {
                                        ?>
                                        <p class="<?php echo esc_attr( $unique_gift_shop_header_class ); ?>">
                                            <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
                                        </p>
                                        <?php
                                    }
                                }

                                // Display tagline
                                if ( $unique_gift_shop_show_tagline ) {
                                    $unique_gift_shop_description = get_bloginfo( 'description', 'display' );
                                    if ( $unique_gift_shop_description || is_customize_preview() ) {
                                        ?>
                                        <p class="site-description"><?php echo esc_html( $unique_gift_shop_description ); ?></p>
                                        <?php
                                    }
                                }
                            ?>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4 col-4 align-self-center text-lg-end text-center">
                        <?php if(get_theme_mod('unique_gift_shop_search_hide',false)=="1"){ ?>
                            <span class="search-container">
                                <button id="search-icon" class="search-icon mx-2">
                                    <i class="bi bi-search"></i>
                                </button>
                                <div id="search-form" class="search-form">
                                    <?php get_search_form(); ?>
                                </div>
                            <span>
                        <?php } ?>
                        <span class="tbr2-cart pe-lg-3">
                            <?php unique_gift_shop_custom_woocommerce_cart_icon(); ?>
                        </span>
                    </div>                   
                </div>
            </div>
        </div>
         <div id="custom-header">
            <?php if ( display_header_text() ) : ?>        
            <div id="content-header">
                <div class="container">                        
                    <div class="top-menu-wrapper text-center py-3 py-lg-3 py-md-2">
                        <div class="navigation_header">
                            <div class="toggle-nav mobile-menu">
                                <button onclick="unique_gift_shop_openNav()"><i class="bi bi-list"></i></button>
                            </div>
                            <div id="mySidenav" class="nav sidenav">
                                <nav id="site-navigation" class="main-navigation navbar navbar-expand-xl" aria-label="<?php esc_attr_e( 'Top Menu', 'unique-gift-shop' ); ?>">
                                    <?php {
                                        wp_nav_menu(
                                            array(
                                                'theme_location' => 'primary',
                                                'container_class' => 'navi clearfix navbar-nav' ,
                                                'menu_class'     => 'menu clearfix', 
                                                'items_wrap'     => '<ul id="%1$s" class="%2$s">%3$s</ul>',
                                                'fallback_cb' => 'wp_page_menu',
                                            )
                                        );
                                    } ?>
                                </nav>
                                <a href="javascript:void(0)" class="closebtn mobile-menu" onclick="unique_gift_shop_closeNav()"><i class="bi bi-x"></i></a>
                            </div>
                        </div>
                    </div>                               
                </div>
            </div>
            <?php endif; ?>
        </div>
    </div>    
</header>

<div class="clearfix"></div>
<div id="content" class="elementor-menu-anchor"></div>

<div class="content-wrap">