/* Simple 4-level dropdown menu for desktop */
.vhc-menu, .vhc-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vhc-menu {
  display: flex;
  background: #fff;
}
.vhc-menu > li {
  position: relative;
}
.vhc-menu a {
  display: block;
  padding: 12px 20px;
  color: #222;
  text-decoration: none;
  background: #fff;
  white-space: nowrap;
  font-size: 16px;
}
.vhc-menu li:hover > a
/* .vhc-menu li:focus-within > a  */
{
  background: #009049;
  color: #fff;
}
.vhc-menu ul {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
}
.vhc-menu li:hover > ul
/* 
.vhc-menu li:focus-within > ul
*/
{
  display: block;
} 
.vhc-menu ul ul {
  left: 100%;
  top: 0;
}
.vhc-menu li {
  position: relative;
}
.vhc-menu li li {
  min-width: 200px;
  border-bottom: 1px solid #ddd;
}
.vhc-menu li li ul {
  left: 100%;
  top: 0;
}
.vhc-menu li li li ul {
  left: 100%;
  top: 0;
}

/* Hamburger button */
.vhc-menu-toggle {
  display: none;
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1201;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.vhc-menu-toggle span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: #009049;
  border-radius: 2px;
  transition: all 0.3s;
  top: -10px;
}

/* Overlay for mobile menu */
.vhc-menu-mobile-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1200;
}

/* Mobile menu container */
.vhc-menu-mobile-container {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 80vw;
  max-width: 340px;
  height: 100vh;
  background: #fff;
  z-index: 1202;
  box-shadow: -2px 0 12px rgba(0,0,0,0.12);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s;
}
.vhc-menu-mobile-container.open {
  display: block;
  transform: translateX(0);
  margin-top: 124px;
}
.vhc-menu-mobile-overlay.open {
  display: block;
}
.vhc-menu-toggle.open {
  z-index: 1300;
}

/* Hide desktop menu on mobile, show hamburger */
@media (max-width: 991px) {
  .vhc-menu {
    display: none !important;
  }
  .vhc-menu-toggle {
    display: flex;
  }
  .vhc-menu-mobile-container {
    display: block;
  }
}

/* Mobile menu style: vertical, expand/collapse */
.vhc-menu-mobile-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vhc-menu-mobile-container li {
  border-bottom: 1px solid #eee;
  position: relative;
}
.vhc-menu-mobile-container a {
  display: block;
  padding: 14px 20px;
  color: #222;
  text-decoration: none;
  background: #fff;
}
.vhc-menu-mobile-container li.has-children > a:after {
  content: '\25B6';
  float: right;
  font-size: 13px;
  margin-left: 8px;
  transition: transform 0.2s;
}
.vhc-menu-mobile-container li.open > a:after {
  transform: rotate(90deg);
}
.vhc-menu-mobile-container ul ul {
  display: none;
  background: #f8f8f8;
}
.vhc-menu-mobile-container li.open > ul {
  display: block;
}

/* Icon chỉ báo menu con (mũi tên) */
.vhc-menu-arrow {
  font-size: 13px;
  margin-left: 8px;
  color: #888;
  display: inline-block;
  vertical-align: middle;
}

/* Caret icon for menu children (desktop) */
.vhc-menu-caret {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #888;
  vertical-align: middle;
  transition: transform 0.2s, color 0.2s;
}
.vhc-menu li.has-children > a {
  position: relative;
}
.vhc-menu li.has-children > a .vhc-menu-caret {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
}
.vhc-menu li.has-children:hover > a .vhc-menu-caret,
.vhc-menu li.has-children:focus-within > a .vhc-menu-caret {
  color: #fff;
  transform: translateY(-50%) rotate(90deg);
}
.vhc-menu li.has-children:hover > a
/* .vhc-menu li.has-children:focus-within > a  */
{
  background: #009049;
  color: #fff;
}
.vhc-menu li.has-children:hover > a .vhc-menu-caret,
.vhc-menu li.has-children:focus-within > a .vhc-menu-caret {
  color: #fff;
}
@media (max-width: 991px) {
  .vhc-menu-caret { display: none; }
}

/* Ẩn mũi tên ở mobile nếu đã có mũi tên CSS */
@media (max-width: 991px) {
  .vhc-menu-arrow {
    display: none;
  }
}

/* Active menu: bôi đậm, màu #009049 cho text và icon */
.vhc-menu-link.active,
.vhc-menu li.active > a {
  color: #009049 !important;
  font-weight: bold;
}
.vhc-menu li.active > a .vhc-menu-caret,
.vhc-menu-link.active .vhc-menu-caret {
  color: #009049 !important;
}

/* Khi hover vào menu active thì text và icon chuyển trắng */
.vhc-menu li.active:hover > a,
/* .vhc-menu li.active:focus-within > a, */
.vhc-menu-link.active:hover
/* .vhc-menu-link.active:focus  */
{
  color: #fff !important;
  background: #009049 !important;
}
.vhc-menu li.active:hover > a .vhc-menu-caret,
.vhc-menu li.active:focus-within > a .vhc-menu-caret,
.vhc-menu-link.active:hover .vhc-menu-caret,
.vhc-menu-link.active:focus .vhc-menu-caret {
  color: #fff !important;
}

/* Không xoay caret ở menu cấp 0 khi hover */
.vhc-menu > li.has-children > a .vhc-menu-caret {
  transform: none !important;
}
.vhc-menu > li.has-children:hover > a .vhc-menu-caret,
.vhc-menu > li.has-children:focus-within > a .vhc-menu-caret {
  transform: none !important;
}

/* Đảm bảo caret luôn căn giữa chữ (vertical-align middle, position absolute center) */
.vhc-menu-caret, .vhc-menu-caret .glyphicon {
  vertical-align: middle !important;
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%) !important;
  margin-left: 0 !important;
  font-size: 12px;
  line-height: 1;
}
