function home_gardening_mobile_menu_open() {
  jQuery(".side_nav").addClass('show');
}
function home_gardening_mobile_menu_close() {
  jQuery(".side_nav").removeClass('show');
}

jQuery(function($){
  $('.toggle').click(function () {
    home_gardening_Keyboard_loop($('.side_nav'));
  });
});

var home_gardening_Keyboard_loop = function (elem) {
  var home_gardening_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var home_gardening_firstTabbable = home_gardening_tabbable.first();
  var home_gardening_lastTabbable = home_gardening_tabbable.last();
  home_gardening_firstTabbable.focus();

  home_gardening_lastTabbable.on('keydown', function (e) {
    if ((e.which === 9 && !e.shiftKey)) {
      e.preventDefault();
      home_gardening_firstTabbable.focus();
    }
  });

  home_gardening_firstTabbable.on('keydown', function (e) {
    if ((e.which === 9 && e.shiftKey)) {
      e.preventDefault();
      home_gardening_lastTabbable.focus();
    }
  });

  elem.on('keyup', function (e) {
    if (e.keyCode === 27) {
      elem.hide();
    };
  });
};

jQuery(document).ready(function($) {
  var isRtl = $('html').attr('dir') === 'rtl'; // Check if the site is RTL

  $('#main-banner-wrap .owl-carousel').owlCarousel({
      loop: true,
      margin: 0,
      nav: false,
      dots: false,
      navText: [
        '<span>PREV</span>', // Left arrow
        '<span>NEXT</span>' // Right arrow
      ],
      rtl: isRtl,
      responsive: {
        0: {
          items: 1,
          dots: false,
        },
        600: {
          items: 1,
        },
        1000: {
          items: 1,
        }
      }
  });
});

jQuery(window).scroll(function () {
    if (jQuery(this).scrollTop() >= 200) {
        jQuery("#return-to-top").fadeIn();
    } else {
        jQuery("#return-to-top").fadeOut();
    }
});

jQuery("#return-to-top").click(function () {
    jQuery("html, body").animate({ scrollTop: 0 }, 600);
});

jQuery(document).ready(function($) {
  $(window).scroll(function() {
      if ($('.sticky-header').length) {
          if ($(this).scrollTop() > 50) {
              $('.upper-header-area.sticky-header').addClass('sticky-active');
          } else {
              $('.upper-header-area.sticky-header').removeClass('sticky-active');
          }
      }
  });
});