/* ===== Unified site header ===== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.site-header__row--nav {
  border-bottom: 1px solid var(--border, hsl(210, 20%, 85%));
}

.site-header--has-search .site-header__row--nav {
  border-bottom: none;
}

/* Row 2 — search (search-results page) */
.site-header__search-row {
  height: 3.25rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border, hsl(210, 20%, 85%));
  background: rgba(255, 255, 255, 0.97);
}

.site-header__search-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

.site-header__search-inner .sr-search-bar-wrap {
  max-width: 48rem;
  margin: 0 auto;
  position: relative;
  width: 100%;
}

.sr-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-fg, hsl(210, 15%, 45%));
  pointer-events: none;
}

.sr-search-input {
  width: 100%;
  height: 2.5rem;
  padding: 0 5.5rem 0 2.5rem;
  border: 1px solid var(--border, hsl(210, 20%, 85%));
  border-radius: 0.625rem;
  background: var(--muted, hsl(210, 25%, 92%));
  font-size: 0.875rem;
  color: var(--fg, hsl(210, 40%, 18%));
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}

.sr-search-input:focus {
  border-color: var(--primary, hsl(210, 85%, 42%));
  box-shadow: 0 0 0 2px hsla(210, 85%, 42%, 0.15);
  background: var(--card, #fff);
}

.sr-search-go {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  height: 1.875rem;
  padding: 0 0.875rem;
  background: var(--primary, hsl(210, 85%, 42%));
  color: var(--primary-fg, #fff);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: opacity 0.15s;
}

.sr-search-go:hover {
  opacity: 0.9;
}

.sr-header-search-results {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  right: clamp(1rem, 4vw, 3rem);
  top: calc(100% - 0.15rem);
  max-width: 48rem;
  margin: 0 auto;
  background: var(--card, #fff);
  border: 1px solid var(--border, hsl(210, 20%, 85%));
  border-radius: var(--radius, 0.75rem);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 60;
  max-height: 20rem;
  overflow-y: auto;
}

.site-header__inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 clamp(1rem, 4vw, 3rem);
  height: 4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-sizing: border-box;
}

.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-header__right {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 900px) {
  .site-header__right {
    display: flex;
  }
}

.site-header__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-end;
}

.site-header__link {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg, hsl(210, 15%, 45%));
  border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.site-header__link:hover {
  color: var(--fg, hsl(210, 40%, 18%));
  background: var(--muted, hsl(210, 25%, 92%));
}

.site-header__link.is-active {
  color: var(--primary, hsl(210, 85%, 42%));
  font-weight: 600;
}

.site-header__account {
  position: relative;
  flex-shrink: 0;
}

.site-header__account-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg, hsl(210, 15%, 45%));
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
}

.site-header__account-btn:hover,
.site-header__account-btn.open {
  color: var(--fg, hsl(210, 40%, 18%));
  background: var(--muted, hsl(210, 25%, 92%));
}

.site-header__account-btn.open .site-header__chevron {
  transform: rotate(180deg);
}

.site-header__chevron {
  transition: transform 0.2s;
}

.site-header__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary, hsl(210, 85%, 42%));
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

.site-header__account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 11rem;
  background: var(--card, #fff);
  border: 1px solid var(--border, hsl(210, 20%, 85%));
  border-radius: var(--radius, 0.75rem);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 0.375rem 0;
  z-index: 60;
}

.site-header__account-item {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  transition: background 0.15s;
}

.site-header__account-item:hover {
  background: var(--muted, hsl(210, 25%, 92%));
}

.site-header__account-item--danger {
  color: #ef4444;
  font-weight: 600;
}

.site-header__mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--muted-fg, hsl(210, 15%, 45%));
  margin-left: auto;
}

@media (min-width: 900px) {
  .site-header__mobile-toggle {
    display: none;
  }
}

.site-header__mobile-panel {
  border-top: 1px solid var(--border, hsl(210, 20%, 85%));
  background: var(--card, #fff);
  max-height: 80vh;
  overflow-y: auto;
}

.site-header__mobile-user {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border, hsl(210, 20%, 85%));
  font-weight: 600;
  font-size: 0.875rem;
}

.site-header__mobile-section {
  padding: 0.5rem 0;
}

.site-header__mobile-section--account {
  border-top: 1px solid var(--border, hsl(210, 20%, 85%));
}

.site-header__mobile-link {
  display: block;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  transition: background 0.15s;
}

.site-header__mobile-link:hover,
.site-header__mobile-link.is-active {
  background: var(--muted, hsl(210, 25%, 92%));
}

.site-header__mobile-link.is-active {
  color: var(--primary, hsl(210, 85%, 42%));
  font-weight: 600;
}

