/* ===== animaciones.css - Licencia Ambiental Querétaro ===== */
/* Basado en el skill animar-interfaz */

:root {
  --color-primario: #064e3b;
  --color-secundario: #2B59C3;
  --color-acento: #2B59C3;
  --color-azul: #2B59C3;
  --color-boton: #253C78;
  --color-fondo: #f8fafc;
  --color-tarjeta: #ffffff;
  --color-texto: #1e293b;
}

/* --- Fade-in al hacer scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Hover en tarjetas --- */
.tarjeta {
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tarjeta:hover {
  transform: translateY(-4px);
  border-color: var(--color-primario);
  box-shadow: 0 10px 24px -12px rgba(6, 78, 59, 0.35);
}

/* --- Hover en botones --- */
.btn {
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}

/* --- Pulso del botón flotante de WhatsApp --- */
.whatsapp-flotante {
  position: relative;
}
.whatsapp-flotante::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  opacity: .55;
  animation: pulso 2.4s ease-out infinite;
  z-index: -1;
}
@keyframes pulso {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* --- Acordeón de FAQs y Servicios --- */
.faq-item {
  border-bottom: 1px solid #e2e8f0;
}
.faq-pregunta {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  font-weight: 700;
  color: #064e3b;
  font-size: 1.05rem;
}
.faq-pregunta .icono {
  transition: transform .25s ease;
  color: var(--color-secundario);
  font-size: 1.3rem;
  line-height: 1;
}
.faq-item.abierto .faq-pregunta .icono {
  transform: rotate(45deg);
}
.faq-respuesta {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}
.faq-item.abierto .faq-respuesta {
  max-height: 500px;
  padding-bottom: 18px;
}

/* --- Barra de progreso de fases --- */
.fases {
  position: relative;
  padding-left: 32px;
}
.fases .linea-base {
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(6, 78, 59, 0.15);
}
.fases .linea-progreso {
  position: absolute;
  left: 9px;
  top: 6px;
  width: 2px;
  height: 0%;
  background: var(--color-acento);
  transition: height 1.2s ease;
}
.fase {
  position: relative;
}
.fase::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-fondo);
  border: 2px solid rgba(6, 78, 59, 0.25);
  transition: border-color .4s ease, background .4s ease;
}
.fase.activa::before {
  border-color: var(--color-acento);
  background: var(--color-acento);
}

/* --- Subrayado animado en menú --- */
nav a {
  position: relative;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: var(--color-secundario);
  transition: width .25s ease;
}
nav a:hover::after {
  width: 100%;
}

/* --- Barra CTA fija al hacer scroll --- */
.barra-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: #022c22;
  color: #ffffff;
  border-top: 2px solid var(--color-secundario);
  transform: translateY(100%);
  transition: transform .3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.barra-cta.visible {
  transform: translateY(0);
}

/* --- Shimmer al cargar imágenes --- */
.img-wrap.cargando::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  z-index: 2;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Confirmación animada de formulario --- */
.confirmacion-envio {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
.confirmacion-envio.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* --- Accesibilidad: respeta "reducir movimiento" --- */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .whatsapp-flotante::before { animation: none; display: none; }
  .tarjeta, .btn, .faq-respuesta, .faq-pregunta .icono,
  .fases .linea-progreso, .fase::before, nav a::after,
  .barra-cta, .img-wrap.cargando::before, .confirmacion-envio {
    transition: none;
    animation: none;
  }
}
