/* Admin bar compatibility for sticky header */
.admin-bar .header {
  top: 32px !important;
}
@media screen and (max-width: 782px) {
  .admin-bar .header {
    top: 46px !important;
  }
}
/* Strictly control desktop vs mobile navigation */
@media screen and (max-width: 1100px) {
  .desktop-nav {
    display: none !important;
  }
  .header-cta {
    display: none !important;
  }
  .mobile-toggle {
    display: inline-flex !important;
  }
}
@media screen and (min-width: 1101px) {
  .mobile-toggle {
    display: none !important;
  }
  .mobile-nav,
  #gw-mobile-nav {
    display: none !important;
  }
}
/* Smooth mobile nav animation */
.mobile-nav {
  display: grid !important;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-block: 0 !important;
  pointer-events: none;
  transform: translateY(-10px);
  transition:
    max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease,
    transform 0.25s ease,
    padding 0.3s ease;
  background: white;
  border-top: 1px solid var(--line);
}
.mobile-nav.is-open {
  max-height: 700px;
  opacity: 1;
  padding: 24px !important;
  pointer-events: auto;
  transform: translateY(0);
}
/* Ensure scroll-to-top and chatbot button icons are always centered and visible */
.scroll-to-top-btn svg,
.chat-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  display: block;
  margin: auto;
}
/* Language Switcher Styling */
.lang-flag-icon {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.custom-lang-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.custom-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1.5px solid var(--border-ivory, #e7dec8);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text-headings);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-width: 115px;
  cursor: pointer;
  user-select: none;
}
.custom-lang-trigger:hover {
  border-color: var(--brand-forest);
  background: var(--bg-ivory);
}
.lang-current-label {
  flex: 1;
  text-align: start;
  white-space: nowrap;
}
/* Vietnamese uses the full native language name in the existing mobile picker. */
html[lang^="vi"] .lang-current-label {
  max-width: none;
}
.lang-chevron-icon {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.lang-chevron-icon.rotate {
  transform: rotate(180deg);
}
.custom-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1.5px solid var(--border-ivory, #e7dec8);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 59, 42, 0.14);
  padding: 6px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: langMenuFade 0.18s ease-out forwards;
}
@keyframes langMenuFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.custom-lang-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 26px 8px 12px;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.custom-lang-option:hover {
  background: var(--bg-ivory, #f7f5ed);
  color: var(--brand-forest);
}
.custom-lang-option.active {
  color: var(--brand-forest);
  background: var(--bg-ivory, #f7f5ed);
  font-weight: 700;
}
.lang-check-icon {
  position: absolute;
  top: 5px;
  right: 6px;
  color: var(--brand-forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lang-check-icon svg {
  width: 12px;
  height: 12px;
}
[dir="rtl"] .custom-lang-option {
  padding: 8px 12px 8px 26px;
}
[dir="rtl"] .lang-check-icon {
  right: auto;
  left: 6px;
}
/* RTL Specific typography and alignment */
[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "Noto Sans", sans-serif;
}
