/* Header styles for Eco Shop PL */

.eco-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

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

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

.eco-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  color: var(--color-text);
}

.eco-header__logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 40% 60% 55% 45%;
  background: radial-gradient(circle at 30% 20%, #e0f2e7 0, #e0f2e7 40%, #3c7f5a 100%);
  box-shadow: var(--shadow-sm);
}

.eco-header__logo-text {
  font-family: var(--font-family-accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: var(--font-size-sm);
}

/* Nav */
.eco-header__nav {
  display: none;
}

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

.eco-header__nav-item {
  list-style: none;
}

.eco-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.1rem;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

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

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

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

.eco-header__nav-item--accent .eco-header__nav-link--accent {
  padding-inline: 0.95rem;
  padding-block: 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background-color: var(--gray-50);
}

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

.eco-header__nav-item--accent .eco-header__nav-link--accent:hover,
.eco-header__nav-item--accent .eco-header__nav-link--accent:focus-visible {
  border-color: var(--color-primary);
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

/* Actions */
.eco-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.eco-header__icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  color: var(--color-text);
  background-color: var(--color-surface);
  transition: background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}

.eco-header__icon-link:hover,
.eco-header__icon-link:focus-visible {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.eco-header__cart-count {
  position: absolute;
  top: -0.1rem;
  right: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: #fff;
  font-size: var(--font-size-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0.3rem;
  box-shadow: var(--shadow-sm);
}

/* Mobile toggle */
.eco-header__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background-color: var(--color-surface);
  color: var(--color-text);
  padding: 0;
  transition: background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}

.eco-header__toggle-bar {
  width: 16px;
  height: 2px;
  border-radius: var(--radius-full);
  background-color: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.eco-header__toggle:hover,
.eco-header__toggle:focus-visible {
  border-color: var(--color-primary);
  background-color: var(--color-primary-soft);
  box-shadow: var(--shadow-sm);
}

/* Open state */
.eco-header--menu-open .eco-header__toggle-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

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

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

/* Mobile nav behavior: visible by default without JS; JS only enhances */
@media (max-width: 767.98px) {
  .eco-header__inner {
    gap: var(--space-4);
  }

  .eco-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem var(--container-padding-x) 0.9rem;
  }

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

  .eco-header__nav-item--accent .eco-header__nav-link--accent {
    width: 100%;
    justify-content: center;
  }

  /* No-JS baseline: menu visible; JS adds .eco-header--js and controls visibility */
  .eco-header--js .eco-header__nav {
    display: none;
  }

  .eco-header--js.eco-header--menu-open .eco-header__nav {
    display: block;
  }
}

@media (min-width: 768px) {
  .eco-header__toggle {
    display: none;
  }

  .eco-header__nav {
    display: block;
    margin-left: auto;
    margin-right: var(--space-8);
  }

  .eco-header__actions {
    gap: var(--space-6);
  }
}
