/* Header fijo: marca, navegación y CTA. En mobile el menú se despliega. */
.header {
  background-color: hsl(var(--primary) / 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(0 0% 100% / 0.08);
  color: hsl(var(--primary-foreground));
  inset-inline: 0;
  position: fixed;
  top: 0;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
  z-index: 60;
}

/* Con el menú abierto el fondo pasa a opaco: si no, el hero se ve por detrás */
.header.is-scrolled,
.header:has(.header__menu.is-open) {
  background-color: hsl(var(--primary) / 0.97);
  box-shadow: 0 12px 30px -22px hsl(0 0% 0% / 0.9);
}

.header__inner {
  align-items: center;
  display: flex;
  gap: 1rem;
  height: 4rem;
  justify-content: space-between;
}

.header__brand {
  align-items: center;
  display: flex;
  transition: opacity 0.2s ease;
}

.header__brand:hover {
  opacity: 0.85;
}

/* ── Navegación ───────────────────────────────────────────────────────────── */

.header__nav {
  align-items: center;
  display: none;
  gap: 1.75rem;
}

.header__link {
  color: hsl(var(--primary-foreground) / 0.72);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease;
}

.header__link::after {
  background-color: hsl(var(--accent));
  bottom: -0.4rem;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  width: 100%;
}

.header__link:hover {
  color: hsl(var(--primary-foreground));
}

.header__link:hover::after {
  transform: scaleX(1);
}

.header__cta {
  display: none;
  min-height: 2.5rem;
  padding-inline: 1rem;
}

/* ── Botón hamburguesa ────────────────────────────────────────────────────── */

.header__toggle {
  align-items: center;
  border: 1px solid hsl(0 0% 100% / 0.14);
  border-radius: 0.65rem;
  color: hsl(var(--primary-foreground));
  display: flex;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.header__toggle svg {
  height: 1.15rem;
  width: 1.15rem;
}

.header__toggle .icon-close,
.header__toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.header__toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* ── Menú desplegable (mobile) ────────────────────────────────────────────── */

.header__menu {
  border-top: 1px solid hsl(0 0% 100% / 0.08);
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding-block: 0.75rem 1.25rem;
}

.header__menu.is-open {
  animation: fade-slide-in 0.2s ease both;
  display: flex;
}

.header__menu .header__link {
  border-radius: 0.6rem;
  color: hsl(var(--primary-foreground) / 0.85);
  font-size: 0.95rem;
  padding: 0.7rem 0.5rem;
}

.header__menu .header__link::after {
  display: none;
}

.header__menu .header__link:hover {
  background-color: hsl(0 0% 100% / 0.06);
}

.header__menu .btn {
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .header__nav,
  .header__cta {
    display: inline-flex;
  }

  .header__toggle {
    display: none;
  }

  .header__menu {
    display: none !important;
  }
}
