#nav,
#nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#nav li {
  float: left;
  margin: 0;
  padding: 0;
  position: relative;
  display: inline;
}
#nav li a {
  padding: 0 13px;
  line-height: 56px;
  color: #fff;
  font-size: 0.9375em;
  display: inline-block;
  text-decoration: none;
  font-weight: 400;
}
#nav ul {
  width: 286px;
  top: 100%;
  padding: 0;
  left: 0;
  position: absolute;
  border-left: 1px solid #d1d1d1;
  box-shadow: 2px 2px 4px 0px #b9b8b8;
  z-index: 1;
}
.hasJS #nav ul {
  opacity: 0;
  transition: opacity 400ms linear;
  -webkit-transition: opacity 400ms linear;
}
#nav ul li {
  float: left;
  height: auto;
  width: 100%;
  margin: 0;
  padding: 0;
}
#nav ul li a {
  display: block;
  background-color: #fff;
  font-size: 15px;
  line-height: 24px;
  color: #595656;
  border: none;
  border-top: 1px solid #e5e5e5;
  padding: 5px 15px 5px 15px;
  text-align: left;
}

/* Fix for third-level menu positioning */
#nav ul ul {
  top: 0;
  left: 100%; /* Default to right positioning */
  width: 285px;
}

#nav ul  li > ul {
  top: 0;
  left: -100%; /* Move third-level menu to the left side of the parent */
  width: 285px;
  max-height: 200px;
  overflow-y: auto;
}

#nav ul li > ul li > ul {
  top: 0;
  left: -100%; /* Position third-level menu to the left of its parent */
  width: 285px;
}

#nav ul a:hover,
.noJS #nav ul a:focus,
#nav ul a.selected {
  color: #7fb6e9;
}

#nav ul,
#nav :hover ul ul,
#nav .hover ul ul,
#nav .focus ul ul {
  margin-left: -9999px;
}

#nav li:hover > ul,
#nav li.hover > ul,
#nav li.focus > ul,
#nav a:focus + ul,
#nav ul ul,
.noJS #nav .hover a:focus,
.noJS #nav .focus a:focus {
  margin-left: 0;
}

#nav > li > a:hover,
#nav > li.hover > a,
#nav > li.focus > a,
#nav > .highlight > a {
  background-color: #fff;
  color: #162f6a;
}

#nav li ul li a:hover,
#nav li ul li > a.selected,
#nav ul a:hover,
.noJS #nav ul a:focus,
#nav ul a.selected,
#nav ul > .highlight > a {
  background-color: #162f6a;
  color: #fff;
}
