.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.header__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header-h);
  padding-block: 0.5rem;
}

.header__logo {
  flex: 0 0 auto;
}

.header__logo img {
  height: 40px;
  width: auto;
}

.header__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  flex: 0 0 auto;
  order: 3;
}

.header__burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.header__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.header__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile-first: nav collapses into a fixed panel below the bar */
.header__nav {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
  transform: translateY(-150%);
  transition: transform var(--transition);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
}

.header__nav.is-open {
  transform: translateY(0);
}

.header__nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header__nav-link {
  display: block;
  padding: 0.75rem 0.5rem;
  color: var(--white);
  font-weight: 600;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color var(--transition), background-color var(--transition);
}

.header__nav-link:hover,
.header__nav-link--active {
  color: var(--heading);
  background: rgba(255, 211, 41, 0.08);
}

.header__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.header__cta .btn {
  flex: 1 1 auto;
  white-space: nowrap;
}

.header__flag img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

body.nav-open {
  overflow: hidden;
}

/* Desktop layout: single row, CTA + flag pinned to the far right corner */
@media (min-width: 900px) {
  .header__burger {
    display: none;
  }

  .header__nav {
    position: static;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.25rem;
    padding: 0;
    margin-left: 1.5rem;
    transform: none;
    background: transparent;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }

  .header__nav-list {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    margin-right: auto;
  }

  .header__cta {
    flex-wrap: nowrap;
    margin-left: auto;
  }

  .header__cta .btn {
    flex: 0 0 auto;
    padding-inline: 1.1rem;
  }
}
