/* Header Background */
.header-bg {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.desktop {
  display: flex;
  align-items: center;
  /* Căn giữa theo chiều dọc */
  justify-content: space-between;
  /* Giãn đều trên 1 hàng */
  width: 100%;
  flex-wrap: nowrap;
  /* Ép luôn nằm 1 hàng */
}

.header-container {
  max-width: 1440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  position: relative;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 112px;
  width: 100%;
}

.header-logo {
  padding-top: 8px;
}

/* Logo */
.header-logo img {
  height: 40px;
  width: auto;
}

/* Navigation */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-nav-list {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.header-nav-item {
  position: relative;
  height: 30px;
}

.header-nav-item > a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  transition: color 0.2s;
}

.header-nav-item > a:hover {
  color: #0066cc;
}

.header-nav-item > a i {
  font-size: 10px;
  transition: transform 0.3s;
}

.header-nav-item:hover > a i {
  transform: rotate(180deg);
}


.mega-menu{
  position: fixed;
  left: 0;
  right: 0;
  background: #fff;
  padding: 20px 50px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
  z-index: 999;
}

.is-login .mega-menu {
  top: 120px;
}
.is-nologin .mega-menu {
  top: 90px;
}

.header-nav-item.has-mega{
  position: relative;
}
.header-nav-item.has-mega::after{
  content: "";
  position: absolute;
  left: -40px;
  right: -40px;
  top: 100%;
  height: 60px; 
  background: transparent;
}


.header-nav-item.has-mega:hover .mega-menu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .3s ease, transform .3s ease, visibility 0s;
}


.mega-menu span {
  color: #1463a6;
  font-weight: 500;
  font-size: 14px;
}

