/*
Theme Name: Yoome Child
Theme URI: http://demo.theme-sky.com/yoome/
Author: Theme Sky Team
Author URI: http://theme-sky.com/
Description: A Premium and Responsive WordPress theme, designed for E-Commerce websites
Template: yoome
Version: 1.0.0
License: GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Tags: two-columns, left-sidebar, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
Text Domain: yoome-child
*/

@media (max-width: 991px) {

  ul ul {
    display: none !important;
  }

  li.active > ul {
    display: block !important;
  }

}
document.addEventListener("DOMContentLoaded", function(){

  document.querySelectorAll("li > a").forEach(function(item){

    item.addEventListener("click", function(e){

      if (window.innerWidth < 992) {

        var parent = this.parentElement;
        var submenu = parent.querySelector("ul");

        if (submenu) {
          e.preventDefault();

          parent.classList.toggle("active");

          if (submenu.style.display === "block") {
            submenu.style.display = "none";
          } else {
            submenu.style.display = "block";
          }
        }
      }

    });

  });

});