@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");
/* Add imports for Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700&family=Montserrat:wght@400;500;600;700&family=Open+Sans:wght@400;500;600;700&family=Oswald:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Source+Sans+Pro:wght@400;600;700&display=swap");
/* === Reset cơ bản & Biến màu === */
:root {
  --primary-color: #cc0000; /* Màu đỏ nhấn */
  --text-dark: #333; /* Màu chữ chính */
  --text-light: #555; /* Màu chữ phụ */
  --text-grey: #777; /* Màu chữ xám */
  --text-muted: #aaa; /* Màu chữ rất nhạt */
  --border-color: #eee; /* Màu viền */
  --bg-light: #f8f9fa; /* Màu nền sáng (cho mega menu) */
  --mega-menu-link-color: #555; /* Màu link trong mega menu */

  /* Font variables */
  --font-primary: "Roboto", "Open Sans", sans-serif;
  --font-heading: "Montserrat", "Oswald", sans-serif;
  --font-body: "Lato", "Source Sans Pro", sans-serif;
}

/* *,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
} */

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: #fff;
}

/* img {
  max-width: 100%;
  height: auto;
  display: block;
} */

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  padding: 0;
  color: inherit; /* Kế thừa màu chữ */
}

/* === Header & Nav Cơ bản === */
.site-header {
  position: sticky; /* Thay đổi thành sticky */
  background-color: #fff;
  top: 0; /* Dính vào đỉnh của viewport */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease; /* Thêm transition chung */
}

/* Container chính bao quanh logo, nav, actions */
.nav-menu {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex; /* Sử dụng Flexbox để căn chỉnh */
  justify-content: space-between; /* Đẩy logo và actions ra 2 bên */
  align-items: center; /* Căn giữa theo chiều dọc */
  min-height: 70px; /* Đặt chiều cao tối thiểu cho header */
  transition: min-height 0.3s ease; /* Transition cho chiều cao */
}

/* Logo container */
.logo-container {
  flex-shrink: 0; /* Ngăn logo bị co lại */
}

#logoVietNam {
  height: 55px; /* Kích thước logo */
  transition: height 0.3s ease; /* Transition cho chiều cao logo */
  display: block; /* Đảm bảo là block */
}

/* Menu điều hướng chính */
/* Không cần style đặc biệt trên desktop */
/* .main-navigation {
} */

.nav-list {
  display: flex; /* Menu ngang trên desktop */
  align-items: center;
}

.nav-item {
  position: relative;
}

/* Style chung cho các link menu */
.nav-item > a {
  font-family: var(--font-primary);
  display: flex;
  align-items: center;
  padding: 1.5rem 1.2rem; /* Padding (điều chỉnh nếu cần) */
  color: var(--text-dark); /* Sử dụng biến màu đã định nghĩa */
  font-weight: 500;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-item > a:hover,
.nav-item:hover > a {
  color: var(--primary-color); /* Sử dụng biến màu đã định nghĩa */
}

/* === Kiểu cho Header khi đã cuộn (lớp .scrolled được thêm bởi JS) === */
.site-header.scrolled {
  background-color: rgba(
    255,
    255,
    255,
    0.98
  ); /* Nền hơi trong hoặc màu trắng đục hơn */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Bóng đổ rõ hơn */
}

.site-header.scrolled .nav-menu {
  min-height: 60px; /* Giảm chiều cao header một chút */
}

.site-header.scrolled #logoVietNam {
  height: 45px; /* Logo nhỏ lại */
}

.site-header.scrolled .nav-item > a {
  padding-top: 1.1rem; /* Giảm padding của mục menu */
  padding-bottom: 1.1rem;
  color: var(--primary-color);
}

/* Container cho các nút bên phải */
.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0; /* Ngăn co lại */
}

/* === Search Customization (Ví dụ 1) === */
.search-container {
  position: relative;
}

.search-toggle-item {
  padding: 8px;
  background: none;
  border: none;
}

.search-toggle-item img {
  width: 24px;
  height: 24px;
  display: block;
}

.search-icon {
  /* Hoặc bạn có thể dùng #search-toggle-btn img */
  width: 20px; /* Đặt chiều rộng mong muốn */
  height: 20px; /* Đặt chiều cao mong muốn */
  display: block; /* Đảm bảo nó là block để width/height hoạt động đúng */
  /* Có thể thêm object-fit nếu ảnh bị méo: */
  /* object-fit: contain; */
}

