/* Biến CSS cho khoảng cách header */
:root {
  --header-offset: 122px;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #1F2D3D;
  background-color: #F4F7FB;
  padding-top: var(--header-offset);
  overflow-x: hidden;
}

/* Cài đặt chung cho container */
.header-container, .nav-container, .footer-top-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Site Header - Thanh điều hướng cố định */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background-color: #F4F7FB; /* Nền nhẹ cho toàn bộ header, tránh bị che khuất */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Header Top - Khu vực logo và nút */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #2F6BFF; /* Màu chính */
  width: 100%;
}

.header-top .header-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 30px;
  padding-right: 30px;
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
}

/* Nút điều hướng desktop */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Nút điều hướng mobile (mặc định ẩn trên desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Ẩn trên desktop */
  min-height: 48px;
  background-color: #F4F7FB; /* Nền cho khu vực nút mobile */
  padding: 10px 20px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Main Nav - Thanh menu chính */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #6FA3FF; /* Màu phụ */
  width: 100%;
}

.main-nav .nav-container {
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  gap: 25px;
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #D6E2FF;
}

/* Nút chung */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Hamburger Menu */
.hamburger-menu {
  display: none; /* Ẩn trên desktop */
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  padding: 0;
  /* margin-right: 15px; Để hamburger ở trái, logo căn giữa */
}

.hamburger-icon {
  display: block;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  transition: all 0.3s ease;
}

.hamburger-icon::before, .hamburger-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  transition: all 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

.hamburger-menu.active .hamburger-icon {
  background-color: transparent;
}

.hamburger-menu.active .hamburger-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.hamburger-menu.active .hamburger-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Footer */
.site-footer {
  background-color: #2F6BFF;
  color: #FFFFFF;
  padding: 40px 0 20px;
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-col h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #FFFFFF;
}

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  line-height: 1.8;
  color: #D6E2FF;
  word-wrap: break-word; /* Đảm bảo văn bản không tràn */
  overflow-wrap: break-word;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li a {
  color: #D6E2FF;
  text-decoration: none;
  margin-bottom: 10px;
  display: block;
  transition: color 0.3s ease;
}

.footer-nav li a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  color: #D6E2FF;
}

/* Dynamic Slot Anchor Styles */
.footer-slot-anchor-inner {
  min-height: 1px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px;
  }

  /* Body overflow for mobile content protection */
  body {
    overflow-x: hidden;
  }

  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-top .header-container {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: none;
    position: relative; /* Cho logo absolute positioning nếu cần */
  }

  .hamburger-menu {
    display: block; /* Hiển thị trên mobile */
    margin-right: 0; /* Loại bỏ margin để logo tự căn giữa */
  }
  .header-top .desktop-nav-buttons {
    display: none !important; /* Ẩn nút desktop */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 80px); /* Đảm bảo không chồng chéo hamburger */
    font-size: 22px;
  }
  /* Nếu logo là ảnh, cần thêm: */
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 56px;
  }

  .mobile-nav-buttons {
    display: flex !important; /* Hiển thị trên mobile */
    min-height: 48px;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    flex-wrap: nowrap;
    background-color: #F4F7FB;
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px);
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  .main-nav {
    display: none; /* Mặc định ẩn trên mobile */
    position: fixed;
    top: var(--header-offset); /* Bắt đầu từ dưới header */
    left: 0;
    width: 280px; /* Chiều rộng menu mobile */
    height: calc(100% - var(--header-offset));
    background-color: #2F6BFF;
    flex-direction: column;
    padding: 20px 0;
    transform: translateX(-100%); /* Ẩn menu ra ngoài */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 1001;
  }

  .main-nav.active {
    display: flex; /* Hiển thị khi active */
    transform: translateX(0); /* Di chuyển vào trong */
  }

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    gap: 15px;
    height: auto; /* Cho phép nội dung xác định chiều cao */
    max-height: 100%;
    overflow-y: auto;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .footer-col h3 {
    margin-top: 20px;
  }
  .footer-col:first-child h3 {
    margin-top: 0;
  }
}

/* No-scroll class for body */
body.no-scroll {
  overflow: hidden;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
