$(document).ready(function(){
	
	$('ul.tabs li').click(function(){
		var tab_id = $(this).attr('data-tab');

		$('ul.tabs li').removeClass('current');
		$('.tab-content').removeClass('current');

		$(this).addClass('current');
		$("#"+tab_id).addClass('current');
	})

})

jQuery(document).ready(function ($) {
    $('#search-icon').on('click keydown', function (event) {
        // Check if the event is a click or an "Enter" or "Space" key press
        if (event.type === 'click' || event.key === 'Enter' || event.key === ' ') {
            $('#search-form-container').toggleClass('visible');
            
            // Check if the search form is now visible
            if ($('#search-form-container').hasClass('visible')) {
                // Find the first input field within the search form and focus it
                $('#search-form-container').find('input[type="search"]').focus();
            }

            // Prevent default action for "Space" to avoid scrolling the page
            event.preventDefault();
        }
    });
});


//owl carousel slider
jQuery(document).ready(function ($) {
	$(".owl-carousel").owlCarousel({
		loop: true, // Enable infinite loop
		margin: 20, // Space between items
		nav: true, // Show navigation arrows
		dots: false, // Disable dots
		autoplay: true, // Enable autoplay
		autoplayTimeout: 3000, // 3 seconds delay
		autoplayHoverPause: true, // Pause on hover
		slideBy: 1, // Slide one box at a time
		responsive: {
			0: { items: 1 }, // 1 box on small screens
			600: { items: 2 }, // 2 boxes on medium screens
			1000: { items: 4 } // 4 boxes on large screens
		}
	});
});