/* ============================================================
   Language switcher + layout tolerances for translated pages.
   Loaded only under /es/ /pt/ /ar/ /ru/ /de/ /ja/ /ko/.
   Written against this site's own classes and tokens.
   ============================================================ */

/* --- switcher ---------------------------------------------- */
.langsw { position: relative; display: inline-flex; }

.langsw__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: #cfe0ec;
  font-family: inherit;
  font-size: .83rem;
  line-height: 1.5;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.langsw__btn svg { width: 1em; height: 1em; flex: none; }
.langsw__btn:hover,
.langsw__btn:focus-visible { color: #fff; background: rgba(255, 255, 255, .1); }

.langsw__menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 70;
  min-width: 10rem;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  border-radius: var(--r);
  box-shadow: 0 14px 38px rgba(21, 36, 48, .16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s, visibility 0s linear .2s;
}
.langsw:hover .langsw__menu,
.langsw:focus-within .langsw__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.langsw__menu li { margin: 0; }
.langsw__menu a {
  display: block;
  padding: 7px 16px;
  color: var(--ink);
  font-size: .88rem;
  line-height: 1.5;
}
.langsw__menu a:hover,
.langsw__menu a:focus-visible { background: var(--bg); color: var(--blue); }
.langsw__menu a[aria-current="true"] { font-weight: 700; color: var(--blue); }

/* --- long translated labels ---------------------------------
   "Request A Quote" becomes "Angebot anfordern" / "Запросить
   коммерческое предложение", which overflows a header sized for
   the English original. Tighten it where the row stops fitting. */
@media (min-width: 901px) and (max-width: 1180px) {
  .head-in { gap: 16px; }
  .nav > li > a { padding-left: 8px; padding-right: 8px; font-size: .88rem; }
  .btn-quote { margin-left: 6px; }
  .btn-quote.btn { padding: 10px 14px; font-size: .82rem; }
  .brand img { height: 40px; width: auto; }
}

/* The topbar carries contact details and now the switcher too. */
.topbar .wrap { flex-wrap: wrap; row-gap: 8px; }
.topbar-c { flex-wrap: wrap; align-items: center; }

/* German and Russian compounds must not punch out of cards,
   mega-menu columns or table cells. */
.mega a, .card h3, .card p, .tile h3, .tile p,
table th, table td, .crumbs li, .chip {
  overflow-wrap: break-word;
}

/* Longer headlines need a lower starting size. */
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }

/* CJK reads better with looser leading and no tracking. */
:root:lang(ja), :root:lang(ko) { line-height: 1.85; }
:lang(ja) h1, :lang(ja) h2, :lang(ko) h1, :lang(ko) h2 { line-height: 1.35; }
:lang(ja) .btn, :lang(ko) .btn { letter-spacing: 0; }
