/* Desktop: fixed top-right position for reliability across all header types */
.sanko-lang-switcher {
  position: fixed;
  top: 50%;
  transform:translatey(-50%);
  right: 20px;
  display: inline-flex;
  align-items: center;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.sanko-lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.sanko-lang-current:hover {
  border-color: rgba(0, 0, 0, 0.25);
  background: #f8f9fa;
}

.sanko-lang-current span {
  pointer-events: none;
}

.sanko-lang-current::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #666;
  transition: transform 0.2s ease;
}

.sanko-lang-current[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.sanko-lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  overflow: hidden;
}

.sanko-lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sanko-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: #333;
  text-align: left;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.sanko-lang-option:hover {
  background: #f0f4f8;
}

.sanko-lang-option.active {
  background: #e8f0fe;
  font-weight: 600;
  color: #1a73e8;
}

.sanko-lang-option + .sanko-lang-option {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Mobile responsive */
@media (max-width: 921px) {
  .sanko-lang-switcher {
    top: 34px;
    right: 155px;
  }

  .sanko-lang-current {
    padding: 5px 10px;
    font-size: 12px;
  }

  .sanko-lang-current span {
    display: none;
  }

  .sanko-lang-current::after {
    display: none;
  }

  .sanko-lang-dropdown {
    right: 0;
    min-width: 130px;
  }
}