.search-form {
  position: absolute;
  top: calc(100% + 10px); /* Thêm khoảng cách với button */
  right: 0;
  width: 300px;
  background: white;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 8px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.search-form.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-form input[type="search"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
}

.search-form input[type="search"]::placeholder {
  color: var(--text-grey);
  opacity: 0.8;
}

.search-form button[type="submit"] {
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-form button[type="submit"]:hover {
  background: #a00000;
}

.search-form button[type="submit"]:active {
  transform: scale(0.95);
}

/* === Mega Menu Styling === */
.nav-item.has-mega-menu {
  position: static;
}
.mega-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 2.5rem 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.nav-item.has-mega-menu:hover > .mega-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.mega-menu-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
/* .mega-menu-column {
} */
.mega-menu-image-header {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mega-menu-image-header a {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}
.mega-menu-image-header img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}
.mega-menu-image-header a:hover img {
  transform: scale(1.07);
}
.mega-menu-image-header h4 {
  margin: 0.8rem 0 0;
  font-size: 1.1em;
  color: var(--text-dark);
  font-family: var(--font-heading);
}
.mega-menu-subheading.region-title {
  padding-bottom: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.9em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  font-family: var(--font-heading);
}
.mega-menu-links.region-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
/* .mega-menu-links li {
} */
.mega-menu-links a {
  font-family: var(--font-body);
  color: var(--mega-menu-link-color);
  font-size: 0.95em;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: block;
  padding: 2px 0;
}
.mega-menu-links a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

/* === Hamburger Menu Button === */
.hamburger-button {
  display: none; /* Ẩn trên desktop */
  padding: 1rem;
  margin-left: 0.5rem;
  z-index: 1001; /* Đảm bảo nút hamburger nổi trên menu mobile */
}

.hamburger-box {
  width: 30px;
  height: 24px;
  display: inline-block;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 100%;
  height: 3px;
  background-color: var(--text-dark);
  border-radius: 4px;
  position: absolute;
  transition: transform 0.25s ease-in-out, opacity 0.25s ease,
    background-color 0.25s ease;
  left: 0; /* Đảm bảo căn trái */
}
.hamburger-inner {
  display: block;
  top: 50%;
  margin-top: -1.5px; /* Căn giữa thanh giữa */
}
.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  display: block;
}
.hamburger-inner::before {
  top: -10px;
}
.hamburger-inner::after {
  bottom: -10px;
}

/* Trạng thái active của Hamburger */
.hamburger-button.is-active .hamburger-inner {
  transform: rotate(45deg);
}
.hamburger-button.is-active .hamburger-inner::before {
  top: 0;
  opacity: 0;
}
.hamburger-button.is-active .hamburger-inner::after {
  bottom: 0;
  transform: rotate(-90deg);
}

/* ============================================ */
/* === Responsive Styles === */
/* ============================================ */

/* --- Tablets và nhỏ hơn (ví dụ: dưới 992px) --- */
@media (max-width: 991px) {
  .nav-menu {
    /* Giữ space-between nhưng có thể giảm padding */
    padding: 0 10px;
  }

  /* Ẩn menu chính và hiện hamburger */
  .main-navigation {
    order: 3; /* Đảm bảo nó nằm dưới cùng trong DOM ảo của flex container header */
    position: absolute;
    top: 100%; /* Ngay dưới header */
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    /* Hiệu ứng xổ xuống */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s cubic-bezier(0.23, 1, 0.32, 1),
      opacity 0.3s ease-out, visibility 0s linear 0.4s;
    pointer-events: none;
  }

  .main-navigation.is-open {
    max-height: calc(
      100vh - 70px
    ); /* Chiều cao tối đa là chiều cao màn hình trừ header */
    opacity: 1;
    visibility: visible;
    overflow-y: auto; /* Cho phép cuộn nếu menu quá dài */
    transition: max-height 0.5s cubic-bezier(0.23, 1, 0.32, 1),
      opacity 0.3s ease-in, visibility 0s linear 0s;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column; /* Menu dọc */
    align-items: stretch; /* Mục menu chiếm hết chiều rộng */
    padding: 0.5rem 0;
  }

  .nav-item {
    width: 100%;
    position: static; /* Quan trọng để mega menu không hiển thị sai */
  }

  .nav-item > a {
    padding: 1rem 1.5rem; /* Padding cho menu mobile */
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-start; /* Căn chữ về bên trái */
  }
  .nav-item:last-child > a {
    border-bottom: none;
  }

  /* Luôn ẩn Mega Menu trên mobile/tablet */
  .mega-menu-panel {
    display: none !important;
  }

  /* Hiện nút Hamburger */
  .hamburger-button {
    display: inline-block; /* Hiện nút */
  }

  /* Nút tìm kiếm giữ nguyên hoặc điều chỉnh nếu cần */
  .search-toggle-item button {
    padding: 1rem; /* Đồng bộ padding với hamburger */
  }
  .search-form {
    /* Điều chỉnh nếu cần, ví dụ gần hamburger hơn */
    right: 10px;
    /* Hoặc ẩn hẳn nếu không muốn hiện trên mobile nhỏ */
    /* display: none; */
  }
}

/* --- Mobile nhỏ hơn (ví dụ: dưới 768px) --- */
@media (max-width: 767px) {
  .nav-menu {
    min-height: 60px; /* Giảm chiều cao header */
  }
  #logoVietNam {
    height: 40px;
  }
  .nav-item > a {
    padding: 0.8rem 1rem; /* Giảm padding menu mobile */
  }
  .search-form {
    width: calc(100% - 20px); /* Ví dụ: gần full width */
    right: 10px;
  }
  .hamburger-button {
    padding: 0.8rem; /* Giảm padding nút hamburger */
  }
  .search-toggle-item button {
    padding: 0.8rem; /* Đồng bộ padding nút search */
  }
}
