.site-header,
body > header {
  position: sticky !important;
  top: 0;
  z-index: 1000;
  background: rgba(255, 250, 241, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.language-switcher {
  position: relative;
  display: inline-flex;
  z-index: 80;
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  max-width: 168px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  background: #fff;
  color: #26323f;
  font: 700 13px/1 inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 32, 25, .04);
}

.language-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.language-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-chevron {
  flex: 0 0 auto;
  font-size: 11px;
  transition: transform .2s;
}

.language-switcher.is-open .language-chevron {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 168px;
  max-height: min(420px, calc(100vh - 112px));
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(20, 32, 25, .16);
  display: none;
}

.language-switcher.is-open .language-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.language-option {
  display: flex;
  align-items: center;
  min-height: 34px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #26323f;
  text-align: left;
  font: 600 13px/1.25 inherit;
  cursor: pointer;
}

.language-option:hover,
.language-option:focus-visible {
  background: #f5f7fa;
  outline: none;
}

.language-option.is-active {
  color: #f04f23;
}

.footer-language {
  margin-left: auto;
}

.footer-language .language-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

html[dir="rtl"] .language-menu {
  right: auto;
  left: 0;
}

@media (max-width: 760px) {
  .language-button {
    min-width: 104px;
    max-width: 144px;
  }

  .language-menu {
    width: 156px;
    max-height: min(380px, calc(100vh - 96px));
  }

  .footer-language {
    margin-left: 0;
  }
}
