/* Header styles for OrganicfFood */

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

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

.of-header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

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

.of-header__logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #e9f7eb 0, #e9f7eb 40%, #3e7b46 41%, #2e5f36 100%);
  box-shadow: 0 8px 18px rgba(23, 52, 29, 0.28);
}

.of-header__logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

.of-header__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: var(--space-6);
}

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

.of-header__nav-link {
  position: relative;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  padding-bottom: 0.1rem;
}

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

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

.of-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.of-header__action-button {
  white-space: nowrap;
}

.of-header__action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile toggle */

button.of-header__toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface);
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

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

.of-header__toggle-bar + .of-header__toggle-bar {
  margin-top: 4px;
}

.of-header__toggle:focus-visible {
  box-shadow: var(--shadow-focus);
}

/* Toggle animation when open */

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

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

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

/* Responsive navigation */

@media (max-width: 880px) {
  .of-header__inner {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

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

  .of-header__nav {
    position: fixed;
    inset: 0 0 auto 0;
    top: 64px;
    background-color: rgba(15, 10, 5, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-4);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-base);
  }

  

  ul.of-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    min-width: min(260px, 100%);
    box-shadow: var(--shadow-medium);
  }

  .of-header__nav-link {
    font-size: var(--font-size-base);
  }

  .of-header__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    margin-top: var(--space-3);
  }

  .of-header__action-button {
    width: 100%;
    justify-content: center;
  }

  /* open state controlled via .of-header__nav--open */
  .of-header__nav--open {
    pointer-events: auto;
    opacity: 1;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .of-header__logo-text {
    font-size: 1.1rem;
  }
}

/* No-JS fallback: show nav inline on small screens as well */

.no-js .of-header__nav {
  position: static;
  opacity: 1;
  pointer-events: auto;
}

.no-js .of-header__toggle {
  display: none;
}
