<header class="fl-page-header fl-page-header-primary<?php FLTheme::header_classes(); ?>"<?php FLTheme::header_data_attrs(); ?><?php FLTheme::print_schema( ' itemscope="itemscope" itemtype="https://schema.org/WPHeader"' ); ?>  role="banner">
	<div class="fl-page-header-wrap">
		<div class="fl-page-header-container <?php FLLayout::container_class(); ?> full-width">
			<div class="fl-page-header-row <?php FLLayout::row_class(); ?>">
				<div class="<?php FLLayout::col_classes( array( 'sm' => 12, 'md' => 2 ) ); // @codingStandardsIgnoreLine ?> fl-page-header-logo-col order-1">
					<div class="fl-page-header-logo"<?php echo FLTheme::print_schema( ' itemscope="itemscope" itemtype="https://schema.org/Organization"' ); ?>>
						<a href="<?php echo esc_url( home_url( '/' ) ); ?>" itemprop="url"><?php FLTheme::logo(); ?></a>
						<?php echo FLTheme::get_tagline(); ?>
					</div>
				</div>
				<div class="<?php FLLayout::col_classes( array( 'sm' => 12, 'md' => 8 ) ); // @codingStandardsIgnoreLine ?> fl-page-nav-col order-3 order-md-2">
					<div class="fl-page-nav-wrap">
						<nav class="fl-page-nav fl-nav navbar navbar-default navbar-expand-md" aria-label="<?php echo esc_attr( FLTheme::get_nav_locations( 'header' ) ); ?>"<?php FLTheme::print_schema( ' itemscope="itemscope" itemtype="https://schema.org/SiteNavigationElement"' ); ?> role="navigation">
							<button type="button" class="navbar-toggle navbar-toggler" data-toggle="collapse" data-target=".fl-page-nav-collapse">
								<span><?php FLTheme::nav_toggle_text(); ?></span>
							</button>
							<div class="fl-page-nav-collapse collapse navbar-collapse">
								<?php

								FLTheme::nav_search();

								wp_nav_menu(array(
									'theme_location' => 'header',
									'items_wrap'     => '<ul id="%1$s" class="nav navbar-nav navbar-right %2$s">%3$s</ul>',
									'container'      => false,
									'fallback_cb'    => 'FLTheme::nav_menu_fallback',
									'menu_class'     => 'menu fl-theme-menu',
								));

								?>
							</div>
							
						

							
						</nav>
					</div>
				</div>
				
				<div class="<?php FLLayout::col_classes( array( 'sm' => 12, 'md' => 2 ) ); // @codingStandardsIgnoreLine ?> fl-page-nav-col order-2 order-md-3">
				    
				    <div class="mobile-menu d-block d-sm-none">
				        
				        <?php
                        wp_nav_menu(array(
                            'menu' => 21, // This is the menu ID
                            'container' => 'nav', // Optional: wrap it in a <nav> element
                            'container_class' => 'custom-menu-container', // Optional class for the container
                            'menu_class' => 'custom-menu-mobile', // Optional class for the <ul> element
                        ));
                        ?>

				    </div>
				    
				    
				    <div class="fl-page-nav-wrap d-none d-sm-block">
						<nav class="fl-page-nav fl-nav navbar navbar-default navbar-expand-md" aria-label="<?php echo esc_attr( FLTheme::get_nav_locations( 'header' ) ); ?>"<?php FLTheme::print_schema( ' itemscope="itemscope" itemtype="https://schema.org/SiteNavigationElement"' ); ?> role="navigation">
							<button type="button" class="navbar-toggle navbar-toggler" data-toggle="collapse" data-target=".fl-page-nav-collapse">
								<span><?php FLTheme::nav_toggle_text(); ?></span>
							</button>
							<div class="fl-page-nav-collapse collapse navbar-collapse">
								<?php

								FLTheme::nav_search();

								wp_nav_menu(array(
								    'menu' => 21, // This is the menu ID
									'theme_location' => 'header',
									'items_wrap'     => '<ul id="%1$s" class="nav navbar-nav navbar-right %2$s">%3$s</ul>',
									'container'      => false,
									'fallback_cb'    => 'FLTheme::nav_menu_fallback',
									'menu_class'     => 'menu fl-theme-menu',
								));

								?>
							</div>
							
						

							
						</nav>
					</div>
				    
				</div>
				
				
			</div>
		</div>
	</div>
</header><!-- .fl-page-header -->

<div id="menu-search-form" style="display: none;">
    <?php get_search_form(); ?>
</div>



<script>
jQuery(function($) {
    // Refresh cart icon when item is removed
    $('body').on('click', '.woocommerce-cart-form .remove', function() {
        setTimeout(function() {
            $(document.body).trigger('wc_fragment_refresh');
        }, 500);
    });

    // Refresh when quantity is updated manually
    $('body').on('click', 'button[name="update_cart"]', function() {
        setTimeout(function() {
            $(document.body).trigger('wc_fragment_refresh');
        }, 500);
    });
});



jQuery(document).ready(function($) {
    $('.custom-menu-mobile .menu-item-has-children > a').on('click', function(e) {
        e.preventDefault();

        var parentLi = $(this).parent('li');

        // Close other open submenus (optional)
        $('.custom-menu-mobile li.menu-item-has-children').not(parentLi).removeClass('open');

        // Toggle current
        parentLi.toggleClass('open');
    });

    // Optional: close submenu when clicking outside
    $(document).on('click', function(e) {
        if (!$(e.target).closest('.custom-menu-mobile').length) {
            $('.custom-menu-mobile li.menu-item-has-children').removeClass('open');
        }
    });
});




</script>





