/* ViillanyMarket Header Styles */

.vm-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 16, 32, 0.96);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.vm-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.vm-header__brand {
  display: flex;
  align-items: center;
}

.vm-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--gray-50);
}

.vm-header__logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 0, var(--color-accent), transparent 55%),
    linear-gradient(145deg, var(--gray-900), var(--color-surface));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.vm-header__logo-icon {
  color: var(--gray-50);
  font-size: 1.1rem;
}

.vm-header__brand-text {
  display: flex;
  flex-direction: column;
}

.vm-header__brand-name {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.vm-header__brand-tagline {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Navigation */
.vm-header__nav {
  margin-left: auto;
}

.vm-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.vm-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
}

.vm-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  transition: width var(--transition-normal);
}

.vm-header__nav-link:hover,
.vm-header__nav-link:focus-visible {
  color: var(--gray-50);
}

.vm-header__nav-link:hover::after,
.vm-header__nav-link:focus-visible::after {
  width: 100%;
}

.vm-header__nav-item--accent .vm-header__nav-link {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 184, 0, 0.6);
  background: radial-gradient(circle at top left, var(--color-accent-soft), transparent 60%);
  color: var(--gray-50);
}

.vm-header__nav-item--accent .vm-header__nav-link::after {
  display: none;
}

.vm-header__nav-item--accent .vm-header__nav-link:hover,
.vm-header__nav-item--accent .vm-header__nav-link:focus-visible {
  background: var(--color-accent);
  color: #111827;
}

/* Mobile toggle */
.vm-header__toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  color: var(--gray-50);
}

.vm-header__toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--gray-50);
  transition: transform var(--transition-normal),
    opacity var(--transition-normal),
    width var(--transition-normal);
}

.vm-header__toggle.is-active .vm-header__toggle-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.vm-header__toggle.is-active .vm-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.vm-header__toggle.is-active .vm-header__toggle-bar:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Mobile layout */
@media (max-width: 768px) {
  .vm-header__inner {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .vm-header__brand-tagline {
    display: none;
  }

  .vm-header__toggle {
    display: inline-flex;
  }

  .vm-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: rgba(11, 16, 32, 0.98);
    border-bottom: 1px solid var(--color-border-subtle);
    transform-origin: top;
  }

  .vm-header__nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-3) var(--space-4) var(--space-4);
    gap: var(--space-2);
  }

  .vm-header__nav-list.is-open {
    display: flex;
  }

  .vm-header__nav-link {
    padding: 0.55rem 0.25rem;
  }

  .vm-header__nav-item--accent .vm-header__nav-link {
    width: 100%;
    justify-content: center;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .vm-header__toggle-bar,
  .vm-header__nav-link::after {
    transition: none;
  }
}