/**
 * Shared frontend language/currency switcher (all themes).
 */

.frontend-switcher-menu {
  position: relative;
}

.frontend-switcher-menu > summary {
  list-style: none;
  cursor: pointer;
}

.frontend-switcher-menu > summary::-webkit-details-marker {
  display: none;
}

.frontend-switcher-menu[open] .frontend-switcher-chevron {
  transform: rotate(180deg);
}

.frontend-switcher-chevron {
  margin-left: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.frontend-switcher-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.frontend-switcher-summary__icon {
  flex-shrink: 0;
}

.frontend-switcher-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 15rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 50;
}

.frontend-switcher-panel--primary {
  z-index: 40;
}

.frontend-switcher-panel--inline {
  z-index: 45;
}

.frontend-switcher-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.frontend-switcher-link:hover,
.frontend-switcher-link--active,
.frontend-switcher-link.language-switcher-link--active,
.frontend-switcher-link.currency-switcher-link--active {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
}

.frontend-switcher-link--mobile {
  padding: 0.85rem 1rem;
}

.frontend-switcher-link__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.frontend-switcher-link__label {
  min-width: 0;
  flex: 1 1 auto;
}

.frontend-switcher-link__check {
  flex-shrink: 0;
  margin-left: auto;
  color: #2563eb;
}

.frontend-switcher-panel .language-flag {
  width: 1.25rem;
  height: 0.9375rem;
}

.frontend-switcher-mobile {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.frontend-switcher-mobile__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.frontend-switcher-mobile__links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Default theme: topbar uses light text on dark bar */
.topbar .frontend-switcher-summary--primary.topbar-link {
  color: inherit;
}

.topbar .frontend-switcher-summary__label--primary {
  display: none;
}

@media (min-width: 768px) {
  .topbar .frontend-switcher-summary__label--primary {
    display: inline;
  }
}

/* Buldirekt: inline switcher in primary nav */
.bd-nav .frontend-switcher-menu--inline,
.bd-nav .frontend-switcher-menu--inline > summary {
  flex-shrink: 0;
}

.bd-nav .frontend-switcher-summary--inline {
  padding: 11px 14px;
  background: var(--bd-surface-alt, #f6f8fc);
  color: #2d3448;
  font-weight: 700;
  border-radius: 12px;
}

.bd-topbar .frontend-switcher-menu--primary {
  position: relative;
}

.bd-topbar .frontend-switcher-summary--primary {
  opacity: 0.92;
}

.bd-topbar .frontend-switcher-summary--primary:hover {
  opacity: 1;
}
