/* header.css */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(33, 7, 40, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}
.header__logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.header__logo img { height: 40px; width: auto; }

.header__nav-list {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.75rem);
}
.header__nav-link {
  color: var(--color-text);
  font-weight: var(--fw-semibold);
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
  white-space: nowrap;
}
.header__nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--gradient-cta);
  transition: width var(--transition);
}
.header__nav-link:hover, .header__nav-link:focus-visible { color: var(--color-white); }
.header__nav-link:hover::after, .header__nav-link--active::after { width: 100%; }
.header__nav-link--active { color: var(--color-heading); }

.header__actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.header__cta, .header__login { padding: 0.6rem 1.15rem; font-size: 0.9rem; }
.header__flag { display: inline-flex; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,0.2); }
.header__flag img { display: block; width: 28px; height: 20px; object-fit: cover; }
.header__nav-cta { display: none; }

.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius-card);
  order: 5;
}
.header__burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-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); }

.header__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

/* Scroll lock while the mobile menu is open.
   Applied to <html> only so the sticky header keeps its position. */
html.nav-lock { overflow: hidden; }

/* Mobile / tablet: burger menu, flat list, CTAs inside menu */
@media (max-width: 991px) {
  .header__burger { display: flex; }
  .header__nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: min(320px, 85vw);
    height: calc(100dvh - var(--header-height));
    background: var(--color-bg-dark);
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform var(--transition), visibility var(--transition);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 95;
    visibility: hidden;        /* keep closed panel out of the layout/scroll region */
    pointer-events: none;
  }
  .header__nav.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .header__nav-list { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .header__nav-link {
    display: block;
    padding: 0.85rem 0.5rem;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .header__nav-link::after { display: none; }

  /* CTAs (Registration + Log In) appear inside the menu panel when it opens */
  .header__nav-cta {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  /* Hide header CTAs on mobile; burger stays on the right edge */
  .header__cta, .header__login { display: none; }
  .header__flag { display: none; }
}
