/* Header styles for BackpackTravelHub */

.bth-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(90deg, rgba(249, 250, 251, 0.92), rgba(224, 242, 254, 0.92));
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.bth-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);
}

/* Brand */
.bth-header__brand {
  display: flex;
  align-items: center;
}

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

.bth-header__logo-link:hover {
  color: inherit;
}

.bth-header__logo-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, var(--color-sand), var(--color-primary-soft));
  box-shadow: var(--shadow-md);
  color: var(--color-primary);
}

.bth-header__logo-mark i {
  font-size: 1.1rem;
}

.bth-header__text {
  display: flex;
  flex-direction: column;
}

.bth-header__site-name {
  font-weight: 700;
  font-size: var(--font-size-lg);
  letter-spacing: -0.03em;
}

.bth-header__tagline {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
}

/* Toggle (mobile) */
.bth-header__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background-color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  color: var(--gray-700);
  box-shadow: var(--shadow-xs);
}

.bth-header__toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.bth-header__toggle-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.bth-header__toggle-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background-color: var(--gray-700);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.bth-header__toggle-text {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Primary nav */
.bth-header__nav {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(224, 242, 254, 0.98));
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
  transform-origin: top;
  transform: scaleY(1);
}

ul.bth-header__nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.bth-header__nav-item {
  display: block;
}

.bth-header__nav-link,
.bth-header__cta {
  display: block;
  padding: 0.65rem 0.25rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.bth-header__nav-link {
  color: var(--gray-700);
}

.bth-header__nav-link:hover {
  color: var(--color-primary);
}

.bth-header__nav-item--highlight {
  margin-top: var(--space-1);
}

.bth-header__cta {
  text-align: center;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-turquoise));
  color: #fff;
  box-shadow: var(--shadow-md);
}

.bth-header__cta:hover {
  color: #fff;
  box-shadow: var(--shadow-lg);
}

/* Mobile behavior: nav is collapsed via JS using a class on header */
@media (max-width: 767px) {
  .bth-header__nav {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition-base), opacity var(--transition-base);
  }

  .bth-header--menu-open .bth-header__nav {
    opacity: 1;
    max-height: 320px;
  }

  .bth-header--menu-open .bth-header__toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .bth-header--menu-open .bth-header__toggle-line:nth-child(2) {
    opacity: 0;
  }

  .bth-header--menu-open .bth-header__toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

/* Desktop layout */
@media (min-width: 768px) {
  .bth-header__inner {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }

  .bth-header__toggle {
    display: none;
  }

  .bth-header__nav {
    position: static;
    border-bottom: none;
    background: transparent;
  }

  ul.bth-header__nav-list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-5);
    padding: 0;
  }

  .bth-header__nav-link,
  .bth-header__cta {
    padding: 0.3rem 0;
  }

  .bth-header__nav-link {
    position: relative;
  }

  .bth-header__nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.3rem;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-turquoise));
    transition: width var(--transition-base);
  }

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

  .bth-header__nav-item--highlight {
    margin-top: 0;
  }

  .bth-header__cta {
    padding: 0.5rem 1.1rem;
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 480px) {
  .bth-header__site-name {
    font-size: 1rem;
  }

  .bth-header__tagline {
    display: none;
  }
}
