/* Mufeng language switcher + WeChat modal + RTL (local preview only) */

@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/i18n/fonts/NotoSansArabic-Variable.ttf") format("truetype");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/i18n/fonts/NotoSans-Variable.ttf") format("truetype");
}

html[lang]:not([lang="en"]) body {
  font-family: "Noto Sans Arabic", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, Arial, sans-serif;
}

.mf-lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 70;
  margin-inline-start: auto;
  flex: 0 0 auto;
}
.mf-lang-switcher .mf-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e3a8a;
  color: #fff !important;
  border: 1px solid #152c68;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  font-weight: 600;
  font-family: inherit;
}
.mf-lang-switcher .mf-lang-btn:hover,
.mf-lang-switcher.open .mf-lang-btn {
  background: #1a56db;
}
.mf-lang-switcher .mf-caret { font-size: 10px; opacity: .95; }
.mf-lang-switcher .mf-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 160px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15,31,77,.16);
  z-index: 80;
}
.mf-lang-switcher.open .mf-lang-menu,
.mf-lang-switcher:focus-within .mf-lang-menu { display: block; }
.mf-lang-switcher .mf-lang-menu a {
  display: block;
  padding: 8px 14px;
  color: #1f2937;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.mf-lang-switcher .mf-lang-menu a:hover,
.mf-lang-switcher .mf-lang-menu a:focus { background: #eef3ff; color: #1a56db; }
.mf-lang-switcher .mf-lang-menu a.is-active { color: #1a56db; background: #eef3ff; }

.site-header .hdr { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .mf-lang-switcher { margin-inline-start: 0; }
}

.wechat-float {
  position: fixed;
  right: 18px;
  bottom: 82px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: #07C160;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  z-index: 60;
  cursor: pointer;
  padding: 0;
}
.wechat-float:hover { background: #06ad56; color: #fff; }
.wechat-float svg { width: 30px; height: 30px; }
html[dir="rtl"] .wa-float,
html[dir="rtl"] .wechat-float { right: auto; left: 18px; }

@media (max-width: 760px) {
  .wechat-float { display: none; }
  .sticky-cta { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .sticky-cta .btn { padding: 8px 6px; font-size: .82rem; min-height: 44px; }
}

.btn-wechat { background: #07C160; color: #fff; border-color: #07C160; }
.btn-wechat:hover { background: #06ad56; color: #fff; }

.mufeng-wechat-cta.mufeng-wechat-below-wa {
  display: block;
  clear: both;
  width: 100%;
  margin: 8px 0 16px;
}
.mufeng-wechat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  background: #07C160;
  color: #fff !important;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 14px 36px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(7, 193, 96, 0.28);
  font-family: inherit;
}
.mufeng-wechat-btn:hover,
.mufeng-wechat-btn:focus-visible { background: #06ad56; color: #fff !important; outline: none; }
html[dir="rtl"] .mufeng-wechat-cta { text-align: right; }

.mufeng-wechat-modal[hidden] { display: none !important; }
.mufeng-wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mufeng-wechat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
}
.mufeng-wechat-modal-card {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: 28px 24px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  text-align: center;
  max-width: 92vw;
}
.mufeng-wechat-modal-card img {
  display: block;
  width: 240px;
  height: auto;
  max-width: 80vw;
  margin: 0 auto;
  background: #fff;
}
.mufeng-wechat-modal-card p {
  margin: 10px 0 0;
  font-size: 14px;
  color: #333;
}
.mufeng-wechat-modal-card .mufeng-wechat-id {
  font-weight: 700;
  color: #1f2937;
  direction: ltr;
  unicode-bidi: isolate;
}
.mufeng-wechat-modal-close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}
html[dir="rtl"] .mufeng-wechat-modal-close { right: auto; left: 10px; }

html[dir="rtl"] .site-nav { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .nav-toggle { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .crumbs li+li::before { margin-right: 0; margin-left: 4px; }
html[dir="rtl"] .table-wrap td,
html[dir="rtl"] .table-wrap th { text-align: right; }
html[dir="rtl"] .social a { margin-right: 0; margin-left: 14px; }
html[dir="rtl"] .note { border-left: 0; border-right: 4px solid #f0b429; }
html[dir="rtl"] .scene-bg img { object-position: 30% center; }
html[dir="rtl"] .clist b { margin-left: 8px; }

.brand-logo { width: 132px; height: auto; }

/* Collapse the header nav when JS adds .nav-collapsed (long RTL/translated labels). */
.site-header.nav-collapsed .nav-toggle { display: block; margin-inline-start: auto; }
.site-header.nav-collapsed .site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  margin: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}
.site-header.nav-collapsed .site-nav.open { display: block; }
.site-header.nav-collapsed .site-nav ul { flex-direction: column; padding: 8px 20px 16px; }
.site-header.nav-collapsed .site-nav a { padding: 12px 8px; font-size: 1rem; }
.site-header.nav-collapsed .hdr-cta { margin-inline-start: 0; }

/* Keep RTL horizontal nav a bit tighter so it can stay in the 1200px bar when possible. */
html[dir="rtl"] .hdr { gap: 8px; }
html[dir="rtl"] .site-nav a { padding: 10px 7px; font-size: .88rem; }
