<?php
/**
 * Header Layout
 * @package Green Nursery
 */

$green_nursery_defaults = green_nursery_get_default_theme_options();

$green_nursery_sticky = get_theme_mod('green_nursery_sticky');
    $green_nursery_data_sticky = "false";
    if ($green_nursery_sticky) {
    $green_nursery_data_sticky = "true";
    }
    global $wp_customize;

$green_nursery_header_layout_button_url = esc_html( get_theme_mod( 'green_nursery_header_layout_button_url',
$green_nursery_defaults['green_nursery_header_layout_button_url'] ) );


?>
<header id="site-header" class="site-header-layout header-layout" role="banner">
    <div class="header-navbar <?php if( is_user_logged_in() && !isset( $wp_customize ) ){ echo "login-user";} ?>" data-sticky="<?php echo esc_attr($green_nursery_data_sticky); ?>">
        <div class="wrapper header-wrapper">
            <div class="theme-header-areas header-areas-left aa">
                <div class="header-titles">
                    <?php
                    green_nursery_site_logo();
                    green_nursery_site_description();
                    ?>
                </div>
            </div>
            <div class="header-right-box">
                <div class="theme-header-areas header-areas-right bb">
                    <div class="site-navigation">
                        <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e('Horizontal', 'green-nursery'); ?>" role="navigation">
                            <ul class="primary-menu theme-menu">
                                <?php
                                if (has_nav_menu('green-nursery-primary-menu')) {
                                    wp_nav_menu(
                                        array(
                                            'container' => '',
                                            'items_wrap' => '%3$s',
                                            'theme_location' => 'green-nursery-primary-menu',
                                        )
                                    );
                                } else {
                                    wp_list_pages(
                                        array(
                                            'match_menu_classes' => true,
                                            'show_sub_menu_icons' => true,
                                            'title_li' => false,
                                            'walker' => new Green_Nursery_Walker_Page(),
                                        )
                                    );
                                } ?>
                            </ul>
                        </nav>
                    </div>
                    <div class="navbar-controls twp-hide-js">
                        <button type="button" class="navbar-control navbar-control-offcanvas">
                            <span class="navbar-control-trigger" tabindex="-1">
                                <?php green_nursery_the_theme_svg('menu'); ?>
                            </span>
                        </button>
                    </div>
                </div>
                <div class="theme-header-areas header-areas-right header-contact cc">
                    <div class="header-btn">
                        <a href="<?php echo esc_url( $green_nursery_header_layout_button_url ); ?>"><i class="fa-solid fa-leaf"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>