<?php
/**
 * Header Layout
 * @package Modern Art Gallery
 */

$modern_art_gallery_defaults = modern_art_gallery_get_default_theme_options();

$modern_art_gallery_sticky = get_theme_mod('modern_art_gallery_sticky');
$modern_art_gallery_data_sticky = "false";
if ($modern_art_gallery_sticky) {
$modern_art_gallery_data_sticky = "true";
}
global $wp_customize;

$modern_art_gallery_header_search = get_theme_mod( 'modern_art_gallery_header_search', 
$modern_art_gallery_defaults['modern_art_gallery_header_search'] );

$modern_art_gallery_header_layout_button_text = esc_html( get_theme_mod( 'modern_art_gallery_header_layout_button_text',
$modern_art_gallery_defaults['modern_art_gallery_header_layout_button_text'] ) );

$modern_art_gallery_header_layout_button_url = esc_html( get_theme_mod( 'modern_art_gallery_header_layout_button_url',
$modern_art_gallery_defaults['modern_art_gallery_header_layout_button_url'] ) );

$modern_art_gallery_header_phone_number = esc_html( get_theme_mod( 'modern_art_gallery_header_phone_number',
$modern_art_gallery_defaults['modern_art_gallery_header_phone_number'] ) );

$modern_art_gallery_header_timing = esc_html( get_theme_mod( 'modern_art_gallery_header_timing',
$modern_art_gallery_defaults['modern_art_gallery_header_timing'] ) );

$modern_art_gallery_header_address = esc_html( get_theme_mod( 'modern_art_gallery_header_address',
$modern_art_gallery_defaults['modern_art_gallery_header_address'] ) );


$modern_art_gallery_header_layout_wishlist = esc_html( get_theme_mod( 'modern_art_gallery_header_layout_wishlist',
$modern_art_gallery_defaults['modern_art_gallery_header_layout_wishlist'] ) );

?>
<div class="main-header-box">
    <section id="top-header" class="top-bar">
        <div class="wrapper header-wrapper top-box">
            <div class="top-phone border-top">
                <p class="time"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 8C119 8 8 119 8 256S119 504 256 504 504 393 504 256 393 8 256 8zm92.5 313h0l-20 25a16 16 0 0 1 -22.5 2.5h0l-67-49.7a40 40 0 0 1 -15-31.2V112a16 16 0 0 1 16-16h32a16 16 0 0 1 16 16V256l58 42.5A16 16 0 0 1 348.5 321z"/></svg><a href="mailto:<?php echo esc_html( $modern_art_gallery_header_timing ); ?>"><?php echo esc_html( $modern_art_gallery_header_timing ); ?></a></p>
            </div>
            <div class="right-contact-box">
                <div class="top-phone">
                    <p class="address"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M172.3 501.7C27 291 0 269.4 0 192 0 86 86 0 192 0s192 86 192 192c0 77.4-27 99-172.3 309.7-9.5 13.8-29.9 13.8-39.5 0zM192 272c44.2 0 80-35.8 80-80s-35.8-80-80-80-80 35.8-80 80 35.8 80 80 80z"/></svg><?php echo esc_html( $modern_art_gallery_header_address ); ?></p>
                </div>
                <div class="top-phone border-top">
                    <p><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.1 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><a href="tell:<?php echo esc_html( $modern_art_gallery_header_phone_number ); ?>"><?php echo esc_html( $modern_art_gallery_header_phone_number ); ?></a></p>
                </div>
                
            </div>
        </div>
    </section>
    <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($modern_art_gallery_data_sticky); ?>">
            <div class="wrapper header-wrapper">
                <div class="theme-header-areas header-areas-left aa">
                    <div class="header-titles">
                        <?php
                        modern_art_gallery_site_logo();
                        modern_art_gallery_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', 'modern-art-gallery'); ?>" role="navigation">
                                <ul class="primary-menu theme-menu">
                                    <?php
                                    if (has_nav_menu('modern-art-gallery-primary-menu')) {
                                        wp_nav_menu(
                                            array(
                                                'container' => '',
                                                'items_wrap' => '%3$s',
                                                'theme_location' => 'modern-art-gallery-primary-menu',
                                            )
                                        );
                                    } else {
                                        wp_list_pages(
                                            array(
                                                'match_menu_classes' => true,
                                                'show_sub_menu_icons' => true,
                                                'title_li' => false,
                                                'walker' => new Modern_Art_Gallery_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 modern_art_gallery_the_theme_svg('menu'); ?>
                                </span>
                            </button>
                        </div>
                    </div>
                    <div class="theme-header-areas header-areas-right header-contact cc">
                        <?php if( $modern_art_gallery_header_search ){ ?>
                            <span class="header-search"> 
                                <a href="#search">
                                  <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6 .1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>
                                </a>
                                <!-- Search Form -->
                                <div id="search">
                                    <span class="close">X</span>
                                    <?php get_search_form(); ?>
                                </div>
                            </span>
                        <?php } ?>
                        <?php if( $modern_art_gallery_header_layout_wishlist ){ ?>
                            <span class="wishlist">
                                <a href="<?php echo esc_url( $modern_art_gallery_header_layout_wishlist ); ?>">
                                    <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"/></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','modern-art-gallery' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48C336 50.1 285.9 0 224 0S112 50.1 112 112l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"/></svg></a>
                            </span>
                        <?php } ?>
                    </div>
                    <div class="theme-header-areas header-areas-right header-btn dd">
                        <div class="header-button-box">
                            <?php if( $modern_art_gallery_header_layout_button_text || $modern_art_gallery_header_layout_button_url  ){ ?>
                                <a href="<?php echo esc_url( $modern_art_gallery_header_layout_button_url ); ?>"><?php echo esc_html( $modern_art_gallery_header_layout_button_text ); ?></a>
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>
</div>