/*
Theme Name: <Theme_Name>
Author: <Theme_Author>
Author URI: <Theme_Author_URI>
Description: <Theme_Description>
Version: 1.0.0
License:
License URI:
Tags:
Text Domain: <Theme_Text_Domain>
*/

/** 
 * Nested menu support
 * Styles for multi-level navigation menus
 */

.menu-item-has-children {
  position: relative;
}

.menu-item-has-children > .sub-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 200px;
  background: #000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 1000;
  padding: 0;
  margin: 0;
  list-style: none;
  padding-bottom: 8px;
  padding-top: 10px;
}

.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.sub-menu .menu-item {
  position: relative;
}

.sub-menu .sub-menu {
  left: 100%;
  top: 0;
  margin-left: 0;
  margin-top: 0;
}

.sub-menu {
  background: #fff;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 0;
  margin: 0;
  list-style: none;
}

.sub-menu li {
  width: 100%;
}

.sub-menu li a {
  display: block;
  padding: 10px 20px;
  color: #222;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}



/* Optional: indicate parent menu items with a caret */
.menu-item-has-children > a:after {
  content: " ▼";
  font-size: 0.7em;
  vertical-align: middle;
  color: #888;
}

/* Responsive: always show submenus on mobile devices */
@media (max-width: 768px) {
  .menu-item-has-children > .sub-menu {
    position: static;
    display: block !important;
    box-shadow: none;
    background: transparent;
    margin-left: 20px;
  }
  .menu-item-has-children.open > .sub-menu {
    display: block !important;
  }
  .sub-menu li a {
    padding-left: 30px;
  }
}

/* Mobile menu scrollable fix */
.menu-open #header .nav-wrapper {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Ensure mobile menu content is scrollable */
@media (max-width: 768px) {
  .menu-open #header .nav-wrapper {
    height: calc(100vh - 79px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 70px;
  }
  
  /* Make sure menu items don't get cut off */
  .menu-open #header .nav-wrapper #menu-header-main {
    padding-bottom: 20px;
  }
  
  /* Ensure utility menu is also scrollable */
  .menu-open #header .nav-wrapper .menu-header-utility-container {
    position: relative;
    bottom: auto;
    margin-top: auto;
  }
}
