.cascading-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.8rem);
  left: -1.2rem;
  border-radius: 0.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 20rem;
  width: auto;
  max-width: 27.5rem;
  z-index: 1000;
  padding: 0.8rem 0;
}

.cascading-menu.active {
  display: block;
}

.cascading-menu-item {
  position: relative;
  display: flex;
  flex-direction: row;
  padding: 1.4rem 2rem;
  margin: 0;
  cursor: pointer;
  transition: background-color 0.2s;
  align-items: flex-start;
}

.cascading-menu-item.has-children {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.cascading-submenu {
  position: absolute;
  top: 0;
  left: 100%;
  display: none;
  border-radius: 0.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 15rem;
  max-width: 27.5rem;
  padding: 0.8rem 0;
}

.cascading-submenu.show {
  display: block;
  opacity: 1;
  visibility: visible;
}

.cascading-menu-item a {
  text-decoration: none;
  flex-grow: 1;
  min-width: 0;
  white-space: nowrap;
}

.cascading-menu-item a:hover {
  text-decoration: underline;
}

.nav-item {
  position: relative;
}

.nav-item:hover .cascading-menu,
.nav-item .cascading-menu:hover {
  display: block;
}

/* pseudo-element to create the hover bridge, used to prevent the menu from closing when hovering over the gap */
.nav-item::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 0.8rem;
  background: transparent;
  pointer-events: all;
  z-index: 1001;
}

.chevron-icon {
  flex-shrink: 0;
  margin-left: 0.8rem;
  rotate: -90deg;
}
