<?php
/**
 * Header Layout
 * @package Aerial Drone
 */

$aerial_drone_default = aerial_drone_get_default_theme_options();

$aerial_drone_header_phone_number = esc_html( get_theme_mod( 'aerial_drone_header_phone_number',
$aerial_drone_default['aerial_drone_header_phone_number'] ) );

$aerial_drone_topheader_text = esc_html( get_theme_mod( 'aerial_drone_topheader_text',
$aerial_drone_default['aerial_drone_topheader_text'] ) );

$aerial_drone_header_layout_button = esc_html( get_theme_mod( 'aerial_drone_header_layout_button',
$aerial_drone_default['aerial_drone_header_layout_button'] ) );

$aerial_drone_header_layout_button_url = esc_url( get_theme_mod( 'aerial_drone_header_layout_button_url',
$aerial_drone_default['aerial_drone_header_layout_button_url'] ) );

$aerial_drone_header_layout_button_1 = esc_html( get_theme_mod( 'aerial_drone_header_layout_button_1',
$aerial_drone_default['aerial_drone_header_layout_button_1'] ) );

$aerial_drone_header_layout_button_1_url = esc_url( get_theme_mod( 'aerial_drone_header_layout_button_1_url',
$aerial_drone_default['aerial_drone_header_layout_button_1_url'] ) );

$aerial_drone_header_layout_wishlist = esc_html( get_theme_mod( 'aerial_drone_header_layout_wishlist',
$aerial_drone_default['aerial_drone_header_layout_wishlist'] ) );

$aerial_drone_sticky = get_theme_mod('aerial_drone_sticky');
$aerial_drone_data_sticky = "false";
if ($aerial_drone_sticky) {
$aerial_drone_data_sticky = "true";
}
global $wp_customize;

