;(function($, window, document, undefined) {
	var $win = $(window);
	var $doc = $(document);

	$doc.ready(function() {

		// Burger trigger button
		$('.nav-trigger').on('click', function(event) {
			event.preventDefault();

			$('.nav-trigger').toggleClass('active');

			$('.header .nav').slideToggle();
		});

		$('.nav__dropdown').parent().addClass('has-dropdown');

		$('.has-dropdown > a').on('click', function(event){
			var $link = $(this);

			if($win.width() > 767){
				return;
			}

			if(!$link.hasClass('clicked')){
				event.preventDefault();
			}

			// add clicked class to the link
			$link.addClass('clicked');

			// remove clicked class to other links
			$link.parent().siblings().find('.clicked').removeClass('clicked');

			// show dropdown and hide other dropdowns
			$link.next().slideDown().parent().siblings().find('.nav__dropdown').slideUp();
		});

		// Slider
		$('.slider .slider__slides').slick({
			autoplay: false,
			autoplaySpeed: 7000,
			slidesToShow: 1,
			slidesToScroll: 1,
			arrows: false
		});
	});

})(jQuery, window, document);
