(function($) {
    "use strict";

    $(document).on('ready', function() {	
		
		// Menu Click JS
		$('.menu-click,.close-menu a').on('click', function(){
			$('.menu-inner').toggleClass('active');
		});

		$(".close-menu a").focusout(function(){
			$("#side-menu  > ul li:first-child > a").focus();
			$(".menu-click").addClass('active');

		});

	});	
	
	
	jQuery(window).on('load', function() {
	    // init Masonry
		var $grid = $('.grshop-grocery-masonry').masonry({
			// options
			itemSelector: '.grshop-grocery-masonry-item',
		});
		// layout Masonry after each image loads
		$grid.imagesLoaded().progress( function() {
			$grid.masonry('layout');
		});
	});

	jQuery(document).ready(function($) {
		$("#primary-menu,.grshop-grocery-header__nav");
		$("#primary-menu,.grshop-grocery-header__nav").KeyboardAccessibleDropDown();
	  });
	  
	  $.fn.KeyboardAccessibleDropDown = function() {
		var nav = $(this);
		$("a", nav).focus(function() {
		  $(this).parents("li").addClass("active-focus")
		}).blur(function() {
		  $(this).parents("li").removeClass("active-focus")
		});
	  };

	/*================================
		Owl Carousel JS
	==================================*/
	jQuery('.oa-hero-slider').owlCarousel({
		items: 1,
		autoplay: true,
		loop: false,
		autoplayTimeout: 4000,
		autoplayHoverPause: true,
		smartSpeed: 500,
		merge: true,
		nav: true,
		navText: ['<i class="fa-solid fa-arrow-left"></i>', '<i class="fa-solid fa-arrow-right"></i>'],
		dots: false,
		margin: 0,
	});

	
	
})(jQuery);

new ModalVideo('.oa-video-popup');


