#tera-store-lang {
  position: relative;
  z-index: 121;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: #332f34;
  font: 600 14px/1.25 Arial, sans-serif;
  box-sizing: border-box;
}
#tera-store-lang details { position: relative; }
#tera-store-lang summary, #tera-store-lang :is(button,a[data-tera-language]) {
  box-sizing: border-box; font: inherit; color: inherit; cursor: pointer;
  text-transform: none; letter-spacing: normal;
}
#tera-store-lang summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 9px; border-radius: 7px; list-style: none;
}
#tera-store-lang summary::-webkit-details-marker { display: none; }
#tera-store-lang summary:hover, #tera-store-lang details[open] > summary { background: #eef8f2; color: #185c42; }
#tera-store-lang svg { flex: none; }
#tera-store-lang .br-lang-caret {
  width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); margin: -3px 2px 0;
}
#tera-store-lang details[open] .br-lang-caret { transform: rotate(225deg); margin-top: 3px; }
#tera-store-lang :is(form,nav) {
  position: absolute; inset-block-start: 100%; inset-inline-end: 0; z-index: 2;
  width: max-content; min-width: 148px; max-width: calc(100vw - 16px);
  margin: 0; padding: 4px; border: 1px solid #e6dfe2; border-radius: 9px;
  background: #fff; box-shadow: 0 5px 18px #48293e25;
}
#tera-store-lang :is(button,a[data-tera-language]) {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 5px;
  text-align: start; background: transparent;
}
#tera-store-lang :is(button,a[data-tera-language]):hover, #tera-store-lang :is(button,a[data-tera-language])[aria-current=true] { background: #eef8f2; color: #185c42; }
#tera-store-lang :focus-visible { outline: 2px solid #185c42; outline-offset: 1px; }
.site-wrapper > #tera-store-lang { display: flex; justify-content: flex-end; padding-inline: 12px; }

