.navbar {
  background-color: white;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
  padding: 8px 0;
  position: relative;
}

.header .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-weight: bold;
  font-size: 18px;
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-text {
  position: relative;
}

.logo-img {
  width: 320px;
  height: auto;
}

.navbar .navbar-nav {
  display: flex;
}

.navbar-toggler {
  border: none;
  padding: 0;
  margin-right: 15px;
  order: -1;
  display: none;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar .nav-item.dropdown {
  display: flex;
}

.navbar .nav-link .dropdown-arrow {
  font-size: 10px;
  margin-left: 5px;
  transition: transform 0.3s ease;
  color: inherit;
  position: relative;
  top: -2px;
}

.dropdown-toggle::after {
  content: none;
}

.navbar .nav-item.dropdown .nav-link[aria-expanded="true"] {
  background-color: var(--tertiary-color);
  color: var(--primary-color);
  position: relative;
  padding: 8px 8px;
}

.navbar .nav-item.dropdown .nav-link[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 5px;
  right: 5px;
  height: 2px;
  background-color: var(--secondary-color);
  color: var(--secondary-color);
}

.navbar-nav {
  gap: 8px;
}

.nav-link {
  color: var(--oxford-blue-75);
  font-weight: bold;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.3s ease;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--primary-color);
  border-bottom: 2px solid var(--secondary-color);
}

.nav-link.dropdown-toggle.show:hover {
  color: var(--primary-color);
  border-bottom: 2px solid var(--tertiary-color);
}

.nav-link i {
  font-size: 12px;
  margin-left: 5px;
}

.dropdown-menu.mega-menu {
  border: none;
  box-shadow: none;
  background: transparent;
  margin-top: 0;
  padding: 0;
  width: 55vw;
  min-width: 55vw;
  max-width: 55vw;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  position: absolute;
  z-index: 1050;
  display: none;
  height: 460px;
  overflow-y: auto;
}

.dropdown-menu.show {
  display: block;
}

.mega-menu .mega-menu-content {
  width: 100%;
  display: flex;
  padding: 30px 40px;
  gap: 30px;
  justify-content: space-around;
}

.mega-menu .mega-menu-column:first-child {
  flex: 0 0 65%;
  max-width: 65%;
}

.mega-menu .mega-menu-column:last-child {
  flex: 0 0 25%;
  max-width: 25%;
}

.mega-menu .mega-menu-heading {
  color: var(--oxford-blue-100);
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-align: center;
  width: 100%;
}

.mega-menu .mega-menu-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mega-menu .practice-areas-grid {
  display: flex;
  flex-direction: row;
  align-items: start;
  gap: 30px;
}

.mega-menu .practice-areas-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: start;
}

.mega-menu .mega-menu-category {
  margin-bottom: 8px;
  display: block;
}

.mega-menu .mega-menu-main-item {
  color: var(--quaternary-color);
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  background: transparent;
  border: none;
  padding: 0;
  position: relative;
  line-height: 1.4;
  margin-bottom: 4px;
}

.mega-menu .mega-menu-main-item:hover {
  text-decoration: none;
}

.mega-menu .mega-menu-main-item:hover p {
  color: #75263b;
}

/* .mega-menu .mega-menu-main-item:hover p::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
} */