.mega-menu > .base-layout > span {
  display: block;
  color: #0066cc;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

.mega-menu-global {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 12px;
}

.mega-menu-left {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.mega-menu-item {
  margin-bottom: 4px;
}

.mega-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #1a1a1a;
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 8px;
  position: relative;
}

.mega-menu-link:hover {
  background: #f5f9ff;
}

.mega-menu-link {
  display: inline-flex;
  /* Thay flex thành inline-flex để vừa chữ vừa mũi tên */
  align-items: center;
  gap: 8px;
  /* khoảng cách giữa chữ và mũi tên */
  position: relative;
}

.mega-menu-link::after {
  content: "→";
  position: static;
  transform: none;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.mega-menu-link:hover::after {
  opacity: 1;
  transform: translateX(2px);
  /* chỉ nhích mũi tên khi hover */
}

.mega-menu-icon {
  width: 24px;
  height: 24px;
}

.mega-menu-icon img {
  max-width: 100%;
  height: auto;
}

.mega-menu-text {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
}

.mega-menu-link:hover .mega-menu-text {
  color: #0066cc;
}

.mega-menu-right {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  /* tăng chiều cao để ảnh to hơn */
}

.mega-menu-right img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Header Right */
.header-right {
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-lang select {
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: white;
  color: #1a1a1a;
}

.header-btn-link {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(94deg, #0da8ff 0%, #005096 100.98%);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 153, 255, 0.3);
}

.getDemo {
  display: inline-block;
  padding: 10px 24px;
  background: #fff;
  color: black;
  text-decoration: none;
  border-radius: 6px;
  border: #000 2px solid;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 153, 255, 0.3);
}

/* Mobile */
.mobile {
  display: none;
}

.header-mobile {
  padding: 0 20px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
}

.header-mobile-logo img {
  height: 40px;
  left: 30px;
}

.header-mobile-toggle {
  font-size: 24px;
  cursor: pointer;
  right: 30px;
}

.mobile-menu-overlay {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 998;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 72px;
  right: -100%;
  width: 100%;
  height: calc(100vh - 72px);
  background: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.mobile-nav-list {
  list-style: none;
}

.mobile-item {
  /* border-bottom: 1px solid #f0f0f0; */
}

.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #1a1a1a;
}

.mobile-link i {
  font-size: 12px;
  transition: transform 0.3s;
}

.mobile-item.active .mobile-link i {
  transform: rotate(180deg);
}

.mobile-sub {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-item.active .mobile-sub {
  max-height: 1000px;
}

.mobile-sub-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 12px 16px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
}

.mobile-sub-link:hover {
  color: #0066cc;
}

.mobile-sub-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.mobile-sub-icon img {
  width: 100%;
  height: 100%;
}

.mobile-menu-footer {
  padding: 24px;
  /* border-top: 1px solid #f0f0f0; */
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.mobile-menu-footer select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  width: 50%;
  box-sizing: border-box;
  /* Ensure padding doesn't break width */
  background-color: white;
  /* Better UX */
  cursor: pointer;
  /* Show it's interactive */
}

/* Demo Content */
.demo-content {
  margin-top: 120px;
  padding: 60px 24px;
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.demo-content h1 {
  font-size: 48px;
  color: #1a1a1a;
  margin-bottom: 20px;
}

.demo-content p {
  font-size: 18px;
  color: #666;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
  .desktop {
    display: none !important;
    height: 0;
    padding: 0;
    margin: 0;
  }

  .header-container > .header-logo,
  .header-nav,
  .header-right {
    display: none;
  }

  .mobile {
    display: block;
    width: 100%;
  }

  .demo-content h1 {
    font-size: 32px;
  }
}

.header-mobile.mobile-active {
  background: #fff;
}

.header-mobile-toggle i.icon-dark {
  color: #000;
}

/* Optimization for Small Mobile Screens (max-width: 480px) */
@media (max-width: 480px) {
  .desktop {
    display: none !important;
    height: 0;
    padding: 0;
    margin: 0;
  }

  /* 1. Thu nhỏ Header */
  .header-mobile {
    height: 90px;
  }

  .header-mobile-logo img {
    height: 32px;
    /* Logo nhỏ lại để cân đối */
  }

  /* 2. Điều chỉnh vị trí Menu Mobile khi mở */
  .mobile-menu,
  .mobile-menu-overlay {
    height: calc(100vh - 60px);
  }

  /* 3. Tối ưu danh sách Menu */
  .mobile-menu-body {
    padding: 16px;
    /* Giảm padding để có thêm không gian hiển thị */
  }

  .mobile-link {
    padding: 12px 0;
    font-size: 15px;
    /* Giảm nhẹ font size */
  }

  .mobile-sub-link {
    padding: 10px 0 10px 12px;
    font-size: 13px;
  }

  .mobile-sub-icon {
    width: 18px;
    height: 18px;
    padding: 2px;
  }

  /* 4. Tối ưu Footer của Menu (Nút bấm và chọn ngôn ngữ) */
  .mobile-menu-footer {
    padding: 16px;
    gap: 12px;
  }

  .header-btn-link {
    width: 150%;
    text-align: center;
    font-size: 13px;
    box-sizing: border-box;
    padding: 10px 24px;
    
  }

  .getDemo {
    width: 150%;
    text-align: center;
    font-size: 13px;
    box-sizing: border-box;
    padding: 10px 24px;
  
  }

  /* 5. Điều chỉnh nội dung demo bên ngoài */
  .demo-content {
    margin-top: 80px;
    padding: 40px 16px;
  }

  .demo-content h1 {
    font-size: 26px;
    /* Tiêu đề không quá to gây tràn dòng */
    line-height: 1.2;
  }

  .demo-content p {
    font-size: 15px;
  }
}

/* 6. Fix lỗi tràn chiều ngang cho màn hình cực nhỏ (320px) */
@media (max-width: 320px) {
  .desktop {
    display: none !important;
    height: 0;
    padding: 0;
    margin: 0;
  }

  .mobile-link {
    font-size: 14px;
  }

  .header-mobile-logo img {
    height: 28px;
  }}

    @media (max-width: 1024px) {
      .desktop {
        display: none;
      }

      .mobile {
        display: block;
        width: 100%;
      }
    }

    /* Optimization for Small Mobile Screens (max-width: 480px) */
    @media (max-width: 480px) {
      /* 1. Thu nhỏ Header */
      .header-mobile {
        height: 90px;
      }

      .header-mobile-logo img {
        height: 32px;
      }

      /* 2. Điều chỉnh vị trí Menu Mobile khi mở */
      .mobile-menu,
      .mobile-menu-overlay {
        height: calc(100vh - 60px);
      }

      /* 3. Tối ưu danh sách Menu */
      .mobile-menu-body {
        padding: 16px;
      }

      .mobile-link {
        padding: 12px 0;
        font-size: 15px;
      }

      .mobile-sub-link {
        padding: 10px 0 10px 12px;
        font-size: 13px;
      }

      .mobile-sub-icon {
        width: 18px;
        height: 18px;
        padding: 2px;
      }

      .mobile-menu-footer {
        padding: 16px;
        gap: 12px;
      }

      .header-btn-link {
        width: 150%;
        text-align: center;
        font-size: 13px;
        box-sizing: border-box;
        padding: 10px 24px;
      }

      .getDemo {
        width: 150%;
        text-align: center;
        font-size: 13px;
        box-sizing: border-box;
        padding: 10px 24px;
      }

      /* 5. Điều chỉnh nội dung demo bên ngoài */
      .demo-content {
        margin-top: 80px;
        padding: 40px 16px;
      }

      .demo-content h1 {
        font-size: 26px;
        line-height: 1.2;
      }

      .demo-content p {
        font-size: 15px;
      }
    }

    @media (max-width: 320px) {
      .mobile-link {
        font-size: 14px;
      }

      .header-mobile-logo img {
        height: 28px;
      }
    }

    .header-lang select {
      color: #000;
      background: transparent;
      border: none;
      outline: none;
    }

    .header-lang select option {
      color: #000;
      background: #fff;
    }

    .header-left {
      display: flex;
      align-items: center;
      gap: 40px;
    }

.header-lang select {
  color: #000;
  background: transparent;
  border: none;
  outline: none;
}

.header-lang select option {
  color: #000;
  background: #fff;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.fade-in {
  position: relative;
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
  will-change: opacity, transform;
  contain: paint;
}

.fade-in.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media screen and (max-width: 768px) {
  .mobile-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-link {
    justify-content: flex-start;
    gap: 8px;
  }

  .header-container {
    padding: 0;
  }
}

.mobile-link span {
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
}

.mobile-sub-link span {
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #000;
}

.footer-header-mobile {
  text-align: center;
  display: flex;
  gap: 12px;
  padding: 16px;
}

.footer-header-mobile .header-btn {
  flex: 1;
  display: flex;
  justify-content: center;
}

.footer-header-mobile a {
  width: 100%;
  text-align: center;
}


body.admin-bar {
  padding-top: 0px;
}

body.admin-bar .header-bg {
  top: 32px;
}

@media (max-width: 1024px) {
  body {
    padding-top: 90px;
  }

  body.admin-bar {
    padding-top: 122px;
  }

  body.admin-bar .header-bg {
    top: 32px;
  }
}

/* Mobile nhỏ (WP admin bar cao hơn) */
@media (max-width: 782px) {
  body.admin-bar {
    padding-top: 136px;
  }

  body.admin-bar .header-bg {
    top: 46px;
  }
}
@media (max-width: 768px) {
  body {
    padding-top: 0px;
  }
  body.admin-bar {
    padding-top: 0px;
  }
  body.admin-bar .header-bg {
    top: 0px;
  }
}
