/* Mobile signal language switcher, isolated from the desktop rail matrix. */
.mobile-signal-language-switcher {
  --mobile-signal-text: #edf3f6;
  --mobile-signal-muted: #9aa7af;
  --mobile-signal-steel-hi: #aebbc2;
  --mobile-signal-steel-mid: #6f7d86;
  --mobile-signal-steel-low: #344047;
  --fa: 224 158 62;
  --dr: 183 118 80;
  --en: 53 184 234;
  --ru: 132 178 207;
  --active: var(--fa);
  --motion: var(--fa);
  --switch-width: 80px;
  --switch-height: 244px;
  --lamp-size: 35px;
  --touch-target: 47px;
  --radius: 29px;
  --signal-axis-x: 34px;
  --font-ui: "Univia Pro", "Segoe UI", Arial, sans-serif;
  --font-fa: "IRANSansX", "IRANYekanX", Tahoma, Arial, sans-serif;

  position: absolute;
  z-index: calc(var(--z-content) + 5);
  top: max(6.35rem, calc(env(safe-area-inset-top) + 5.35rem));
  left: max(1rem, env(safe-area-inset-left));
  display: none;
  width: var(--switch-width);
  height: var(--switch-height);
  color: var(--mobile-signal-text);
  font-family: var(--font-ui);
  pointer-events: auto;
}

.mobile-signal-language-switcher,
.mobile-signal-language-switcher *,
.mobile-signal-language-switcher *::before,
.mobile-signal-language-switcher *::after {
  box-sizing: border-box;
}

.mobile-signal-language-switcher .signal-switcher {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  width: 100%;
  height: 100%;
  gap: 0;
  padding: 12px 8px 45px;
  overflow: hidden;
  border: 1px solid rgb(196 211 219 / 0.25);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgb(255 255 255 / 0.048), transparent 28%),
    linear-gradient(180deg, rgb(17 24 28 / 0.93), rgb(8 12 15 / 0.96));
  box-shadow:
    0 20px 52px rgb(0 0 0 / 0.44),
    inset 0 1px 0 rgb(255 255 255 / 0.06),
    inset 0 -1px 0 rgb(255 255 255 / 0.018);
  direction: ltr;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.mobile-signal-language-switcher .signal-switcher::before {
  position: absolute;
  inset: 7px;
  border: 1px solid rgb(255 255 255 / 0.038);
  border-radius: calc(var(--radius) - 7px);
  content: "";
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-switcher::after {
  position: absolute;
  top: 0;
  right: 18%;
  left: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.28), transparent);
  content: "";
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-rail {
  position: absolute;
  z-index: -1;
  top: 22px;
  bottom: 51px;
  left: var(--signal-axis-x);
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--mobile-signal-steel-mid) 0 26%,
    var(--mobile-signal-steel-hi) 26% 48%,
    var(--mobile-signal-steel-low) 48% 68%,
    var(--mobile-signal-steel-mid) 68% 100%
  );
  box-shadow: 1px 0 0 rgb(255 255 255 / 0.035), -1px 0 0 rgb(0 0 0 / 0.35);
  opacity: 0.63;
}

.mobile-signal-language-switcher .signal-rail::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1px;
  width: 1px;
  border-radius: inherit;
  background: rgb(7 11 14 / 0.65);
  content: "";
}

.mobile-signal-language-switcher .signal-switcher[data-language="fa"] {
  --active: var(--fa);
}

.mobile-signal-language-switcher .signal-switcher[data-language="fa-AF"] {
  --active: var(--dr);
}

.mobile-signal-language-switcher .signal-switcher[data-language="en"] {
  --active: var(--en);
}

.mobile-signal-language-switcher .signal-switcher[data-language="ru"] {
  --active: var(--ru);
}

