/* Locale picker UI */

.tt-locale {
  position: relative;
  flex-shrink: 0;
  z-index: 70;
}

.locale-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.locale-trigger:hover,
.tt-locale.is-open .locale-trigger {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}

.locale-trigger svg {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.tt-locale.is-open .locale-trigger svg {
  transform: rotate(180deg);
}

.side-foot .locale-dropdown,
.tt-locale > .locale-dropdown {
  display: none !important;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  min-width: 11rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none !important;
  background: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.375rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 80;
}

/* Header dropdown opens downward; rail sidebar opens upward */
.top-nav-wrapper .tt-locale > .locale-dropdown,
.head-bar__tools .tt-locale > .locale-dropdown,
.tt-banner__actions .tt-locale > .locale-dropdown {
  bottom: auto;
  top: calc(100% + 0.5rem);
  left: auto;
  right: 0;
  min-width: 10.5rem;
}

.side-foot .tt-locale > .locale-dropdown {
  bottom: calc(100% + 0.5rem);
  top: auto;
  left: 0;
  right: 0;
}

.head-bar__tools .tt-locale,
.top-nav-wrapper .tt-locale--header,
.tt-banner__actions .tt-locale {
  position: relative;
}

.tt-banner__actions .locale-trigger {
  width: auto;
  min-width: 7.25rem;
  justify-content: space-between;
}

.tt-banner__actions .tt-cta--banner {
  white-space: nowrap;
}

.top-nav-wrapper .locale-trigger {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  min-width: 7.5rem;
}

.top-nav-wrapper .locale-trigger:hover,
.top-nav-wrapper .tt-locale.is-open .locale-trigger {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
}

.tt-footer__langs a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tt-footer__langs a:hover {
  color: #93c5fd;
}

.locale-rail-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tt-page .locale-rail-mobile .menu-trace {
  color: rgba(148, 163, 184, 0.95);
}

.tt-page .locale-rail-mobile .menu-trace--sel {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
}

.tt-locale.is-open > .locale-dropdown {
  display: block !important;
}

.locale-dropdown li {
  margin: 0;
  padding: 0;
  list-style: none !important;
}

.locale-dropdown a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #e2e8f0 !important;
  text-decoration: none !important;
  border-radius: 0.25rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.locale-dropdown a:hover {
  color: #fff !important;
  background: rgba(59, 130, 246, 0.2);
}

.locale-dropdown a.is-current {
  color: #7dd3fc !important;
  background: rgba(59, 130, 246, 0.12);
}

html[lang="zh-CN"] .tt-rail__link,
html.lang-zh .tt-rail__link,
html[lang="zh-CN"] .menu-trace,
html.lang-zh .menu-trace {
  letter-spacing: 0.08em;
}

html[lang="ru"] .tt-btn--primary,
html.lang-ru .tt-btn--primary,
html[lang="ru"] .tt-btn--primary,
html.lang-ru .tt-btn--primary,
html[lang="ru"] .tt-cta {
  padding: 0.95rem 1.75rem;
}

html[lang="ru"] .top-nav-wrapper .tt-btn--primary {
  padding: 0.65rem 1.35rem;
}

html[lang="ru"] .tt-cta {
  padding: 0.6rem 1.15rem;
}

html[dir="rtl"] .locale-dropdown {
  left: 0;
  right: 0;
}

html[dir="rtl"] .tt-skip {
  left: auto;
  right: 1rem;
}
