/* Header styles for Bedroom Decor Hub */

.bdh-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(247, 244, 241, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gray-200);
}

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

/* Branding */
.bdh-header__brand {
  display: flex;
  align-items: center;
}

.bdh-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bdh-header__logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 40% 60% 55% 45%;
  background: radial-gradient(circle at 30% 20%, #fdf5ef 0, #e4c9b6 40%, #c28b6b 100%);
  box-shadow: var(--shadow-subtle);
}

.bdh-header__logo-text {
  color: var(--color-text);
}

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

.bdh-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

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

.bdh-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background-color: var(--color-primary);
  transition: width var(--transition-base);
}

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

.bdh-header__nav-item--cta .bdh-header__nav-link--cta {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-subtle);
}

.bdh-header__nav-item--cta .bdh-header__nav-link--cta::after {
  display: none;
}

.bdh-header__nav-item--cta .bdh-header__nav-link--cta:hover {
  background-color: var(--color-primary-soft);
  box-shadow: var(--shadow-soft);
}

/* Mobile toggle */
.bdh-header__toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-200);
  background-color: #ffffff;
  cursor: pointer;
}

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

.bdh-header__toggle-label {
  font-size: var(--text-sm);
}

.bdh-header__toggle-icon {
  position: relative;
  width: 18px;
  height: 14px;
}

.bdh-header__toggle-icon::before,
.bdh-header__toggle-icon::after,
.bdh-header__toggle-icon span {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background-color: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base), top var(--transition-base), bottom var(--transition-base);
}

.bdh-header__toggle-icon::before {
  top: 0;
}

.bdh-header__toggle-icon::after {
  bottom: 0;
}

/* Helper span for middle line (using pseudo span via ::before in JS-less scenario is tricky, so we use a generated element via ::before/::after only)
   To keep it simple, we simulate three lines with before/after + a middle pseudo in the :before sibling. */
.bdh-header__toggle-icon::before {
  box-shadow: 0 6px 0 0 var(--color-text);
}

/* Open state */
.bdh-header--open .bdh-header__toggle-icon::before {
  box-shadow: none;
  transform: translateY(6px) rotate(45deg);
}

.bdh-header--open .bdh-header__toggle-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* Responsive behavior */
@media (max-width: 768px) {
  .bdh-header__toggle {
    display: inline-flex;
  }

  .bdh-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background-color: rgba(247, 244, 241, 0.98);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    transform-origin: top;
    transform: scaleY(1);
  }

  .bdh-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-4);
    gap: var(--space-3);
  }

  .bdh-header__nav-link {
    width: 100%;
    padding: 0.35rem 0;
    font-size: var(--text-base);
  }

  .bdh-header__nav-item--cta .bdh-header__nav-link--cta {
    width: 100%;
    justify-content: center;
  }

  /* JS-enhanced collapsed state */
  .bdh-header__nav[hidden] {
    display: none;
  }
}

@media (min-width: 769px) {
  .bdh-header__nav {
    position: static;
  }
}