/* The search row has its own stacking layer; keep all four language options clickable. */
.mobile-header-active header.tera-language-open .mobile-bar.sticky-bar,
.mobile-header-active .mobile-bar.sticky-bar:has(#tera-store-lang details[open]) { z-index: 25 !important; }
.desktop-header-active header.tera-language-open .mid-bar,
.desktop-header-active .mid-bar:has(#tera-store-lang details[open]) { z-index: 25; }

/* Journal moves its cart between these two headers at its device breakpoint. */
.desktop-header-active .classic-cart-wrapper > #tera-store-lang { margin-inline: 5px; }
.mobile-header-active .mobile-bar.sticky-bar > #tera-store-lang { align-self: center; }
.mobile-header-active #tera-store-lang summary { width: 44px; min-height: 44px; padding: 0; }
.mobile-header-active #tera-store-lang summary bdi, .mobile-header-active #tera-store-lang .br-lang-caret { display: none; }
.mobile-header-active #tera-store-lang svg { width: 21px; height: 21px; }
.mobile-header-active .mobile-bar.sticky-bar .mobile-logo-wrapper { min-width: 0; }
.mobile-header-active .mobile-logo-wrapper #logo, .mobile-header-active .mobile-logo-wrapper #logo a, .mobile-header-active .mobile-logo-wrapper #logo img { max-width: 100%; }
@media (max-width: 460px) {
  .mobile-header-active .mobile-bar.sticky-bar > :is(.menu-trigger,.mobile-custom-menu,.mobile-cart-wrapper) { width: 44px !important; min-width: 44px; max-width: 44px; flex: 0 0 44px; }
}

/* Fit the actual header container, including during sticky navigation. Submenus can still extend below it. */
html.desktop-header-active .header-classic .desktop-main-menu-wrapper { min-width: 0; height: auto; min-height: 43px; }
html.desktop-header-active .header-classic .desktop-main-menu-wrapper::before { height: 100%; }
html.desktop-header-active .desktop-main-menu-wrapper #main-menu,
html.desktop-header-active .desktop-main-menu-wrapper #main-menu > .j-menu { width: 100%; max-width: 100%; min-width: 0; height: auto; }
html.desktop-header-active .desktop-main-menu-wrapper #main-menu > .j-menu { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; }
html.desktop-header-active .desktop-main-menu-wrapper #main-menu > .j-menu > .main-menu-item { flex: 0 1 auto; min-width: 0; max-width: 100%; height: auto; }
html.desktop-header-active .desktop-main-menu-wrapper #main-menu > .j-menu > .main-menu-item > a {
  min-height: 43px; height: auto; padding-inline: clamp(5px,0.45vw,8px); align-items: center;
  white-space: normal; line-height: 1.22;
}
html.desktop-header-active .desktop-main-menu-wrapper #main-menu > .j-menu > .main-menu-item > a > .links-text {
  width: auto; white-space: normal; overflow-wrap: anywhere; text-align: center;
}
html:is([lang=ru],[lang=en]) .desktop-main-menu-wrapper #main-menu > .j-menu > .main-menu-item > a > .links-text {
  font-family: Assistant,Arial,sans-serif; font-size: clamp(14px,0.8vw,15px); text-transform: none;
}
.mobile-header-active .mobile-bar.sticky-bar .menu-trigger > button {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: 0; background: transparent;
}
.mobile-header-active .mobile-bar.sticky-bar .menu-trigger > button:focus-visible { outline: 2px solid #185c42; outline-offset: -3px; }
.mobile-header-active .mobile-main-menu-container .mobile-main-menu-wrapper .menu-item > a {
  min-width: 0; min-height: 44px; height: auto; max-height: none; padding-block: 8px; white-space: normal;
}
.mobile-header-active .mobile-main-menu-container .mobile-main-menu-wrapper .menu-item > a > .links-text {
  flex: 1 1 auto; min-width: 0; white-space: normal !important; overflow: visible; text-overflow: clip;
  line-height: 1.4; text-transform: none; overflow-wrap: anywhere;
}
.mobile-header-active .mobile-main-menu-container .mobile-main-menu-wrapper .menu-item > a:has(> .open-menu) > .links-text { padding-inline-end: 28px; }

.mobile-header-active .mobile-main-menu-wrapper .open-menu { flex-shrink: 0; }

/* Translate the direction of TERA's custom homepage copy with the selected locale. */
html[dir=ltr] .tmh-copy { direction:ltr!important; text-align:left!important; }
html[dir=ltr] .tmh-copy h2, html[dir=ltr] .tmh-copy p { text-align:left!important; }
html[dir=ltr] .tn-categories,html[dir=ltr] .tn-end,html[dir=ltr] .tn-intro { direction:ltr; }
html[lang=ru] :is(header,.top-bar,.title,.tn-categories,.tn-end) { font-family:Arial,sans-serif; }
html:is([lang=ru],[lang=en]) .tmh-copy { min-width:0; overflow-wrap:anywhere; }
html:is([lang=ru],[lang=en]) .tmh-copy h2 { font-size:clamp(28px,4.5vw,68px); line-height:1.12; }
@media(max-width:760px){html:is([lang=ru],[lang=en]) .tmh-copy h2{font-size:clamp(27px,7vw,42px)!important}}

#tera-store-lang a[data-tera-language] { text-decoration:none; }

/* TERA mobile header: readable language control and breathing room, 2026-11-17. */
.mobile-header-active .mobile-bar.sticky-bar {
  display:flex!important; align-items:center; gap:6px; padding-inline:8px!important;
  box-sizing:border-box; width:100%;
}
.mobile-header-active .mobile-bar.sticky-bar > :is(.menu-trigger,.mobile-custom-menu,.mobile-cart-wrapper,#tera-store-lang) {
  flex:0 0 44px!important; width:44px!important; min-width:44px!important; max-width:44px!important;
  margin-inline:0!important;
}
.mobile-header-active .mobile-bar.sticky-bar .mobile-logo-wrapper {
  flex:1 1 auto!important; width:auto!important; min-width:0!important; margin:0!important; padding-inline:0!important;
  display:flex; justify-content:center; align-items:center;
}
.mobile-header-active .mobile-logo-wrapper #logo {width:100%!important;max-width:170px!important;padding:0!important;margin:0!important;}
.mobile-header-active .mobile-logo-wrapper #logo a {display:block; padding:0!important;}
.mobile-header-active .mobile-logo-wrapper #logo img {display:block;width:100%!important;height:auto!important;max-width:170px!important;}
.mobile-header-active #tera-store-lang summary {
  display:flex;flex-direction:column;gap:2px;min-height:44px;line-height:1;
}
.mobile-header-active #tera-store-lang summary::after {content:'שפה';font:600 10px/1.1 Arial,sans-serif;white-space:nowrap;}
html[lang^=en].mobile-header-active #tera-store-lang summary::after {content:'Language';font-size:9px;}
html[lang^=ru].mobile-header-active #tera-store-lang summary::after {content:'Язык';}
html[lang^=ar].mobile-header-active #tera-store-lang summary::after {content:'اللغة';}
.mobile-header-active #tera-store-lang svg {width:20px;height:20px;}

.mobile-header-active .mobile-logo-wrapper #logo a {display:flex!important;align-items:center;justify-content:center;height:100%;}

.mobile-header-active .mobile-logo-wrapper #logo a {display:flex!important;align-items:center;justify-content:center;height:100%;}