.mobile-signal-language-switcher .signal-option {
  --option: var(--mobile-signal-steel-mid);

  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  min-height: var(--touch-target);
  align-items: center;
  padding: 0 2px 0 4px;
  border-radius: 18px;
  color: #7d8a92;
  font: inherit;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-signal-language-switcher .signal-option[data-lang="fa"] {
  --option: var(--fa);
}

.mobile-signal-language-switcher .signal-option[data-lang="fa-AF"] {
  --option: var(--dr);
}

.mobile-signal-language-switcher .signal-option[data-lang="en"] {
  --option: var(--en);
}

.mobile-signal-language-switcher .signal-option[data-lang="ru"] {
  --option: var(--ru);
}

.mobile-signal-language-switcher .signal-option:focus-visible {
  outline: 2px solid rgb(234 241 244 / 0.9);
  outline-offset: 2px;
}

.mobile-signal-language-switcher .signal-option:active .signal-lamp {
  transform: scale(0.985);
}

.mobile-signal-language-switcher .signal-option:is(:active, :focus-visible) .signal-code {
  color: #c9d3d8;
}

.mobile-signal-language-switcher .signal-lamp {
  position: relative;
  width: var(--lamp-size);
  height: var(--lamp-size);
  justify-self: center;
  border: 1px solid rgb(196 209 216 / 0.36);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #354047 0 10%, #222c31 34%, #151d21 68%, #0e1417 100%);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 0.09),
    inset 0 -5px 10px rgb(0 0 0 / 0.38),
    0 0 0 3px rgb(255 255 255 / 0.014),
    0 2px 4px rgb(0 0 0 / 0.36);
  transform: translateZ(0);
  transition: transform 110ms ease, border-color 160ms ease, box-shadow 180ms ease;
}

.mobile-signal-language-switcher .signal-lamp__bezel {
  position: absolute;
  inset: 2px;
  border: 1px solid rgb(205 217 223 / 0.17);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.045), inset 0 -1px 0 rgb(0 0 0 / 0.42);
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-lamp__lens {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 38% 31%,
    rgb(var(--option) / 0.16) 0 13%,
    rgb(var(--option) / 0.105) 32%,
    rgb(66 78 85 / 0.44) 58%,
    rgb(28 37 42 / 0.86) 100%
  );
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 0.05), inset 0 -5px 8px rgb(0 0 0 / 0.3);
  opacity: 0.9;
  transition: background 180ms ease, box-shadow 180ms ease, opacity 160ms ease, filter 120ms ease;
}

.mobile-signal-language-switcher .signal-lamp__lens::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--option));
  box-shadow: 0 0 0 rgb(0 0 0 / 0);
  opacity: 0;
  content: "";
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, background 180ms ease, box-shadow 180ms ease;
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-option[aria-current="page"] .signal-lamp__lens::after,
.mobile-signal-language-switcher .signal-option.is-arriving .signal-lamp__lens::after {
  background: rgb(var(--active));
  box-shadow: 0 0 4px rgb(255 255 255 / 0.3), 0 0 9px rgb(var(--active) / 0.34);
  opacity: 1;
}

@supports (color: color-mix(in srgb, white, black)) {
  .mobile-signal-language-switcher .signal-option[aria-current="page"] .signal-lamp__lens::after {
    background: color-mix(in srgb, rgb(var(--active)) 62%, white 38%);
    box-shadow:
      0 0 4px color-mix(in srgb, rgb(var(--active)) 70%, white 30%),
      0 0 9px rgb(var(--active) / 0.34);
  }

  .mobile-signal-language-switcher .signal-option.is-arriving .signal-lamp__lens::after {
    background: color-mix(in srgb, rgb(var(--motion)) 62%, white 38%);
    box-shadow:
      0 0 4px color-mix(in srgb, rgb(var(--motion)) 70%, white 30%),
      0 0 9px rgb(var(--motion) / 0.34);
  }
}

