/* Header styles for Homeapplinex */

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

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

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

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

.ha-header__logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 0.75rem;
  background: radial-gradient(circle at 30% 20%, #34d399 0, #10b981 40%, #0f766e 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.4);
  font-size: 1.1rem;
}

.ha-header__logo-text {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: #0b1120;
}

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

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

.ha-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
  text-decoration: none;
  padding: 0.35rem 0;
}

.ha-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #0ea5e9);
  transition: width 0.18s ease-out;
}

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

.ha-header__nav-link:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 4px;
  border-radius: 999px;
}

.ha-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ha-header__action-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background-color: #0f172a;
  color: #e5f9f3;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: background-color 0.16s ease-out, box-shadow 0.16s ease-out, transform 0.1s ease-out;
}

.ha-header__action-link--cart i {
  font-size: 0.9rem;
}

.ha-header__action-link:hover {
  background-color: #0b1120;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
  transform: translateY(-1px);
}

.ha-header__action-link:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}

.ha-header__action-link:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 3px;
}

.ha-header__action-label {
  white-space: nowrap;
}

/* Mobile toggle */

.ha-header__toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 0.25rem;
  margin: 0;
  cursor: pointer;
  border-radius: 999px;
}

.ha-header__toggle:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 3px;
}

.ha-header__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background-color: #0f172a;
  transition: transform 0.16s ease-out, opacity 0.16s ease-out, background-color 0.16s ease-out;
}

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

/* Toggle active state (controlled via JS by adding .is-open to .ha-header) */

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

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

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

/* Mobile layout */

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

  .ha-header__toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .ha-header__nav {
    position: fixed;
    inset-block-start: 56px;
    inset-inline: 0;
    background-color: rgba(15, 23, 42, 0.96);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  }

  .ha-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1rem 1rem;
    gap: 0.35rem;
  }

  .ha-header__nav-link {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    color: #e5f9f3;
  }

  .ha-header__nav-link::after {
    display: none;
  }

  .ha-header__nav-link:hover,
  .ha-header__nav-link:focus-visible {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(14, 165, 233, 0.16));
    outline-color: #a5f3fc;
  }

  .ha-header.is-open .ha-header__nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .ha-header__actions {
    margin-left: 0.25rem;
  }

  .ha-header__action-label {
    display: none;
  }
}

/* Small screens tweaks */

@media (max-width: 480px) {
  .ha-header__logo-text {
    font-size: 1rem;
  }

  .ha-header__logo-mark {
    width: 32px;
    height: 32px;
  }
}
