/* ===== Header ===== */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
}

/* ---------- Top bar ---------- */
.topbar {
  background: #020617;
  color: #ffffff;
  overflow: visible; /* QUAN TRỌNG: không cắt language dropdown */
  height: 2.5rem;
  transition: height 0.3s ease, opacity 0.3s ease;
  position: relative;
  z-index: 110;
}

@media (min-width: 640px) {
  .topbar {
    height: 2.75rem;
  }
}

.topbar.is-hidden {
  height: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.topbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 0.75rem;
  font-size: 11px;
}

@media (min-width: 640px) {
  .topbar-inner {
    padding: 0 1.5rem;
    font-size: 0.75rem;
  }
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .contact-info {
    gap: 1.5rem;
  }
}

.topbar .contact-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.topbar .contact-item:hover {
  color: #fdba74;
}

.topbar .contact-item svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--brand-orange-2, #f37021);
}

@media (min-width: 640px) {
  .topbar .contact-item svg {
    width: 13px;
    height: 13px;
  }
}

.topbar .contact-label:first-of-type {
  display: none;
}

@media (min-width: 640px) {
  .topbar .contact-label:first-of-type {
    display: inline;
  }
}

.contact-info .contact-item:nth-child(2) {
  display: none;
}

@media (min-width: 768px) {
  .contact-info .contact-item:nth-child(2) {
    display: flex;
  }
}

/* ---------- Language dropdown ---------- */
.language-dropdown {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
}

@media (min-width: 640px) {
  .language-dropdown {
    right: 1.5rem;
  }
}

.language-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.language-trigger:hover,
.language-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.language-flag {
  width: 1.5rem;
  height: 1rem;
  border-radius: 2px;
  object-fit: cover;
}

