.site-header {
  background-color: var(--primary-color);
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  height: var(--height-header);
  position: relative;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
  gap: 20px;
  margin-top: 0;
  margin-bottom: 0;
  height: 100%;
}

.site-branding {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-logo-link img {
  max-width: 180px !important;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-header-color);
  cursor: pointer;
}

.main-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.main-navigation div {
  width: 100%;
  height: 100%;
}

.list-menu-header {
  display: flex;
  align-items: center;
  justify-content: stretch;
  width: 100%;
  height: 100%;
  gap: 16px;
}

.list-menu-header .menu-item {
  display: flex;
  align-items: center;
  min-width: max-content;
  height: 100%;
  position: relative;
}

.list-menu-header .menu-item a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-header-color);
  text-align: center;
  font-size: 15px;
}

.list-menu-header > .menu-item.current-menu-item > a {
  color: var(--secondary-color);
}

.list-menu-header .sub-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 20%;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--background-body-color);
}

.list-menu-header .sub-menu {
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--background-body-color);
  border-radius: 0 0 12px 12px;
  z-index: 100;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: grid; /* Giữ display là grid để có thể sử dụng grid layout */
  /* grid-template-rows: repeat(5, 42px); */
  grid-auto-flow: column;
  gap: 0;
  pointer-events: none; /* Ngăn không cho sub-menu tương tác khi ẩn */
}

.list-menu-header > .menu-item.has-children.current-menu-item > a::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--secondary-color);
}

.list-menu-header .menu-item:hover .sub-menu {
  opacity: 1;
  transform: scaleY(1);
  pointer-events: auto; /* Cho phép tương tác khi hiển thị */
}

.list-menu-header .sub-menu .menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: disc;
  padding: 12px;
}

.list-menu-header .sub-menu .menu-item a {
  display: flex;
  width: 100%;
  height: 100%;
  color: var(--text-color);
  text-align: left;
  border-radius: 0;
  align-items: center;
  justify-content: flex-start;
}

.list-menu-header .sub-menu .menu-item a::before {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  margin-right: 12px;
}

.list-menu-header .sub-menu .menu-item a:hover {
  color: var(--secondary-color);
  opacity: 0.8;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -80%;
  width: 80%;
  height: 100%;
  background-color: var(--primary-color);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
}

.mobile-sidebar.open {
  left: 0;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

.modal-overlay.active {
  display: block;
}

.mobile-list-menu-header {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.mobile-list-menu-header .menu-item {
  width: 100%;
  position: relative;
}

.mobile-list-menu-header .menu-item a {
  padding: 12px;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-header-color);
}

.mobile-list-menu-header .sub-menu {
  margin-left: 24px;
}

.mobile-list-menu-header .sub-menu .menu-item a {
  position: relative;
  justify-content: flex-start;
  padding: 6px 0;
}

.mobile-list-menu-header .sub-menu .menu-item a::before {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--text-header-color);
  margin-right: 12px;
}

.mobile-list-menu-header .submenu-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  cursor: pointer;
  margin-left: 10px;
}

.mobile-list-menu-header .submenu-arrow::before {
  content: "▶";
  display: inline-block;
  color: var(--text-header-color);
  padding: 6px;
}

.mobile-list-menu-header .submenu-arrow.open::before {
  content: "▼";
  color: var(--text-header-color);
  padding: 6px;
}

.mobile-list-menu-header .sub-menu {
  display: none;
  flex-direction: column;
}

.mobile-list-menu-header .sub-menu.open {
  display: flex;
}

@media screen and (max-width: 900px) {
  .main-navigation {
    display: none;
  }
  .menu-toggle {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
  }

  .site-header .container {
    justify-content: flex-start;
  }
}
