/* =========================================================
   Footer
   (usa las variables definidas en styles/styles.css)
   ========================================================= */

.footer {
  --sky-light: #8dc0f5;
  --line: rgba(255, 255, 255, 0.14);
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding: 0 var(--pad-x);
  scroll-margin-top: var(--header-h);
}
.footer__inner {
  max-width: 1500px;
  margin: 0 auto;
}

.footer a {
  transition:
    color 0.3s ease,
    background 0.3s ease,
    transform 0.35s var(--ease),
    border-color 0.3s ease;
}

/* ---------- Franja CTA ---------- */
.footer__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px 48px;
  padding: clamp(40px, 5vw, 72px) 0;
  border-bottom: 1px solid var(--line);
}
.footer__cta-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
}
.footer__cta-text {
  margin: 12px 0 0;
  max-width: 34em;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
}

.footer__wa {
  position: relative;
  overflow: hidden;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 20px 30px;
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  letter-spacing: 0.02em;
}
.footer__wa:hover {
  background: #4a8bd0;
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}
.footer__wa::before {
  /* brillo */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.7s var(--ease);
}
.footer__wa:hover::before {
  left: 130%;
}

.footer__wa-icon {
  position: relative;
  width: 26px;
  height: 26px;
  flex: none;
}
.footer__wa-icon::after {
  /* pulso */
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  animation: ft-ping 2.4s ease-out infinite;
}
@keyframes ft-ping {
  0% {
    transform: scale(0.7);
    opacity: 0.7;
  }
  80%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ---------- Columnas ---------- */
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.1fr 1.2fr;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(36px, 5vw, 72px) 0;
}

.footer__logo {
  width: clamp(72px, 7vw, 96px);
  aspect-ratio: 1;
  padding: 6px;
  background: var(--white);
  border-radius: 12px;
}
.footer__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.footer__logo:empty {
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

.footer__name {
  margin: 18px 0 0;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.footer__about {
  margin: 10px 0 0;
  max-width: 24em;
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.72);
}

.footer__social {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.footer__social a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}
.footer__social a:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-4px);
}
.footer__social svg {
  width: 20px;
  height: 20px;
}

.footer__heading {
  margin: 0 0 20px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-light);
}
.footer__links {
  display: grid;
  gap: 12px;
}
.footer__links a {
  position: relative;
  display: inline-block;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}
.footer__links a::after {
  /* subrayado animado */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--sky-light);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.footer__links a:hover {
  color: var(--white);
}
.footer__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer__contact {
  display: grid;
  gap: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}
.footer__contact li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.footer__contact svg {
  flex: none;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  color: var(--sky-light);
}
.footer__contact a:hover {
  color: var(--sky-light);
}

/* ---------- Barra inferior ---------- */
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 24px 0 28px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer__legal a:hover {
  color: var(--white);
}

/* ---------- Botón volver arriba ---------- */
.to-top {
  position: fixed;
  right: clamp(16px, 2.4vw, 32px);
  bottom: clamp(16px, 2.4vw, 32px);
  z-index: 40;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(23, 54, 95, 0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease),
    visibility 0s linear 0.45s,
    background 0.3s ease;
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.to-top:hover {
  background: var(--navy);
  outline: 2px solid var(--white);
  transform: translateY(-4px);
}
.to-top svg {
  width: 22px;
  height: 22px;
}

/* ---------- Animación de entrada / salida ---------- */
.js [data-ft] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.4s ease,
    transform 0.4s var(--ease);
  transition-delay: 0s;
}
.js .footer.is-in [data-ft] {
  opacity: 1;
  transform: none;
  transition-duration: 0.8s, 0.9s;
  transition-delay: var(--d, 0s);
}
.js .footer.is-in .footer__social a {
  transition-delay: 0s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .footer__cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
  .footer__wa {
    width: 100%;
    justify-content: center;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer__wa-icon::after {
    animation: none;
  }
}