<?php
/**
 * Header Layout
 * @package Omega Refrigeration
 */

$omega_refrigeration_default = omega_refrigeration_get_default_theme_options();



$omega_refrigeration_header_phone_number = esc_html( get_theme_mod( 'omega_refrigeration_header_phone_number',
$omega_refrigeration_default['omega_refrigeration_header_phone_number'] ) );

$omega_refrigeration_sticky = get_theme_mod('omega_refrigeration_sticky');
$omega_refrigeration_data_sticky = "false";
if ($omega_refrigeration_sticky) {
$omega_refrigeration_data_sticky = "true";
}
global $wp_customize;

?>
<div class="main-header">
    <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($omega_refrigeration_data_sticky); ?>">
        <div class="wrapper header-wrapper header-box">
            <div class="header-titles">
                <?php
                    omega_refrigeration_site_logo();
                    omega_refrigeration_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', 'omega-refrigeration'); ?>" role="navigation">
                        <ul class="primary-menu theme-menu">
                            <?php
                            if (has_nav_menu('omega-refrigeration-primary-menu')) {
                                wp_nav_menu(
                                    array(
                                        'container' => '',
                                        'items_wrap' => '%3$s',
                                        'theme_location' => 'omega-refrigeration-primary-menu',
                                    )
                                );
                            } else {
                                wp_list_pages(
                                    array(
                                        'match_menu_classes' => true,
                                        'show_sub_menu_icons' => true,
                                        'title_li' => false,
                                        'walker' => new Omega_Refrigeration_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 omega_refrigeration_the_theme_svg('menu'); ?>
                        </span>
                    </button>
                </div>
            </div>
            <div class="theme-header-areas header-areas-right header-button">
                <div class="phone-icon">
                    <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="M497.4 361.8l-112-48a24 24 0 0 0 -28 6.9l-49.6 60.6A370.7 370.7 0 0 1 130.6 204.1l60.6-49.6a23.9 23.9 0 0 0 6.9-28l-48-112A24.2 24.2 0 0 0 122.6 .6l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.3 24.3 0 0 0 -14-27.6z"/></svg>
                </div>
                <div class="phone-text">
                    <p class="default-text"><?php echo esc_html( 'Call Us','omega-refrigeration'); ?></p>
                    <p><a href="tell:<?php echo esc_html( $omega_refrigeration_header_phone_number ); ?>"><?php echo esc_html( $omega_refrigeration_header_phone_number ); ?></a></p>
                </div>
            </div>
        </div>
    </section>
</div>