.mega-menu .mega-menu-main-item p {
  display: inline-block;
  position: relative;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.mega-menu .mega-menu-sub-items {
  margin-left: 15px;
  margin-top: 4px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-menu .mega-menu-sub-item {
  color: var(--quaternary-color);
  font-size: 14px;
  font-weight: normal;
  text-decoration: none;
  display: block;
  margin-bottom: 3px;
  transition: all 0.3s ease;
  background: transparent;
  border: none;
  padding: 0;
  position: relative;
  line-height: 1.2;
}

.mega-menu .mega-menu-sub-item:hover {
  text-decoration: none;
}

.mega-menu .mega-menu-sub-item:hover p {
  color: #75263b;
}

/* .mega-menu .mega-menu-sub-item:hover p::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
} */

.mega-menu .mega-menu-sub-item p {
  display: inline-block;
  position: relative;
  margin: 0;
}

.mega-menu .mega-menu-item {
  color: var(--quaternary-color);
  font-size: 13px;
  font-weight: normal;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  background: transparent;
  border: none;
  padding: 0;
  position: relative;
  line-height: 1.2;
}

.mega-menu .mega-menu-item:hover {
  text-decoration: none;
}

.mega-menu .mega-menu-item:hover p::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
}

.mega-menu .mega-menu-item p {
  display: inline-block;
  position: relative;
  margin: 0;
}

.mobile-slide-menu {
  position: absolute;
  top: 0%;
  left: 0;
  width: 100%;
  background-color: var(--cool-grey-03);
  z-index: 9999;
  transform: translateX(-200%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  max-height: calc(100vh - 100px);
}

.mobile-slide-menu.active {
  transform: translateX(0);
}

.mobile-slide-header {
  background-color: #555555;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid #777777;
}

.mobile-back-btn {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.mobile-back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-back-btn i {
  font-size: 12px;
}

.mobile-slide-title {
  color: white;
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

.mobile-slide-content {
  padding: 20px;
}

.mobile-menu-section {
  margin-bottom: 25px;
}

.mobile-section-title {
  color: var(--oxford-blue-85);
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu-item {
  color: var(--oxford-blue-85);
  font-size: 14px;
  font-weight: normal;
  text-decoration: none;
  display: block;
  padding: 10px 0;
  transition: all 0.3s ease;
  background: transparent;
  border: none;
  position: relative;
  line-height: 1.2;
}

.mobile-menu-item:hover {
  text-decoration: none;
}

.mobile-menu-item:hover p::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--secondary-color);
}

.mobile-menu-item p {
  display: inline-block;
  position: relative;
  margin: 0;
}

/* Mobile dropdown styles */
.mobile-dropdown {
  margin-bottom: 2px;
}

.mobile-dropdown-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  color: #75263b;
}

.mobile-dropdown-toggle[aria-expanded="true"] .mobile-arrow {
  transform: rotate(180deg);
}

.mobile-submenu {
  background-color: #555555;
  margin-top: 5px;
  border-radius: 4px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-submenu.show {
  padding: 10px 0 10px 20px;
}

.mobile-arrow {
  transition: transform 0.3s ease;
}

.mobile-arrow.rotated {
  transform: rotate(180deg);
}

.mobile-sub-item {
  color: var(--secondary-color);
  font-size: 13px;
  font-weight: normal;
  text-decoration: none;
  display: block;
  padding: 8px 0;
  transition: all 0.3s ease;
  background: transparent;
  border: none;
  position: relative;
  line-height: 1.2;
}

.mobile-sub-item:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

.mobile-sub-item:hover p::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--secondary-color);
}

.mobile-sub-item p {
  display: inline-block;
  position: relative;
  margin: 0;
}

.search-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-search {
  position: relative;
  cursor: pointer;
}

.search-header::after {
  content: "";
  position: absolute;
  top: 80%;
  left: 0;
  width: 100%;
  height: 16px;
  background-color: transparent;
  z-index: 1;
}

.search-header.active::after {
  z-index: 20000;
}

.search-form {
  position: absolute;
  top: 120%;
  right: 0;
  padding: 12px 16px;
  min-width: 300px;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  background-color: white;
}

input[type="search"].search-input {
  width: 100%;
  font-size: 14px;
}

.search-header.active .search-form {
  opacity: 1;
  pointer-events: auto;
  z-index: 20000;
}

@media screen and (max-width: 1366px) {

  .mega-menu .mega-menu-main-item,
  .mega-menu .mega-menu-main-item p,
  .mega-menu .mega-menu-sub-item,
  .mega-menu .mega-menu-sub-item p {
    font-size: 12px;
  }
}

@media screen and (max-width: 1199.50px) {
  .search-form {
    position: relative;
  }

  .mega-menu-contents {
    display: none;
  }

  .collapse.navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--tertiary-color);
    z-index: 9999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  /* .collapse.navbar-collapse.show {
    max-height: 100%; 
  } */

  .collapse.navbar-collapse:has(.mobile-slide-menu.active) {
    max-height: 700px !important;
    height: calc(100vh - 100px) !important;
  }

  .navbar .navbar-nav {
    flex-direction: column;
    background-color: white;
    padding: 20px;
    gap: 0;
  }

  .nav-link {
    padding: 12px 0;
  }

  .navbar-toggler {
    display: block;
    width: 24px;
    height: 24px;
  }

  .navbar-toggler svg {
    background-color: white;
  }

  .search-header {
    justify-content: start;
    gap: 20px;
  }

  .search-header::after {
    display: none;
  }

  input[type="text"].search-input {
    position: relative;
    top: unset;
    right: unset;
  }
}

