/* Keep the approved header geometry; replace only its JS-only language select. */
html body .site-header .main-nav details.language-switcher.locale-language-switcher {
  position: relative;
  display: block !important;
  padding: 0 !important;
  overflow: visible;
  direction: ltr;
}

html body .site-header details.locale-language-switcher::after {
  content: none !important;
}

.locale-language-toggle {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: inherit;
  color: inherit;
  cursor: pointer;
  list-style: none;
  transition: background-color 180ms ease-out, box-shadow 180ms ease-out;
}

.locale-language-toggle::-webkit-details-marker { display: none; }
.locale-language-toggle::marker { content: ""; }
.locale-language-toggle:hover { background-color: rgb(20 92 242 / 10%); }
.locale-language-toggle:focus-visible {
  outline: 2px solid #145cf2;
  outline-offset: 3px;
}

.locale-language-current {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font: 600 11px/1.2 Manrope, Arial, sans-serif;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.locale-language-chevron {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  color: inherit;
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1);
}

.locale-language-switcher[open] .locale-language-chevron { transform: rotate(180deg); }

html body .site-header .locale-language-options {
  position: absolute;
  z-index: 80;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  box-sizing: border-box;
  width: max-content;
  min-width: 210px;
  max-width: min(290px, calc(100vw - 32px));
  max-height: min(360px, 65svh);
  margin: 0;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid #dbe4f1;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(3 21 52 / 16%);
  color: #0b2148;
  list-style: none;
  scrollbar-color: #657590 #f2f6ff;
  scrollbar-width: thin;
  transform-origin: top right;
}

.locale-language-options li { margin: 0; padding: 0; list-style: none; }
html body .site-header .locale-language-options a {
  display: flex !important;
  min-height: 44px;
  align-items: center;
  padding: 8px 11px;
  border-radius: 2px;
  background: transparent;
  color: #0b2148 !important;
  font: 600 14px/1.4 Manrope, Arial, sans-serif;
  text-align: start;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background-color 180ms ease-out, color 180ms ease-out;
}

html body .site-header .locale-language-options a:hover,
html body .site-header .locale-language-options a:focus-visible {
  background: #edf3ff;
  color: #124fc6 !important;
}

html body .site-header .locale-language-options a:focus-visible {
  outline: 2px solid #145cf2;
  outline-offset: -2px;
}

html body .site-header .locale-language-options a[aria-current] {
  background: #e3edff;
  color: #124fc6 !important;
}

/* Animate both disclosure directions where supported; native fallback remains usable. */
@supports (interpolate-size: allow-keywords) {
  .locale-language-switcher { interpolate-size: allow-keywords; }
  .locale-language-switcher::details-content {
    content-visibility: hidden;
    opacity: 0;
    transition: opacity 180ms ease-out, content-visibility 180ms allow-discrete;
  }
  .locale-language-switcher[open]::details-content { content-visibility: visible; opacity: 1; }
}

/* RTL text stays natural while the approved header/Hero image composition stays put. */
html[dir="rtl"] .site-header .nav-wrap,
html[dir="rtl"] .master-home-hero-inner,
html[dir="rtl"] .page-hero > .content-wrap { direction: ltr; }
html[dir="rtl"] .brand { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .master-home-hero-copy,
html[dir="rtl"] .page-hero-copy { direction: rtl; text-align: right; }
html[dir="rtl"] :is(h1, h2, h3, h4, p, label, button, .button) { letter-spacing: normal; }
html[dir="rtl"] [data-locale-technical] { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] :is(.drawer-item-copy strong, .drawer-item-copy small, [data-quote-items] td:nth-child(2), [data-price-tier-output], [data-price-tier-summary], input[type="email"], input[type="tel"], input[type="number"]) {
  direction: ltr;
  unicode-bidi: isolate;
}
html[dir="rtl"] [data-quote-items] td::before { direction: rtl; unicode-bidi: isolate; }
html[dir="rtl"] :is(.lead-capture label, .drawer-note, .quote-form label) { text-align: start; }
html[data-locale] :is(.master-product-card, .drawer-item-copy, .lead-capture-grid > *, .page-hero-copy) { min-width: 0; }
html[data-locale] :is(.lead-capture label, .drawer-item-copy, .master-product-card-name) { overflow-wrap: anywhere; }

@media (max-width: 800px) {
  html body .site-header .main-nav details.language-switcher.locale-language-switcher {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 44px !important;
    margin-block-start: 6px !important;
    color: #fff !important;
    background: transparent !important;
  }
  .locale-language-toggle { min-height: 44px; }
  .locale-language-current { font-size: 14px; }
  html body .site-header .locale-language-options {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: none;
    margin: 0 5px 5px;
    box-shadow: none;
  }
}

/* The incumbent translated homepage already uses a flyout in this width band. */
@media (min-width: 801px) and (max-width: 940px) {
  html[data-locale] body.home:has(.master-home) .locale-language-toggle { min-height: 40px; }
  html[data-locale] body.home:has(.master-home) .site-header .locale-language-options {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0 5px 5px;
    box-shadow: none;
  }
  html[data-locale] body.home:has(.master-home) .site-header details.locale-language-switcher { height: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  .locale-language-toggle,
  .locale-language-chevron,
  .locale-language-options a,
  .locale-language-switcher::details-content { transition: none !important; }
}
