/* Header component - KitchenViaPL */

.kv-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.kv-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Brand */

.kv-header__brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.kv-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.kv-header__logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, #facc6b 0, #f5a623 26%, #b8831d 56%, #1f3428 100%);
  position: relative;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.kv-header__logo-mark::before,
.kv-header__logo-mark::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.kv-header__logo-mark::after {
  inset: 35% 28% 18% 28%;
  border-width: 0 0 2px 0;
}

.kv-header__logo-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.kv-header__logo-primary {
  font-family: "Playfair Display", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #111827;
}

.kv-header__logo-tagline {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

/* Navigation */

.kv-header__nav {
  flex: 1 1 auto;
}

.kv-header__nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.kv-header__nav-list li {
  margin: 0;
}

.kv-header__nav-item--accent {
  margin-left: 0.5rem;
}

.kv-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.94rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kv-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1f3428, #b8831d);
  transition: width 0.18s ease-out;
}

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

.kv-header__nav-link:hover,
.kv-header__nav-link:focus-visible {
  color: #111827;
}

.kv-header__nav-link:focus-visible {
  outline: 2px solid #1f3428;
  outline-offset: 4px;
}

.kv-header__nav-link--accent {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 52, 40, 0.16);
  background: linear-gradient(135deg, #1f3428, #314f3c);
  color: #f9fafb;
}

.kv-header__nav-link--accent::after {
  display: none;
}

.kv-header__nav-link--accent:hover,
.kv-header__nav-link--accent:focus-visible {
  background: linear-gradient(135deg, #18271f, #283f32);
  border-color: rgba(31, 52, 40, 0.4);
  color: #ffffff;
}

/* Actions */

.kv-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kv-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(148, 163, 184, 0.6);
  background-color: #f9fafb;
  color: #111827;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.1s ease;
}

.kv-header__icon-link:hover,
.kv-header__icon-link:focus-visible {
  background-color: #e5e7eb;
  border-color: #1f3428;
  color: #111827;
  transform: translateY(-1px);
}

.kv-header__icon-link:focus-visible {
  outline: 2px solid #1f3428;
  outline-offset: 2px;
}

.kv-header__cart-count {
  position: absolute;
  top: -0.25rem;
  right: -0.15rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.15rem;
  border-radius: 999px;
  background: #b45309;
  color: #f9fafb;
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Toggle (mobile) */

.kv-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.22rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background-color: #f9fafb;
  cursor: pointer;
}

.kv-header__toggle-bar {
  width: 1.25rem;
  height: 2px;
  border-radius: 999px;
  background-color: #111827;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.kv-header__toggle:focus-visible {
  outline: 2px solid #1f3428;
  outline-offset: 2px;
}

.kv-header__toggle--open .kv-header__toggle-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.kv-header__toggle--open .kv-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.kv-header__toggle--open .kv-header__toggle-bar:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Mobile layout */

@media (max-width: 768px) {
  .kv-header__inner {
    padding-inline: 1rem;
  }

  .kv-header__logo-tagline {
    display: none;
  }

  .kv-header__toggle {
    display: inline-flex;
  }

  .kv-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    transform-origin: top;
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
    transition: transform 0.16s ease-out, opacity 0.16s ease-out, visibility 0.16s ease-out;
  }

  .kv-header__nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.25rem 0.75rem;
  }

  .kv-header__nav-item--accent {
    margin-left: 0;
  }

  .kv-header__nav-link,
  .kv-header__nav-link--accent {
    width: 100%;
    padding-block: 0.65rem;
  }

  .kv-header__nav-link--accent {
    justify-content: center;
  }

  .kv-header__nav--closed {
    transform: scaleY(0.9);
    opacity: 0;
    visibility: hidden;
  }
}

/* Medium screens and up */

@media (min-width: 769px) {
  .kv-header__nav {
    display: block !important;
  }

  .kv-header__nav--closed {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .kv-header,
  .kv-header__nav,
  .kv-header__toggle-bar {
    transition: none !important;
  }
}
