<?php
/**
 * Header Layout
 * @package Event Decorations
 */

$event_decorations_default = event_decorations_get_default_theme_options();

$event_decorations_header_phone_number = esc_html( get_theme_mod( 'event_decorations_header_phone_number',
$event_decorations_default['event_decorations_header_phone_number'] ) );

$event_decorations_header_email = esc_html( get_theme_mod( 'event_decorations_header_email',
$event_decorations_default['event_decorations_header_email'] ) );

$event_decorations_sticky = get_theme_mod('event_decorations_sticky');

$event_decorations_data_sticky = "false";
if ($event_decorations_sticky) {
$event_decorations_data_sticky = "true";
}
?>

<section id="center-header" class="Stickyy <?php if( is_user_logged_in() && !isset( $wp_customize ) ){ echo "login-user";} ?>" data-sticky="<?php echo esc_attr($event_decorations_data_sticky); ?>">
    <div class=" header-main">
        <div class="header-right-box theme-header-areas">
            <header id="site-header" class=" site-header-layout header-layout" role="banner">
                <section id="top-header" class="top-bar">
                    <div class="wrapper header-wrapper top-box ">
                        <div class="theme-header-areas header-areas-right header-logo">
                            <div class="header-titles">
                                <?php
                                    event_decorations_site_logo();
                                    event_decorations_site_description();
                                ?>
                            </div>
                        </div>
                        <div class="theme-header-areas header-areas-right woo-box">
                            <div class="theme-header-areas header-areas-right header-meta">
                                <?php get_search_form(); ?>
                            </div>
                            <div class="wislist-btn">
                                <?php if(defined('YITH_WCWL')){ ?>
                                    <a class="wishlist_view" href="<?php echo YITH_WCWL()->get_wishlist_url(); ?>" title="<?php esc_attr_e('Wishlist','event-decorations'); ?>"><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="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><?php esc_html_e('Wishlist','event-decorations'); ?></a>
                                <?php }?>
                            </div>
                            <?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','event-decorations' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 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=""><?php echo esc_html('Cart','event-decorations');?></span>

                                </span>
                            <?php } ?>
                            <?php if(class_exists('woocommerce')){ ?>
                                <?php if ( is_user_logged_in() ) { ?>
                                    <a class="account-area" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','event-decorations'); ?>"><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="M313.6 304c-28.7 0-42.5 16-89.6 16-47.1 0-60.8-16-89.6-16C60.2 304 0 364.2 0 438.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-25.6c0-74.2-60.2-134.4-134.4-134.4zM400 464H48v-25.6c0-47.6 38.8-86.4 86.4-86.4 14.6 0 38.3 16 89.6 16 51.7 0 74.9-16 89.6-16 47.6 0 86.4 38.8 86.4 86.4V464zM224 288c79.5 0 144-64.5 144-144S303.5 0 224 0 80 64.5 80 144s64.5 144 144 144zm0-240c52.9 0 96 43.1 96 96s-43.1 96-96 96-96-43.1-96-96 43.1-96 96-96z"/></svg><?php esc_html_e('Signout','event-decorations'); ?></a>
                                <?php }
                                else { ?>
                                    <a class="account-area" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Login / Register','event-decorations'); ?>"><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="M313.6 304c-28.7 0-42.5 16-89.6 16-47.1 0-60.8-16-89.6-16C60.2 304 0 364.2 0 438.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-25.6c0-74.2-60.2-134.4-134.4-134.4zM400 464H48v-25.6c0-47.6 38.8-86.4 86.4-86.4 14.6 0 38.3 16 89.6 16 51.7 0 74.9-16 89.6-16 47.6 0 86.4 38.8 86.4 86.4V464zM224 288c79.5 0 144-64.5 144-144S303.5 0 224 0 80 64.5 80 144s64.5 144 144 144zm0-240c52.9 0 96 43.1 96 96s-43.1 96-96 96-96-43.1-96-96 43.1-96 96-96z"/></svg><?php esc_html_e('Signup','event-decorations'); ?></a>
                                <?php } ?>
                            <?php }?>
                        </div>
                    </div>
                </section>
                <div class="wrapper">
                    <div class="header-center">
                        <div class="theme-header-areas header-areas-right header-menu">
                            <div class="site-navigation">
                                <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e('Horizontal', 'event-decorations'); ?>" role="navigation">
                                    <ul class="primary-menu theme-menu">
                                        <?php
                                        if (has_nav_menu('event-decorations-primary-menu')) {
                                            wp_nav_menu(
                                                array(
                                                    'container' => '',
                                                    'items_wrap' => '%3$s',
                                                    'theme_location' => 'event-decorations-primary-menu',
                                                )
                                            );
                                        } else {
                                            wp_list_pages(
                                                array(
                                                    'match_menu_classes' => true,
                                                    'show_sub_menu_icons' => true,
                                                    'title_li' => false,
                                                    'walker' => new Event_Decorations_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 event_decorations_the_theme_svg('menu'); ?>
                                    </span>
                                </button>
                            </div>
                        </div>
                        <?php if( $event_decorations_header_email ){ ?>
                            <div class="top-phone ">
                                <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="M176 216h160c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16zm-16 80c0 8.8 7.2 16 16 16h160c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16v16zm96 121.1c-16.4 0-32.8-5.1-46.9-15.2L0 250.9V464c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V250.9L302.9 401.9c-14 10.1-30.4 15.2-46.9 15.2zm237.6-254.2c-8.9-6.9-17.2-13.5-29.6-22.8V96c0-26.5-21.5-48-48-48h-77.6c-3-2.2-5.9-4.3-9-6.6C312.6 29.2 279.2-.4 256 0c-23.2-.4-56.6 29.2-73.4 41.4-3.2 2.3-6 4.4-9 6.6H96c-26.5 0-48 21.5-48 48v44.1c-12.4 9.3-20.8 15.9-29.6 22.8A48 48 0 0 0 0 200.7v10.7l96 69.4V96h320v184.7l96-69.4v-10.7c0-14.7-6.8-28.7-18.4-37.8z"/></svg><a href="mailto:<?php echo esc_html( $event_decorations_header_email ); ?>"><?php echo esc_html( $event_decorations_header_email ); ?></a>
                                </p>
                            </div>
                        <?php } ?>
                        <?php if( $event_decorations_header_phone_number ){ ?>
                            <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( $event_decorations_header_phone_number ); ?>"><?php echo esc_html( $event_decorations_header_phone_number ); ?></a>
                                </p>
                            </div>
                        <?php } ?>
                    </div>
                </div>
            </header>
        </div>
    </div>
</section>