:root {
  --header-bg: #000;
  --text-light: #fff;
  --text-muted: #ccc;
  --font-size-lg: 3rem;
  --font-size-sm: 1.5rem;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
}

/* === HEADER BASE === */
.header {
  background: var(--header-bg);
  color: var(--text-light);
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: all var(--transition-smooth);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  height: auto;
  transition: padding var(--transition-smooth), height var(--transition-smooth);
  background: var(--header-bg);
}

.header-left {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

.header-title {
  font-family: 'Playfair Display', serif;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.site-title {
  font-size: var(--font-size-lg);
  font-weight: bold;
  color: var(--text-light);
  text-decoration: none;
  transition: font-size var(--transition-smooth);
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  font-weight: 400;
  font-size: var(--font-size-medium);
  text-transform: uppercase;
  text-decoration: none;
}

.hamburger {
  font-size: var(--font-size-heading-medium);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
}

/* === NAVIGATION === */
.header-nav-wrapper {
  max-height: 4rem;
  overflow: hidden;
  transition: all var(--transition-smooth);
  opacity: 1;
  transform: translateY(0);
  background: var(--header-bg);
}

.header-nav {
  text-align: center;
  padding: 0;
}

.nav-links {
  list-style: none;
  display: inline-flex;
  gap: 2rem;
  padding: 0;
  margin: 0.5rem 0;
  font-size: var(--font-size-small);
  text-transform: uppercase;
}

.header-divider {
  height: 1px;
  background: var(--text-muted);
  border: none;
  margin: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

/* === SCROLL BEHAVIOR === */
.header-scrolled .site-title {
  font-size: var(--font-size-sm);
}

.header-scrolled .header-top {
  padding-top: 0;
  padding-bottom: 0;
}

.header-scrolled .header-nav-wrapper {
  max-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.header-scrolled .header-divider {
  opacity: 0;
  transform: translateY(-0.5rem);
  pointer-events: none;
  background-color: var(--header-bg);
}

/* === MOBILE MENU === */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--header-bg);
  padding: 2rem 1.5rem 1rem;
  z-index: 999;
  width: 100%;
  transition: max-height var(--transition-smooth),
    opacity var(--transition-fast);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu li {
  margin-bottom: 0.5rem;
}

.mobile-menu a {
  color: var(--text-light);
  text-decoration: none;
  font-size: --var(font-size-base);
  text-transform: uppercase;
}

.mobile-menu-divider {
  border: none;
  border-top: 1px solid var(--text-muted);
  margin: 1.5rem 0 1rem;
}

.mobile-menu-secondary a {
  font-size: var(--font-size-medium);
  text-transform: uppercase;
  font-style: italic;
  font-weight: normal;
  color: var(--text-muted);
}

.account-dropdown {
  position: relative;
}

.account-dropdown__trigger {
  background: none;
  border: none;
  padding: 0;
  text-transform: uppercase;
  cursor: pointer;
  font: inherit; /* same font/size as Newsletter */
}

.account-dropdown__trigger:hover,
.account-dropdown__trigger:focus {
  text-decoration: underline; /* same hover treatment as link-hover-underline */
}

.account-dropdown__menu {
  position: absolute;
  right: 0;
  background: var(--header-bg);
  border: 1px solid var(--text-muted);
  display: none;
  flex-direction: column;
  min-width: 12rem;
  z-index: 1001;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.account-dropdown__menu a {
  color: var(--text-light);
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
}

.account-dropdown__menu a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.account-dropdown.open .account-dropdown__menu,
.account-dropdown:hover .account-dropdown__menu {
  display: flex;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--header-bg);
  border: 1px solid var(--text-muted);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  width: 16rem;
  z-index: 1001;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.search-dropdown input {
  background: black;
  border: 1px solid var(--text-muted);
  color: var(--text-light);
  padding: 0.4rem;
  font-size: 0.9rem;
}

.autocomplete-header {
  font-weight: 500;
  font-size: 1.2rem; /* Slightly larger */
  color: var(--text-muted);
  padding: 0.5rem 0.5rem 0.25rem;
  text-transform: uppercase;
  border-top: 1px solid var(--text-muted);
  cursor: default; /* Prevents pointer cursor */
  pointer-events: none; /* Disables hover/click */
  background-color: var(--header-bg);
}

.autocomplete-results li:hover:not(.autocomplete-header) {
  background-color: var(--text-muted);
}

.autocomplete-results li:first-child.autocomplete-header {
  border-top: none;
}

.autocomplete-results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
}

.autocomplete-results li {
  padding: 0.3rem 0.5rem;
  color: var(--text-light);
  cursor: pointer;
}

.autocomplete-results li:hover {
  background-color: var(--color-subtle-text);
}

.search-wrapper.open .search-dropdown {
  display: flex;
}

/* === RESPONSIVE === */
@media (max-width: 54rem) {
  .header-top {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .header-right {
    margin-top: 0.5rem;
  }

  .site-title {
    margin: 0.5rem 0;
  }
}
