/* ==========================================================================
   Keling Medical — multilingual layer
   1. language switcher   2. RTL mirroring   3. non-Latin script typography
   Loaded after styles.css on every page.
   ========================================================================== */

/* ------------------------------------------------ 1. language switcher */
.lang-switch{position:relative;display:inline-flex;flex:0 0 auto;margin-inline-end:10px}
.lang-switch-toggle{display:inline-flex;align-items:center;gap:6px;padding:8px 10px;
  border:1px solid rgba(15,23,42,.14);border-radius:999px;background:#fff;color:#0f172a;
  font:inherit;font-size:.82rem;font-weight:600;line-height:1;cursor:pointer;
  transition:border-color .18s,box-shadow .18s,background .18s}
.lang-switch-toggle:hover{border-color:rgba(15,118,110,.45);background:#f8fafc}
.lang-switch-toggle:focus-visible{outline:2px solid #0f766e;outline-offset:2px}
.lang-switch-toggle svg{flex:0 0 auto;fill:currentColor}
.lang-switch-caret{fill:none;transition:transform .18s}
.lang-switch[data-open] .lang-switch-caret{transform:rotate(180deg)}
.lang-switch-current{max-width:9ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.lang-switch-menu{position:absolute;inset-inline-end:0;top:calc(100% + 8px);z-index:120;
  display:none;margin:0;padding:6px;list-style:none;width:270px;max-height:min(70vh,420px);
  overflow-y:auto;background:#fff;border:1px solid rgba(15,23,42,.12);border-radius:14px;
  box-shadow:0 22px 48px -18px rgba(15,23,42,.38)}
.lang-switch[data-open] .lang-switch-menu{display:block}
.lang-switch-menu li{margin:0}
.lang-switch-menu a{display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  padding:8px 11px;border-radius:9px;color:#0f172a;text-decoration:none;font-size:.86rem}
.lang-switch-menu a:hover,.lang-switch-menu a:focus-visible{background:#f1f5f9;outline:none}
.lang-switch-menu a.is-current{background:#ecfdf5;color:#0f766e;font-weight:700}
.lang-native{font-weight:600}
.lang-en{color:#64748b;font-size:.72rem;white-space:nowrap}

@media (max-width:960px){
  .lang-switch{order:-1;margin-inline:0 8px}
  .lang-switch-current{display:none}
  .lang-switch-menu{width:min(88vw,300px)}
}

/* ------------------------------------------------ 2. RTL (Arabic) */
[dir=rtl] body{text-align:right}
[dir=rtl] .breadcrumbs,[dir=rtl] .topbar-inner,[dir=rtl] .nav,
[dir=rtl] .footer-grid,[dir=rtl] .product-layout,[dir=rtl] .mega-layout{direction:rtl}
[dir=rtl] .check-list li::before,[dir=rtl] .prose ul li::before{left:auto;right:0}
[dir=rtl] .check-list li,[dir=rtl] .prose ul li{padding-left:0;padding-right:1.6em}
[dir=rtl] ul,[dir=rtl] ol{padding-left:0;padding-right:22px}
[dir=rtl] blockquote{border-left:none;border-right:4px solid #0f766e;
  padding-left:0;padding-right:16px}
[dir=rtl] table th,[dir=rtl] table td{text-align:right}
[dir=rtl] .social-rail{left:0;right:auto}
[dir=rtl] .back-top{left:24px;right:auto}
[dir=rtl] .lang-switch-caret,[dir=rtl] .mega-toggle svg{transform:scaleX(-1)}
[dir=rtl] .lang-switch[data-open] .lang-switch-caret{transform:scaleX(-1) rotate(180deg)}
/* arrows written into the copy ("→") must point the other way in RTL */
[dir=rtl] .mega-feature-links a,[dir=rtl] .site-search-all,
[dir=rtl] .product-card-body p,[dir=rtl] .cta-band .btn{unicode-bidi:plaintext}
/* keep Latin model codes, units and URLs left-to-right inside Arabic sentences */
[dir=rtl] .product-model,[dir=rtl] code,[dir=rtl] .quick-facts dd,
[dir=rtl] a[href^="mailto:"],[dir=rtl] a[href^="tel:"]{direction:ltr;
  unicode-bidi:embed;display:inline-block}

/* ------------------------------------------------ 3. script-specific type */
html[lang=ar]{font-family:"Noto Sans Arabic",-apple-system,"Segoe UI",Tahoma,sans-serif}
html[lang=th]{font-family:"Noto Sans Thai",-apple-system,"Segoe UI",Tahoma,sans-serif;
  line-height:1.85}
html[lang=bn]{font-family:"Noto Sans Bengali",-apple-system,"Segoe UI",sans-serif;
  line-height:1.8}
html[lang=my]{font-family:"Noto Sans Myanmar",-apple-system,"Padauk","Myanmar Text",sans-serif;
  line-height:2}
html[lang=ko]{font-family:-apple-system,"Segoe UI","Malgun Gothic","Apple SD Gothic Neo",
  "Noto Sans KR",sans-serif;word-break:keep-all}
html[lang=ru],html[lang=uk],html[lang=mn]{font-family:-apple-system,"Segoe UI",
  Roboto,"Noto Sans",sans-serif}

/* Long compounds / long scripts must not wrap inside the header bar */
html[lang=de] .nav-links a,html[lang=vi] .nav-links a,html[lang=mn] .nav-links a,
html[lang=uk] .nav-links a,html[lang=my] .nav-links a,html[lang=bn] .nav-links a,
html[lang=th] .nav-links a,html[lang=id] .nav-links a,html[lang=ms] .nav-links a,
html[lang=ru] .nav-links a{white-space:nowrap}
html[lang=my] .nav-links a,html[lang=bn] .nav-links a,html[lang=th] .nav-links a{
  line-height:1.35;font-size:.86rem}
html[lang=de] .nav-cta,html[lang=id] .nav-cta,html[lang=ms] .nav-cta,
html[lang=my] .nav-cta,html[lang=bn] .nav-cta,html[lang=mn] .nav-cta{
  padding-inline:14px;font-size:.8rem;white-space:nowrap;line-height:1.35}
/* topbar micro-copy gets long in Burmese / Bengali / Thai */
html[lang=my] .topbar,html[lang=bn] .topbar,html[lang=th] .topbar{font-size:.72rem}
.mega-category span,.footer li a{overflow-wrap:anywhere}

/* Letter-spacing + uppercase are Latin typographic devices. In Arabic they break
   glyph joining, in Thai/Burmese/Bengali they break the syllable cluster, and in
   Korean uppercase does nothing. Turn them off for those scripts. */
html[lang=ar] .eyebrow,html[lang=th] .eyebrow,html[lang=bn] .eyebrow,
html[lang=my] .eyebrow,html[lang=ko] .eyebrow,
html[lang=ar] .core-mark,html[lang=th] .core-mark,html[lang=bn] .core-mark,
html[lang=my] .core-mark,html[lang=ko] .core-mark,
html[lang=ar] .footer-badges span,html[lang=th] .footer-badges span,
html[lang=bn] .footer-badges span,html[lang=my] .footer-badges span{
  letter-spacing:0;text-transform:none;word-spacing:normal}
html[lang=ar] .eyebrow{padding-inline-end:2px}

/* keep the switcher rows left-aligned even when the label itself is RTL */
.lang-switch-menu a{direction:ltr;text-align:start}
.lang-native{unicode-bidi:isolate}
