:root {
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
  --primary-color: #113B7A;
  --accent-color: #1D5FD1;
  --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  --card-bg: #10233F;
  --text-main: #F3F8FF;
  --text-secondary: #AFC4E8;
  --border-color: #244D84;
  --glow-color: #4FA8FF;
  --gold-color: #F2C14E;
  --divider-color: #1B3357;
  --deep-navy: #08162B;
}

body {
  padding-top: var(--header-offset);
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-main);
  background-color: var(--card-bg);
  overflow-x: hidden;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-navy);
  width: 100%;
  padding: 0 20px;
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
}

.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001;
  margin-left: auto; /* Push to the right if no desktop buttons */
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  margin: 5px 0;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: show */
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color);
  width: 100%;
  padding: 0 20px;
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop default: horizontal */
  justify-content: center;
  align-items: center;
  gap: 25px;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-size: 16px;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--gold-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  color: var(--text-main);
  background: var(--button-gradient);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
  background: var(--accent-color);
}
.btn-secondary:hover {
  background: var(--primary-color);
}

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

/* Footer styles */
.site-footer {
  background-color: var(--card-bg);
  color: var(--text-secondary);
  padding: 40px 20px 20px;
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 30px;
  border-bottom: 1px solid var(--divider-color);
  padding-bottom: 30px;
}

.footer-col h3 {
  color: var(--text-main);
  font-size: 18px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.footer-col .footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold-color);
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.footer-col .footer-description {
  line-height: 1.6;
  margin-bottom: 15px;
}

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

.footer-nav li {
  margin-bottom: 8px;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--gold-color);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--divider-color);
  color: var(--text-secondary);
}

.footer-bottom p {
  margin: 0;
}

.footer-slot-anchor-inner {
  min-height: 1px;
}
.footer-dynamic-col .footer-slot-anchor-inner {
  min-height: 10px;
}

/* Mobile styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* 60px (header-top) + 48px (main-nav) + 2px buffer */
  }

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

  .header-container {
    max-width: none;
    padding: 0;
    position: relative;
    justify-content: flex-start; /* Important: ensure hamburger is left-aligned */
    height: 100%;
  }

  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    font-size: 24px;
    height: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo img {
    max-height: 56px !important;
  }

  .desktop-nav-buttons {
    display: none !important;
  }

  .hamburger-menu {
    display: block;
    position: relative;
    z-index: 1002;
    margin-left: 0; /* Ensure it's on the left */
  }

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--accent-color);
  }

  .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 {
    min-height: 48px !important;
    height: calc(100vh - var(--header-offset));
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 80%;
    max-width: 300px;
    background-color: var(--deep-navy);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto;
    display: none; /* Hidden by default */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 1001; /* Ensure it's above overlay */
  }

  .main-nav.active {
    transform: translateX(0);
    display: flex; /* Ensure it's displayed when active */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    max-width: none;
    padding: 0 20px;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider-color);
    white-space: normal;
  }
  .nav-link:last-child {
      border-bottom: none;
  }

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

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

body.no-scroll {
  overflow: hidden;
}

.site-header[lang="vi-VN"],
.site-footer[lang="vi-VN"] {
  /* Ensures language attribute is set if the whole page supports it */
  /* This is a placeholder as lang attribute is usually on <html> */
}

@media (max-width: 768px) {
  .header-container .logo {
    /* Mobile logo centering with absolute positioning */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 100px); /* Adjust based on hamburger menu width */
    height: 100%;
  }
  .header-container .hamburger-menu {
    /* Ensure hamburger is on the left and visible */
    position: relative;
    z-index: 1002; /* Above logo */
  }
  .header-container {
    justify-content: flex-start; /* Ensure hamburger stays left */
  }
}

@media (min-width: 769px) {
  .hamburger-menu {
    display: none;
  }
  .mobile-overlay {
    display: none;
  }
  .site-header .header-container .logo {
    position: static;
    transform: none;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .header-top .header-container {
    justify-content: flex-start;
  }
  .desktop-nav-buttons {
    display: none !important;
  }
  .hamburger-menu {
    display: block;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
