/* ==========================================================================
   header.css — BEM: header, header__*, header--*
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--color-bg-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 12px;
}

.header__logo {
  flex-shrink: 0;
  min-width: 0;
  display: inline-flex;
}

.header__logo img {
  width: clamp(88px, 24vw, 150px);
  height: auto;
}

@media (min-width: 480px) {
  .header__inner { gap: 16px; }
  .header__logo img { width: clamp(120px, 14vw, 150px); }
}

/* ---- Desktop nav ---- */
.header__nav--desktop {
  display: none;
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header__nav-item {
  position: relative;
}

.header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-small);
  color: var(--color-text-main);
  padding: 8px 2px;
}

.header__nav-link:hover,
.header__nav-link--active {
  color: var(--color-heading-gold);
}

/* ---- Actions (CTA + flag + burger) ---- */
.header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
}

.header__login,
.header__register {
  display: none;
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.header__flag {
  display: none;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
}

.header__flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: var(--radius-card);
}

@media (min-width: 380px) {
  .header__login,
  .header__register {
    padding: 9px 14px;
    font-size: 12px;
  }
}

@media (min-width: 480px) {
  .header__actions { gap: 10px; }
  .header__login,
  .header__register {
    padding: 10px 18px;
    font-size: 13px;
  }
  .header__burger { width: 40px; height: 40px; padding: 8px; }
}

.header__burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-heading-gold);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

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

/* ---- Mobile flat menu ---- */
.header__mobile-menu {
  display: none;
  max-height: 0;
  overflow: hidden;
  background: var(--color-bg-dark);
  transition: max-height var(--transition-base);
}

.header__mobile-menu.is-open {
  display: block;
  max-height: 80dvh;
  overflow-y: auto;
}

.header__mobile-list {
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
}

.header__mobile-link {
  display: block;
  padding: 14px 4px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header__mobile-link--active,
.header__mobile-link:hover {
  color: var(--color-heading-gold);
}

@media (min-width: 768px) {
  .header__flag { display: inline-flex; }
}

@media (min-width: 1024px) {
  .header__nav--desktop { display: block; }
  .header__burger { display: none; }
  .header__login,
  .header__register {
    display: inline-flex;
  }
  .header__mobile-menu,
  .header__mobile-menu.is-open {
    display: none;
    max-height: 0;
  }
}