?>
<div class="main-header">
    <section id="top-header" class="top-bar">
        <div class="wrapper top-wrapper top-box">
            <div class="empty-box">
            </div>
            <div class="top-phone">
                <p><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 384 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M97.3 507c-129.9-129.9-129.7-340.3 0-469.9 5.7-5.7 14.5-6.6 21.3-2.4l64.8 40.5a17.2 17.2 0 0 1 6.8 21l-32.4 81a17.2 17.2 0 0 1 -17.7 10.7l-55.8-5.6c-21.1 58.3-20.6 122.5 0 179.5l55.8-5.6a17.2 17.2 0 0 1 17.7 10.7l32.4 81a17.2 17.2 0 0 1 -6.8 21l-64.8 40.5a17.2 17.2 0 0 1 -21.3-2.4zM247.1 95.5c11.8 20 11.8 45 0 65.1-4 6.7-13.1 8-18.7 2.6l-6-5.7c-3.9-3.7-4.8-9.6-2.3-14.4a32.1 32.1 0 0 0 0-29.9c-2.5-4.8-1.7-10.7 2.3-14.4l6-5.7c5.6-5.4 14.8-4.1 18.7 2.6zm91.8-91.2c60.1 71.6 60.1 175.9 0 247.4-4.5 5.3-12.5 5.7-17.6 .9l-5.8-5.6c-4.6-4.4-5-11.5-.9-16.4 49.7-59.5 49.6-145.9 0-205.4-4-4.9-3.6-12 .9-16.4l5.8-5.6c5-4.8 13.1-4.4 17.6 .9zm-46 44.9c36.1 46.3 36.1 111.1 0 157.5-4.4 5.6-12.7 6.3-17.9 1.3l-5.8-5.6c-4.4-4.2-5-11.1-1.3-15.9 26.5-34.6 26.5-82.6 0-117.1-3.7-4.8-3.1-11.7 1.3-15.9l5.8-5.6c5.2-4.9 13.5-4.3 17.9 1.3z"/></svg><a href="tell:<?php echo esc_html( $aerial_drone_header_phone_number ); ?>"><?php echo esc_html( $aerial_drone_header_phone_number ); ?></a></p>
            </div>
            <div class="top-text">
                <p class="topbar-text">
                    <?php echo esc_html( $aerial_drone_topheader_text ); ?>
                </p>
            </div>
            <div class="theme-header-areas header-areas-right header-button">
                <?php if(class_exists('WOOCS')){ ?>
                    <span class="currency">
                        <?php echo do_shortcode('[woocs]');?>
                    </span>
                <?php }?>
                <?php if( $aerial_drone_header_layout_button || $aerial_drone_header_layout_button_url ){ ?>
                    <span>
                        <a class="button1" href="<?php echo esc_url( $aerial_drone_header_layout_button_url ); ?>"><?php echo esc_html( $aerial_drone_header_layout_button ); ?></a>
                    </span>
                <?php } ?>
                <?php if( $aerial_drone_header_layout_button_1 || $aerial_drone_header_layout_button_1_url ){ ?>
                    <span>
                        <a class="button2" href="<?php echo esc_url( $aerial_drone_header_layout_button_1_url ); ?>"><?php echo esc_html( $aerial_drone_header_layout_button_1 ); ?></a>
                    </span>
                <?php } ?>
            </div>
        </div>
    </section>
    <section id="middle-header" class="header-navbar <?php if( is_user_logged_in() && !isset( $wp_customize ) ){ echo "login-user";} ?>" data-sticky="<?php echo esc_attr($aerial_drone_data_sticky); ?>">
        <div class="wrapper header-wrapper header-box">
            <div class="header-titles">
                <?php
                    aerial_drone_site_logo();
                    aerial_drone_site_description();
                ?>
            </div>
            <div class="theme-header-areas header-areas-right menu-box">
                <div class="site-navigation">
                    <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e('Horizontal', 'aerial-drone'); ?>" role="navigation">
                        <ul class="primary-menu theme-menu">
                            <?php
                            if (has_nav_menu('aerial-drone-primary-menu')) {
                                wp_nav_menu(
                                    array(
                                        'container' => '',
                                        'items_wrap' => '%3$s',
                                        'theme_location' => 'aerial-drone-primary-menu',
                                    )
                                );
                            } else {
                                wp_list_pages(
                                    array(
                                        'match_menu_classes' => true,
                                        'show_sub_menu_icons' => true,
                                        'title_li' => false,
                                        'walker' => new Aerial_Drone_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 aerial_drone_the_theme_svg('menu'); ?>
                        </span>
                    </button>
                </div>
            </div>
            <div class="theme-header-areas header-areas-right search-box">
               <div class="header-search">
                    <?php if(class_exists('woocommerce')){ ?>
                        <?php get_product_search_form(); ?>
                    <?php }?>
               </div>
            </div>
            <div class="theme-header-areas header-areas-right header-meta">
                <?php if( $aerial_drone_header_layout_wishlist ){ ?>
                    <span class="wishlist">
                        <a href="<?php echo esc_url( $aerial_drone_header_layout_wishlist ); ?>">
                            <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M458.4 64.3C400.6 15.7 311.3 23 256 79.3 200.7 23 111.4 15.6 53.6 64.3-21.6 127.6-10.6 230.8 43 285.5l175.4 178.7c10 10.2 23.4 15.9 37.6 15.9 14.3 0 27.6-5.6 37.6-15.8L469 285.6c53.5-54.7 64.7-157.9-10.6-221.3zm-23.6 187.5L259.4 430.5c-2.4 2.4-4.4 2.4-6.8 0L77.2 251.8c-36.5-37.2-43.9-107.6 7.3-150.7 38.9-32.7 98.9-27.8 136.5 10.5l35 35.7 35-35.7c37.8-38.5 97.8-43.2 136.5-10.6 51.1 43.1 43.5 113.9 7.3 150.8z"/></svg>
                        </a>
                    </span>
                <?php } ?>
                <?php if(class_exists('woocommerce')){ ?>
                    <span class="cart_no">
                        <a href="<?php if(function_exists('wc_get_cart_url')){ echo esc_url(wc_get_cart_url()); } ?>" title="<?php esc_attr_e( 'shopping cart','aerial-drone' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M528.1 301.3l47.3-208C578.8 78.3 567.4 64 552 64H159.2l-9.2-44.8C147.8 8 137.9 0 126.5 0H24C10.7 0 0 10.7 0 24v16c0 13.3 10.7 24 24 24h69.9l70.2 343.4C147.3 417.1 136 435.2 136 456c0 30.9 25.1 56 56 56s56-25.1 56-56c0-15.7-6.4-29.8-16.8-40h209.6C430.4 426.2 424 440.3 424 456c0 30.9 25.1 56 56 56s56-25.1 56-56c0-22.2-12.9-41.3-31.6-50.4l5.5-24.3c3.4-15-8-29.3-23.4-29.3H218.1l-6.5-32h293.1c11.2 0 20.9-7.8 23.4-18.7z"/></svg></a>
                        <span class="cart-value"><?php echo wp_kses_data( WC()->cart->get_cart_contents_count() );?></span>

                    </span>
                <?php } ?>
            </div>
        </div>
    </section>
</div>