<?php
/**
 * Header Layout
 * @package Car Booking
 */

$car_booking_defaults = car_booking_get_default_theme_options();

$car_booking_sticky = get_theme_mod('car_booking_sticky');
    $car_booking_data_sticky = "false";
    if ($car_booking_sticky) {
    $car_booking_data_sticky = "true";
    }
    global $wp_customize;

$car_booking_header_layout_button_text = esc_html( get_theme_mod( 'car_booking_header_layout_button_text',
$car_booking_defaults['car_booking_header_layout_button_text'] ) );

$car_booking_header_layout_button_url = esc_html( get_theme_mod( 'car_booking_header_layout_button_url',
$car_booking_defaults['car_booking_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($car_booking_data_sticky); ?>">
        <div class="wrapper header-wrapper">
            <div class="theme-header-areas header-areas-left aa">
                <div class="header-titles">
                    <?php
                    car_booking_site_logo();
                    car_booking_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', 'car-booking'); ?>" role="navigation">
                            <ul class="primary-menu theme-menu">
                                <?php
                                if (has_nav_menu('car-booking-primary-menu')) {
                                    wp_nav_menu(
                                        array(
                                            'container' => '',
                                            'items_wrap' => '%3$s',
                                            'theme_location' => 'car-booking-primary-menu',
                                        )
                                    );
                                } else {
                                    wp_list_pages(
                                        array(
                                            'match_menu_classes' => true,
                                            'show_sub_menu_icons' => true,
                                            'title_li' => false,
                                            'walker' => new Car_Booking_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 car_booking_the_theme_svg('menu'); ?>
                            </span>
                        </button>
                    </div>
                </div>
                <div class="theme-header-areas header-areas-right header-contact cc">
                    <div class="header-button-box">
                        <?php if( $car_booking_header_layout_button_text || $car_booking_header_layout_button_url  ){ ?>
                            <a href="<?php echo esc_url( $car_booking_header_layout_button_url ); ?>"><?php echo esc_html( $car_booking_header_layout_button_text ); ?><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M285.5 273L91.1 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.7-22.7c-9.4-9.4-9.4-24.5 0-33.9L188.5 256 34.5 101.3c-9.3-9.4-9.3-24.5 0-33.9l22.7-22.7c9.4-9.4 24.6-9.4 33.9 0L285.5 239c9.4 9.4 9.4 24.6 0 33.9z"/></svg></a>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>