/**
 * Language Switcher — Bricks Element Styles.
 */
.oco-lang-switcher {
  position: relative;
  display: inline-flex;
}

.oco-lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.oco-lang-switcher__btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* WCAG 2.4.7 — visible keyboard focus on the trigger button. */
.oco-lang-switcher__btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.oco-lang-switcher__flag {
  font-size: 1.15em;
  line-height: 1;
}

.oco-lang-switcher__label,
.oco-lang-switcher__name {
  line-height: 1.2;
}

.oco-lang-switcher__chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.oco-lang-switcher__btn[aria-expanded="true"] .oco-lang-switcher__chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.oco-lang-switcher__dropdown {
  position: absolute;
  z-index: 9999;
  display: none;
  min-width: 140px;
  margin: 4px 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.oco-lang-switcher__dropdown.is-open {
  display: block;
}

/* Dropdown positions */
.oco-lang-switcher__dropdown--bottom-left {
  top: 100%;
  left: 0;
}

.oco-lang-switcher__dropdown--bottom-right {
  top: 100%;
  right: 0;
}

.oco-lang-switcher__dropdown--top-left {
  bottom: 100%;
  left: 0;
}

.oco-lang-switcher__dropdown--top-right {
  bottom: 100%;
  right: 0;
}

/* Dropdown items */
.oco-lang-switcher__item {
  margin: 0;
  padding: 0;
}

.oco-lang-switcher__item a,
.oco-lang-switcher__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.1s ease;
}

.oco-lang-switcher__item a:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

/* WCAG 2.4.7 — visible keyboard focus on menu links. */
.oco-lang-switcher__item a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background-color: rgba(0, 0, 0, 0.04);
}

.oco-lang-switcher__item--active a {
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.03);
}