@media screen and (max-width: 1199px) {
  .navbar-brand {
    margin: 0 auto;
  }
}

@media screen and (max-width: 991px) {
  .navbar-brand {
    margin: 0 auto;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 250px;
    transform: translate(-50%, -50%);
    font-size: 16px;
    display: flex;
  }
}

@media screen and (min-width: 992px) {
  .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    background-color: inherit;
    display: block !important;
    position: relative;
    width: 100%;
    z-index: auto;
  }

  .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: none;
  }
}

@media screen and (min-width: 1200px) {
  .navbar-nav .nav-link {
    padding: 8px;
  }

  .navbar .dropdown-menu.mega-menu {
    width: 80vw !important;
    min-width: 80vw !important;
    max-width: 80vw !important;
  }

  .navbar-collapse {
    display: flex;
    flex-basis: auto;
    flex-grow: 1;
    align-items: center;
    justify-content: end;
    margin-left: auto;
  }

  .mega-menu-expanded {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #ffffff;
    color: #fff;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: min-height 0.4s ease, max-height 0.4s ease, opacity 0.3s ease;
  }

  .mega-menu-expanded.show {
    min-height: 100px;
    max-height: 600px;
    opacity: 1;
    overflow-y: auto;
  }

  /* .dropdown-menu.show {
    background-color: white;
  } */

  /* Điều chỉnh chiều cao khi có level 3 active */
  .mega-menu-expanded:has(.level-3.show) {
    min-height: 450px;
    max-height: 650px;
  }

  .mega-col {
    flex: 1;
    padding: 20px;
    transition: opacity 0.3s ease;
  }

  .mega-col.level-1 {
    border-right: none;
  }

  .mega-menu-level-2,
  .mega-col.level-3 {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .hidden {
    display: none;
  }

  /* LEVEL 1 */
  .menu-l1 {
    display: flex;
    align-items: center;
    font-size: 14px;
    line-height: 1.4;
    background: none;
    border: none;
    color: var(--quaternary-color);
    font-weight: 700;
    text-align: left;
    padding: 8px 0;
    cursor: pointer;
    width: 100%;
    justify-content: space-between;
  }

  .menu-l1.active {
    color: #75263b;
  }

  .mega-menu-level-2 {
    position: relative;
    min-height: 460px;
  }

  /* LEVEL 2 */
  .level-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
  }

  /* Các items trong level 2 */
  .menu-l2-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--quaternary-color);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 6px 20px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
    gap: 8px;
    border-left: 1px solid #75263b;
  }

  .menu-l2-item:hover,
  .menu-l2-item.active {
    color: #75263b;
  }

  .arrow {
    margin-left: 6px;
    font-weight: bold;
  }

  /* LEVEL 3 */
  .level-3 {
    min-height: 200px;
  }

  .level-3 h3 {
    color: var(--quaternary-color);
    font-weight: 700;
    margin-bottom: 10px;
  }

  .menu-l3-item,
  .level-3-title {
    display: block;
    color: var(--quaternary-color);
    text-decoration: none;
    padding: 6px 20px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
    transition: color 0.2s ease;
    border-left: 1px solid #75263b;
  }

  .menu-l3-item:hover,
  .level-3-title:hover {
    color: #75263b;
  }

  .placeholder {
    color: #aaa;
    font-style: italic;
  }

  /* Smooth hiển thị cho Level 2 */
  .level-2 {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out, visibility 0s 0.25s;
    will-change: opacity;
  }

  .level-2.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.25s ease-in-out, visibility 0s;
    /* overflow-y: scroll; */
  }

  .level-2.hidden {
    display: none;
  }

  /* Smooth hiển thị cho Level 3 */
  .level-3 {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-15px);
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s 0.3s, transform 0.3s ease;
    will-change: opacity, transform;
  }

  .level-3.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0s, transform 0.3s ease;
  }

  /* Class updating để tránh flash khi render content */
  .level-3.updating {
    opacity: 0;
    pointer-events: none;
  }

  /* Ẩn mượt */
  .hidden {
    display: none !important;
  }
}

@media screen and (min-width: 1400px) {
  .navbar .dropdown-menu.mega-menu {
    width: 960px !important;
    min-width: 960px !important;
    max-width: 960px !important;
  }
}