/* Scoped visual layer for the FYPAS global-header language switcher. */
#fypas-header-language-staging[hidden] { display: none !important; }
.mg-shell-header .fypas-header-language-switcher {
  position: relative; flex: 0 0 auto; min-width: 0; margin: 0;
  color: var(--mg-navy, #0B1D3A); font: inherit;
}
.mg-shell-header .fypas-header-language-switcher > summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 9px; border: 1px solid transparent;
  border-radius: 9px; background: transparent; color: var(--mg-navy, #0B1D3A);
  font: 600 11px/1.3 Inter, Arial, sans-serif; white-space: nowrap;
  list-style: none; cursor: pointer; box-shadow: none;
}
.mg-shell-header .fypas-header-language-switcher > summary::-webkit-details-marker { display: none; }
.mg-shell-header .fypas-header-language-switcher > summary::after {
  content: ""; width: 5px; height: 5px; margin-left: 1px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.mg-shell-header .fypas-header-language-switcher[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.mg-shell-header .fypas-header-language-switcher > summary:hover,
.mg-shell-header .fypas-header-language-switcher[open] > summary {
  background: transparent; border-color: transparent; box-shadow: none;
}
/* Keep a keyboard-only focus indicator, not a persistent visual border. */
.mg-shell-header .fypas-header-language-switcher > summary:focus-visible,
.mg-shell-header .fypas-hls-options a:focus-visible { outline: 3px solid rgba(26,115,232,.3); outline-offset: 3px; }
.mg-shell-header .fypas-hls-flag {
  display: inline-block; flex: 0 0 auto; width: 16px; height: 11px;
  border-radius: 1.5px; background-position: center; background-repeat: no-repeat;
  background-size: cover; box-shadow: 0 0 0 1px rgba(11,29,58,.14);
}
.mg-shell-header .fypas-hls-flag--us { background-image: url("flags/us.svg"); }
.mg-shell-header .fypas-hls-flag--br { background-image: url("flags/br.svg"); }
.mg-shell-header .fypas-hls-flag--es { background-image: url("flags/es.svg"); }
.mg-shell-header .fypas-hls-flag--tw { background-image: url("flags/tw.svg"); }
.mg-shell-header .fypas-hls-flag--cn { background-image: url("flags/cn.svg"); }
.mg-shell-header .fypas-hls-code { display: inline-block; line-height: 1; }
.mg-shell-header .fypas-hls-options {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 220px;
  max-width: calc(100vw - 34px); max-height: min(340px, calc(100dvh - 100px));
  overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 8px;
  border: 1px solid var(--mg-line, #E4EBF3); border-radius: 13px;
  background: #fff; box-shadow: 0 16px 36px rgba(11,29,58,.16); list-style: none;
}
.mg-shell-header .fypas-hls-options li { margin: 0; padding: 0; list-style: none; }
.mg-shell-header .fypas-hls-options a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 40px; padding: 9px 10px; border-radius: 8px; color: #263B56;
  font: 600 13px/1.4 Inter, Arial, sans-serif; text-decoration: none; overflow-wrap: anywhere;
}
.mg-shell-header .fypas-hls-option-label { display: inline-flex; align-items: center; min-width: 0; gap: 8px; }
.mg-shell-header .fypas-hls-options a:hover,
.mg-shell-header .fypas-hls-options a[aria-current="true"] { color: var(--mg-navy, #0B1D3A); background: #EEF5FF; }
.mg-shell-header .fypas-hls-options a[aria-current="true"]::after { content: "✓"; flex: 0 0 auto; color: var(--mg-blue, #1A73E8); font-weight: 800; }
@media (min-width:1061px) and (max-width:1280px) {
  .mg-shell-header.fypas-has-language-switcher .mg-shell-header__inner { column-gap:16px; }
  .mg-shell-header.fypas-has-language-switcher .mg-shell-nav { gap:16px; }
  .mg-shell-header.fypas-has-language-switcher .mg-shell-nav a { font-size:13px; }
}
@media (max-width:1060px) {
  .mg-shell-header.fypas-has-language-switcher .mg-shell-mobile-nav { max-height:calc(100vh - 80px); max-height:calc(100dvh - 80px); overflow-y:auto; overscroll-behavior-y:contain; }
  body.admin-bar .mg-shell-header.fypas-has-language-switcher .mg-shell-mobile-nav { max-height:calc(100vh - 112px); max-height:calc(100dvh - 112px); }
  .mg-shell-header [data-fypas-language-switcher="mobile"] { margin-top:12px; }
  .mg-shell-header [data-fypas-language-switcher="mobile"] > summary { justify-content:flex-start; width:100%; min-height:42px; padding-inline:10px; font-size:12px; }
  .mg-shell-header [data-fypas-language-switcher="mobile"] > summary::after { margin-left:auto; }
  .mg-shell-header [data-fypas-language-switcher="mobile"] .fypas-hls-options { position:static; width:100%; max-width:100%; max-height:260px; margin-top:7px; box-shadow:none; }
}
@media (max-width:782px) {
  body.admin-bar .mg-shell-header.fypas-has-language-switcher .mg-shell-mobile-nav { max-height:calc(100vh - 126px); max-height:calc(100dvh - 126px); }
}