.language-trigger svg {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.language-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 10.5rem;
  padding: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: var(--shadow-brand-soft, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
  z-index: 130;
}

.language-menu.is-open {
  display: block;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  font-size: 0.875rem;
  color: #334155;
  cursor: pointer;
  text-align: left;
}

.language-option:hover {
  background: #fff7ed;
}

.language-option.active .language-check {
  opacity: 1;
  color: var(--brand-orange-2, #f37021);
}

.language-check {
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  opacity: 0;
  flex-shrink: 0;
}

/* ---------- Navbar ---------- */
.navbar {
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.35s ease, opacity 0.35s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 100;
}

.navbar.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.navbar.is-sticky {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 80rem;
  margin: 0 auto;
  height: 3.25rem;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .navbar-inner {
    height: 4rem;
    padding: 0 1.5rem;
  }
}

@media (min-width: 768px) {
  .navbar-inner {
    height: 68px;
  }
}

.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #0f172a;
}

.site-logo-img {
  display: block;
  height: 36px;          /* mobile */
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

@media (min-width: 640px) {
  .site-logo-img {
    height: 42px;
    max-width: 160px;
  }
}

@media (min-width: 1024px) {
  .site-logo-img {
    height: 48px;        /* desktop */
    max-width: 180px;
  }
}

.site-logo svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--brand-orange-2, #f37021);
}

.navbar-inner > div:first-child {
  display: none;
}

@media (min-width: 1024px) {
  .navbar-inner > div:first-child {
    display: block;
  }
}

/* Bỏ rule ẩn logo trên mobile (nếu còn) */
.navbar-inner > div:first-child {
  display: flex;         /* luôn hiện */
}

/* ---------- Mobile menu button ---------- */
/* Mặc định: bên trái trên mobile (layout hiện tại) */
.mobile-menu-button {
  position: relative;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu-button:hover {
  background: #fff7ed;
  color: var(--brand-orange-2, #f37021);
}

/* Khi mở menu: nút X cố định góc PHẢI màn hình (không dính sheet) */
.mobile-menu-button.is-open {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  left: auto;
  z-index: 160;
  background: #ffffff;
  color: #0f172a;
  box-shadow: var(--shadow-brand-soft, 0 4px 12px rgba(0, 0, 0, 0.12));
}

@media (min-width: 640px) {
  .mobile-menu-button.is-open {
    top: 1rem;
    right: 1rem;
  }
}

@media (min-width: 1024px) {
  .mobile-menu-button {
    display: none !important;
  }
}

.menu-icon,
.close-icon {
  position: absolute;
  display: flex;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-icon svg,
.close-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.menu-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.close-icon {
  opacity: 0;
  transform: scale(0.7) rotate(90deg);
  pointer-events: none;
}

.mobile-menu-button.is-open .menu-icon {
  opacity: 0;
  transform: scale(0.7) rotate(-90deg);
  pointer-events: none;
}

.mobile-menu-button.is-open .close-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  pointer-events: auto;
}

/* ---------- Mobile sheet (TRÁI) – fixed viewport ---------- */
.mobile-menu {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  width: min(82vw, 24rem);
  max-width: 24rem;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid #e2e8f0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(-105%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Tách khỏi stacking context của navbar */
  will-change: transform;
}

.mobile-menu.is-open {
  transform: translateX(0);
}

.mobile-menu-header {
  padding: 1.25rem 1.5rem;
  padding-right: 3.5rem; /* chừa chỗ nếu cần */
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  flex-shrink: 0;
}

.mobile-menu-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.mobile-navigation {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1rem;
}

.mobile-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-link:hover {
  background: #fff7ed;
  color: var(--brand-orange-2, #f37021);
}

.mobile-nav-link.active {
  background: #fff7ed;
  color: var(--brand-orange-2, #f37021);
}

.mobile-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 0.25rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--brand-orange-2, #f37021);
}

.mobile-menu-email {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 1.25rem 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #fff7ed;
  font-size: 0.875rem;
  color: #334155;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.mobile-menu-email:hover {
  background: #ffedd5;
  color: var(--brand-orange-3, #d95f17);
}

.mobile-menu-email svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: var(--brand-orange-2, #f37021);
}

.mobile-menu-email p {
  margin: 0;
  display: flex;
}

/* Backdrop full màn hình */
.mobile-menu-backdrop {
  position: fixed !important;
  inset: 0;
  z-index: 140;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.mobile-menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---------- Desktop nav ---------- */
.desktop-nav {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
  }
}

.desktop-nav a {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: color 0.2s ease;
  /* Gạch chân ngay dưới text, không dưới cả header */
  line-height: 1.25;
}

@media (min-width: 1280px) {
  .desktop-nav a {
    padding: 0.5rem 1rem;
  }
}

.desktop-nav a:hover {
  color: var(--brand-orange-2, #f37021);
}

.desktop-nav a.active {
  color: var(--brand-orange-2, #f37021);
}

/* Gạch chân sát dưới chữ */
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.15rem; /* sát text, không đáy header */
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  border-radius: 1px;
  background: var(--brand-orange-2, #f37021);
  transition: width 0.25s ease;
}

.desktop-nav a.active::after,
.desktop-nav a:hover::after {
  width: 70%;
}

/* Topbar: luôn chữ trắng (không bị contact.css ghi đè) */
.topbar,
.topbar .contact-item,
.topbar .contact-item span,
.topbar .contact-label,
.topbar .contact-info,
.topbar-inner {
  color: #ffffff !important;
}

.topbar .contact-item svg {
  color: #f37021 !important; /* icon cam, tùy bạn */
  stroke: currentColor;
}

.topbar .contact-item:hover,
.topbar .contact-item:hover span,
.topbar .contact-item:hover .contact-label {
  color: #fdba74 !important; /* hover cam nhạt */
}

/* ---------- Logo ---------- */
.logo-wrap {
  display: flex;
  align-items: center;
}

/* Mobile: logo chính giữa navbar */
@media (max-width: 1023px) {
  .logo-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
  }
  .mobile-menu-button {
    margin-left: auto;   /* đẩy nút menu sang phải */
    z-index: 10;
  }
}

/* Desktop: logo bên trái */
@media (min-width: 1024px) {
  .logo-wrap {
    position: static;
    transform: none;
  }
}