.mobile-signal-language-switcher .signal-lamp__glint {
  position: absolute;
  top: 7px;
  left: 8px;
  width: 9px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(255 255 255 / 0.28), rgb(255 255 255 / 0.04) 60%, transparent 72%);
  opacity: 0.34;
  transform: rotate(-28deg);
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-lamp__confirm {
  position: absolute;
  inset: -4px;
  border: 1px solid rgb(var(--motion) / 0.52);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.91);
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-option[aria-current="page"] .signal-lamp {
  border-color: rgb(var(--active) / 0.7);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 0.22),
    inset 0 -5px 10px rgb(0 0 0 / 0.22),
    0 0 9px rgb(var(--active) / 0.2),
    0 0 0 3px rgb(var(--active) / 0.028),
    0 2px 4px rgb(0 0 0 / 0.34);
}

.mobile-signal-language-switcher .signal-option[aria-current="page"] .signal-lamp__lens {
  background: radial-gradient(
    circle at 37% 29%,
    rgb(255 255 255 / 0.44) 0 8%,
    rgb(var(--active) / 1) 17%,
    rgb(var(--active) / 0.95) 42%,
    rgb(var(--active) / 0.75) 70%,
    rgb(var(--active) / 0.47) 100%
  );
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 0.25), inset 0 -5px 9px rgb(0 0 0 / 0.14);
  opacity: 1;
}

.mobile-signal-language-switcher .signal-option[aria-current="page"] .signal-lamp__glint {
  opacity: 0.58;
}

.mobile-signal-language-switcher .signal-option.is-arriving .signal-lamp {
  border-color: rgb(var(--motion) / 0.66);
  box-shadow:
    0 0 8px rgb(var(--motion) / 0.17),
    0 0 0 3px rgb(var(--motion) / 0.025),
    inset 0 1px 1px rgb(255 255 255 / 0.14);
}

.mobile-signal-language-switcher .signal-option.is-arriving .signal-lamp__lens {
  background: radial-gradient(
    circle at 37% 29%,
    rgb(255 255 255 / 0.34) 0 7%,
    rgb(var(--motion) / 0.96) 18%,
    rgb(var(--motion) / 0.82) 48%,
    rgb(var(--motion) / 0.55) 100%
  );
  opacity: 1;
}

.mobile-signal-language-switcher .signal-code {
  justify-self: start;
  margin-left: 5px;
  color: #748189;
  font-size: 0.49rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.075em;
  transform: translateY(0.25px);
  transition: color 150ms ease, opacity 150ms ease;
}

.mobile-signal-language-switcher .signal-option:is([aria-current="page"], .is-arriving) .signal-code {
  color: #eef4f6;
}

.mobile-signal-language-switcher .signal-pulse {
  position: absolute;
  z-index: 1;
  top: 22px;
  left: var(--signal-axis-x);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--motion));
  box-shadow: 0 0 6px rgb(var(--motion) / 0.32);
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-pulse::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to bottom, transparent, rgb(var(--motion) / 0.45), transparent);
  opacity: 0.62;
  content: "";
  transform: translate(-50%, -50%);
}

.mobile-signal-language-switcher .signal-footer {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.mobile-signal-language-switcher .signal-footer strong {
  color: #f1f5f7;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.mobile-signal-language-switcher .signal-footer small {
  margin-top: 2px;
  color: #65727a;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.12em;
}

.mobile-signal-language-switcher .signal-switcher[data-navigating="true"] {
  pointer-events: none;
}

.mobile-signal-language-switcher .mobile-signal-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 47.99rem) {
  .mobile-signal-language-switcher {
    display: block;
  }

  body.menu-open .mobile-signal-language-switcher {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 30rem) {
  .mobile-signal-language-switcher {
    top: max(5.7rem, calc(env(safe-area-inset-top) + 4.7rem));
  }
}

@media (max-width: 22.5rem) {
  .mobile-signal-language-switcher {
    --switch-width: 77px;
    --switch-height: 240px;
    --lamp-size: 34px;
  }

  .mobile-signal-language-switcher .signal-code {
    margin-left: 4px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .mobile-signal-language-switcher .signal-switcher {
    background: #0b1013;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-signal-language-switcher *,
  .mobile-signal-language-switcher *::before,
  .mobile-signal-language-switcher *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
