/* Language switcher — Skvegrorku header integration */

.lang-switcher {
  position: relative;
  z-index: 1005;
  flex: 0 0 auto;
  margin: 0;
}

.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 20px;
  background-image: linear-gradient(#726cf9 27%, #c57cff);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(114, 108, 249, 0.25);
}

.lang-switcher__btn:hover {
  filter: brightness(1.05);
}

.lang-switcher__btn[aria-expanded="true"] {
  filter: brightness(0.98);
  box-shadow: 0 4px 12px rgba(114, 108, 249, 0.35);
}

.lang-switcher__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

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

.lang-switcher__current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 7.5rem;
}

.lang-switcher__list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  width: max-content;
  min-width: 10.5rem;
  max-width: min(16rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border: 1px solid rgba(13, 18, 27, 0.1);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(13, 18, 27, 0.14);
}

.lang-switcher__list[hidden] {
  display: none !important;
}

.lang-switcher__list li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: normal;
  list-style: none;
}

.lang-switcher__link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border-radius: 0.375rem;
  color: #1c1c1c;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  text-align: left;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switcher__link:hover {
  background: rgba(114, 108, 249, 0.12);
  color: #1c1c1c;
}

.lang-switcher__item--active {
  background: rgba(114, 108, 249, 0.2);
  color: #1c1c1c;
  font-weight: 600;
  pointer-events: none;
}

/* Header layout */
.header-activity-sticky,
.header,
.header-menu,
.navigation-wrapper,
.header-navigation,
.header-navigation-container {
  overflow: visible;
}

.header-menu {
  align-items: center;
  gap: 12px;
}

.header-logo {
  flex: 0 0 auto;
}

.navigation-wrapper {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.header-navigation {
  width: auto;
}

/* Nested w-container breaks header alignment */
.header-navigation-container.w-container {
  max-width: none !important;
  width: auto;
  margin: 0 !important;
  padding: 0 !important;
}

.header-navigation-container.w-container::before,
.header-navigation-container.w-container::after {
  display: none;
}

.header-navigation-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-navigation-container > .lang-switcher {
  order: 2;
  flex: 0 0 auto;
}

.header-navigation-container > .menu-button {
  order: 3;
  float: none !important;
  flex: 0 0 auto;
}

/* Desktop */
@media screen and (min-width: 992px) {
  .header-menu {
    margin-bottom: 10px;
  }

  .header-navigation-box.w-nav-menu {
    float: none;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 0;
    position: relative;
    order: 1;
  }

  .header-navigation-container > .menu-button {
    display: none !important;
  }

  .header-menu-item {
    margin-right: 18px;
  }

  .header-menu-item.get-started {
    margin-right: 0;
  }

  .lang-switcher__btn {
    height: 2.35rem;
    padding: 0 0.85rem;
    font-size: 0.875rem;
  }

  .lang-switcher__current {
    max-width: 8.5rem;
  }
}

/* Tablet & mobile */
@media screen and (max-width: 991px) {
  .header-menu {
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .header-logo {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 112px);
  }

  .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .navigation-wrapper {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .header-navigation-container {
    gap: 4px;
  }

  .header-navigation-container > .menu-button {
    display: block !important;
    padding: 10px 12px;
    margin: 0;
  }

  .lang-switcher__btn {
    height: 2.125rem;
    padding: 0 0.6rem;
    font-size: 0.75rem;
  }

  .lang-switcher__current {
    max-width: 4.75rem;
  }
}

@media screen and (max-width: 479px) {
  .header-logo {
    max-width: calc(100% - 100px);
  }

  .brand-name {
    font-size: 20px;
  }

  .lang-switcher__btn {
    padding: 0 0.5rem;
  }

  .lang-switcher__current {
    max-width: 3.75rem;
  }

  .header-navigation-container > .menu-button {
    padding: 8px 10px;
  }
}
