/* ========== Header / Navigation ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: all var(--transition);
}
.header.scrolled {
  box-shadow: var(--shadow-sm);
}
.header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.header__logo {
  display: flex;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Nav */
.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.header__nav a {
  font-size: 0.9rem;
  color: var(--text-medium);
  transition: color var(--transition);
  white-space: nowrap;
  position: relative;
}
.header__nav a:hover,
.header__nav a.active {
  color: var(--primary);
}
.header__nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Auth buttons */
.header__auth {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header__auth .btn {
  padding: 8px 20px;
  font-size: 0.85rem;
}

/* Logged-in state */
.header__user {
  display: none;
  align-items: center;
  gap: 12px;
}
.header__user.show {
  display: flex;
}
.header__auth.hidden {
  display: none;
}
.header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}
.header__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  padding: 8px 0;
  display: none;
  z-index: 100;
}
.header__dropdown.open {
  display: block;
}
.header__dropdown a {
  display: block;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: var(--text-medium);
}
.header__dropdown a:hover {
  background: var(--warm-white);
  color: var(--primary);
}

/* Mobile hamburger */
.header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.header__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  transition: all var(--transition);
  border-radius: 1px;
}
.header__hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.header__hamburger.open span:nth-child(2) {
  opacity: 0;
}
.header__hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  z-index: 999;
  padding: 32px 24px;
  flex-direction: column;
  gap: 0;
}
.mobile-nav.open {
  display: flex;
}
.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 1.1rem;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.mobile-nav a:hover {
  color: var(--primary);
}
.mobile-nav__auth {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}
.mobile-nav__auth .btn {
  flex: 1;
}

/* Body padding for fixed header */
.page-body {
  padding-top: var(--header-height);
}

@media (max-width: 900px) {
  .header__nav { display: none; }
  .header__auth { display: none; }
  .header__hamburger { display: flex; }
}
