/* Header styles for HomeDecorr */

.hd-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--color-background);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(180, 167, 149, 0.25);
}

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

/* Brand */

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

.hd-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
}

.hd-header__logo-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--color-gray-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: var(--font-size-md);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f9f4ed, #e6ddcf);
  box-shadow: var(--shadow-xs);
}

.hd-header__logo-text-group {
  display: flex;
  flex-direction: column;
}

.hd-header__site-name {
  font-family: var(--font-serif);
  font-size: var(--font-size-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hd-header__tagline {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Navigation */

.hd-header__nav {
  margin-left: auto;
}

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

.hd-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
}

.hd-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 1px;
  background-color: var(--color-primary);
  transition: width var(--transition-normal);
}

.hd-header__nav-link:hover,
.hd-header__nav-link:focus-visible {
  color: var(--color-text);
}

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

.hd-header__nav-item--accent .hd-header__nav-link--button {
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  border: 1px solid var(--color-gray-300);
  background-color: var(--color-surface);
}

.hd-header__nav-item--accent .hd-header__nav-link--button:hover,
.hd-header__nav-item--accent .hd-header__nav-link--button:focus-visible {
  background-color: var(--color-gray-100);
  color: var(--color-text);
}

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

/* Actions */

.hd-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: var(--space-8);
}

.hd-header__icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(150, 132, 108, 0.35);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: background-color var(--transition-normal),
              border-color var(--transition-normal),
              box-shadow var(--transition-normal),
              transform var(--transition-fast);
}

.hd-header__icon-link:hover,
.hd-header__icon-link:focus-visible {
  background-color: var(--color-gray-100);
  border-color: var(--color-gray-400);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.hd-header__cart-count {
  position: absolute;
  top: -0.3rem;
  right: -0.2rem;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background-color: var(--color-primary);
  color: var(--color-primary-contrast);
  font-size: var(--font-size-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  box-shadow: var(--shadow-xs);
}

/* Mobile toggle */

.hd-header__toggle {
  display: none;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(150, 132, 108, 0.4);
  background-color: var(--color-surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hd-header__toggle-bar {
  width: 1.15rem;
  height: 1px;
  background-color: var(--color-text);
  border-radius: 999px;
  transition: transform var(--transition-normal),
              opacity var(--transition-normal),
              background-color var(--transition-normal);
}

.hd-header__toggle-bar + .hd-header__toggle-bar {
  margin-top: 0.3rem;
}

.hd-header__toggle.is-open .hd-header__toggle-bar:first-child {
  transform: translateY(0.15rem) rotate(45deg);
}

.hd-header__toggle.is-open .hd-header__toggle-bar:last-child {
  transform: translateY(-0.15rem) rotate(-45deg);
}

/* Mobile layout */

@media (max-width: 900px) {
  .hd-header__inner {
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }

  .hd-header__tagline {
    display: none;
  }

  .hd-header__toggle {
    display: inline-flex;
    flex-direction: column;
  }

  .hd-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background-color: rgba(245, 241, 235, 0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(180, 167, 149, 0.3);
    transform-origin: top;
    transform: scaleY(0.9);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-normal),
                transform var(--transition-normal),
                visibility var(--transition-normal);
  }

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

  .hd-header__nav-item {
    width: 100%;
  }

  .hd-header__nav-link,
  .hd-header__nav-link--button {
    width: 100%;
    padding: 0.65rem 0;
  }

  .hd-header__nav-item--accent .hd-header__nav-link--button {
    justify-content: center;
    margin-top: var(--space-3);
  }

  .hd-header__nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scaleY(1);
  }

  .hd-header__actions {
    margin-left: var(--space-4);
  }
}

@media (max-width: 600px) {
  .hd-header__logo-mark {
    width: 2rem;
    height: 2rem;
    font-size: var(--font-size-sm);
  }

  .hd-header__site-name {
    font-size: var(--font-size-md);
  }

  .hd-header__actions {
    gap: var(--space-3);
  }
}
