/* =============================================
   NAVBAR — WEPY.AI  v3
   Layout: logo izq · links centro · CTA der
   Fondo: #0F172A · Sticky · Scroll-aware
   ============================================= */


/* ─────────────────────────────────────────────
   KEYFRAMES
   ───────────────────────────────────────────── */
@keyframes nb-logo-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1);   }
}

@keyframes nb-link-left {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0);     }
}

@keyframes nb-link-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0);    }
}

@keyframes nb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes nb-glow-pulse {
  from { filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.20)); }
  to   { filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.35)); }
}

@keyframes nb-mobile-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0);    }
}


/* ─────────────────────────────────────────────
   BASE
   ───────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 68px;
  background: #0F172A;
  z-index: 1000;
  transition:
    background             400ms ease,
    backdrop-filter        400ms ease,
    -webkit-backdrop-filter 400ms ease,
    box-shadow             400ms ease;
}

/* Z-index bajo cuando hay modal/drawer encima */
.navbar--behind-modal {
  z-index: 10;
}

/* Borde inferior gradiente (aparece al hacer scroll) */
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(37, 99, 235, 0.3) 0%,
    rgba(20, 184, 166, 0.3) 100%
  );
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}

.navbar.is-scrolled {
  background: rgba(15, 23, 42, 0.80);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.navbar.is-scrolled::after {
  opacity: 1;
}


/* ─────────────────────────────────────────────
   BARRA DE PROGRESO DE SCROLL
   ───────────────────────────────────────────── */
.navbar__progress {
  position: fixed;
  top: 68px;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #2563EB 0%, #14B8A6 100%);
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.navbar__progress.is-visible {
  opacity: 1;
}


/* ─────────────────────────────────────────────
   INNER WRAPPER
   ───────────────────────────────────────────── */
.navbar__inner {
  max-width: var(--container-max);
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--container-px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}


/* ─────────────────────────────────────────────
   LOGO (extremo izquierdo)
   ───────────────────────────────────────────── */
.navbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  outline-offset: 4px;
  text-decoration: none;
  animation: nb-logo-in 400ms ease-out both;
}

.navbar__logo-img {
  display: block;
  height: 34px;
  width: auto;
  object-fit: contain;
  animation: nb-glow-pulse 3s ease-in-out 400ms infinite alternate;
  transition: filter 300ms ease, transform 300ms ease;
}

.navbar__logo:hover .navbar__logo-img {
  filter: drop-shadow(0 0 14px rgba(37, 99, 235, 0.45));
  transform: scale(1.08);
  animation-play-state: paused;
}


/* ─────────────────────────────────────────────
   NAV LINKS — CENTRO (solo desktop)
   ───────────────────────────────────────────── */
.navbar__nav {
  display: none; /* oculto en móvil */
  position: relative;
  align-items: center;
  gap: 0;
}

.navbar__indicator {
  position: absolute;
  top: 50%;
  left: 0;
  height: 32px;
  width: 0;
  background: #1E293B;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(0);
  transition:
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
    width     300ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity   150ms ease;
  z-index: 0;
}

.navbar__indicator.is-visible {
  opacity: 1;
}

.navbar__link {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  outline-offset: 4px;
  /* Gradient siempre presente; -webkit-text-fill-color lo controla */
  background: linear-gradient(90deg, #2563EB 0%, #14B8A6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.70);
  color: rgba(255, 255, 255, 0.70);
  transition: -webkit-text-fill-color 200ms ease;
  /* Animación de entrada asignada por JS */
  animation: nb-fade-in 350ms ease backwards;
}

.navbar__link.is-active,
.navbar__link:hover {
  -webkit-text-fill-color: transparent; /* revela el gradiente */
}


/* ─────────────────────────────────────────────
   ZONA DERECHA: CTA + TOGGLE
   ───────────────────────────────────────────── */
.navbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Botón Cotizar ─── */
.navbar__cta {
  display: none; /* solo desktop */
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  background: #FFFFFF;
  color: #111827;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  animation: nb-fade-in 350ms ease both;
  transition:
    background 250ms ease,
    color      250ms ease,
    box-shadow 250ms ease;
  /* transform controlado por JS (efecto magnético) */
}

.navbar__cta:hover {
  background: linear-gradient(90deg, #2563EB 0%, #14B8A6 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.30);
}

.navbar__cta:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 3px;
}

/* ── Hamburguesa ─── */
.navbar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: var(--space-2);
  color: rgba(255, 255, 255, 0.70);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.navbar__toggle:hover { color: #ffffff; }

.navbar__toggle:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

.navbar__icon--close { display: none; }
.navbar__toggle[aria-expanded="true"] .navbar__icon--menu  { display: none; }
.navbar__toggle[aria-expanded="true"] .navbar__icon--close { display: block; }


/* ─────────────────────────────────────────────
   MENÚ MÓVIL
   ───────────────────────────────────────────── */
.navbar__mobile {
  position: absolute;
  top: 68px;
  left: 0;
  width: 100%;
  background: #0F172A;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px var(--container-px) 24px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 250ms ease-out, transform 250ms ease-out;
}

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

.navbar__mobile-link {
  display: block;
  padding: 14px 0;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: color var(--transition-fast);
}

.navbar__mobile-link:last-of-type { border-bottom: none; }

.navbar__mobile-link:hover,
.navbar__mobile-link.is-active { color: #ffffff; }

.navbar__mobile-link.is-animated {
  animation: nb-mobile-in 300ms ease-out both;
}

.navbar__mobile-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
}

.navbar__mobile-footer.is-animated {
  animation: nb-mobile-in 300ms ease-out both;
}

.navbar__mobile-cta {
  padding: 10px 24px;
  background: linear-gradient(90deg, #2563EB 0%, #14B8A6 100%);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 150ms ease;
}

.navbar__mobile-cta:hover { opacity: 0.88; }


/* ─────────────────────────────────────────────
   DESKTOP ≥ 1024px
   ───────────────────────────────────────────── */
@media (min-width: 1024px) {

  .navbar__nav {
    display: flex;
    /* Centro absoluto entre logo y CTA */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    gap: 0;
  }

  .navbar__cta    { display: inline-flex; }
  .navbar__toggle { display: none; }
  .navbar__mobile { display: none; }
}


/* ─────────────────────────────────────────────
   MÓVIL < 1024px
   ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .navbar__logo {
    /* Centrar el logo en móvil */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    /* Sobreescribir la animación (que usa transform) */
    animation: nb-fade-in 400ms ease-out both;
  }
}


/* ─────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .navbar,
  .navbar::after,
  .navbar__link,
  .navbar__cta,
  .navbar__indicator,
  .navbar__mobile,
  .navbar__mobile-link,
  .navbar__mobile-footer,
  .navbar__mobile-cta,
  .navbar__toggle {
    transition: none !important;
    animation: none !important;
  }

  .navbar__logo-img { animation: none; }

  .navbar__logo,
  .navbar__cta,
  .navbar__link { opacity: 1 !important; }
}
