:root {
  --ease-suave: cubic-bezier(.25, .8, .25, 1);
  --duracion: .6s;
}

/* ---------- 1. HERO: entrada al cargar la página ---------- */

@keyframes subir {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

:is(.section-banner, .section-banner-esp, .section-banner-est) > .container > * {
  animation: subir var(--duracion) var(--ease-suave) both;
}
:is(.section-banner, .section-banner-esp, .section-banner-est) > .container > :nth-child(1) { animation-delay: .05s; }
:is(.section-banner, .section-banner-esp, .section-banner-est) > .container > :nth-child(2) { animation-delay: .15s; }
:is(.section-banner, .section-banner-esp, .section-banner-est) > .container > :nth-child(3) { animation-delay: .25s; }

/* Panel flotante (Portal / WhatsApp / Teléfonos) */
.section-banner > ul {
  animation: subir var(--duracion) var(--ease-suave) .4s both;
}

/* ---------- 2. REVEAL AL HACER SCROLL ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--duracion) var(--ease-suave),
              transform var(--duracion) var(--ease-suave);
  transition-delay: var(--d, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Bloques imagen + texto: entran desde su lado (solo en desktop;
   en mobile las columnas van apiladas y suben como el resto) */
@media (min-width: 992px) {
  .reveal.reveal-izq { transform: translateX(-24px); }
  .reveal.reveal-der { transform: translateX(24px); }
  .reveal.reveal-izq.is-visible,
  .reveal.reveal-der.is-visible { transform: none; }
}

/* styles.css deja los .medico-item corridos 8px hasta que se les agregue
   la clase .visible (que antes hacía especialidades.js). Lo neutralizamos. */
.medico-item:not(.reveal) {
  transform: none;
}

/* ---------- 3. MICRO-INTERACCIONES ---------- */

/* Botones */
.boton-azul,
.hc-section .whatsapp-btn {
  transition: background-color .25s ease, transform .25s var(--ease-suave), box-shadow .25s ease;
}

.boton-azul:hover,
.hc-section .whatsapp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 57, 125, .18);
}

.boton-azul:active,
.hc-section .whatsapp-btn:active {
  transform: none;
  box-shadow: none;
}

/* Iconos de accesos rápidos (hero en desktop y bloque en mobile) */
.section-banner .nav-link svg,
main .d-lg-none .nav-link svg {
  transition: transform .3s var(--ease-suave);
}

.section-banner .nav-link:hover svg,
main .d-lg-none .nav-link:hover svg {
  transform: translateY(-2px);
}

/* Filas de contacto */
.hc-section .info-row {
  transition: background-color .25s ease;
}

/* Preguntas frecuentes: Bootstrap ya anima la apertura */
.accordion-item {
  transition: box-shadow .3s ease,
              opacity var(--duracion) var(--ease-suave) var(--d, 0s),
              transform var(--duracion) var(--ease-suave) var(--d, 0s);
}

.accordion-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

/* Logos de coberturas */
main section.my-5.py-5 .d-lg-flex img {
  transition: transform .3s var(--ease-suave);
}

main section.my-5.py-5 .d-lg-flex img:hover {
  transform: scale(1.04);
}

/* Botón flotante de WhatsApp y volver arriba (hover más suave) */
.whatsapp-float {
  transition: transform .3s var(--ease-suave), background-color .25s ease;
}

.whatsapp-float:hover {
  transform: scale(1.05);
}

/* ---------- 4. ACCESIBILIDAD ---------- */

@media (prefers-reduced-motion: reduce) {
  :is(.section-banner, .section-banner-esp, .section-banner-est) > .container > *,
  .section-banner > ul {
    animation: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .boton-azul:hover,
  .hc-section .whatsapp-btn:hover,
  .section-banner .nav-link:hover svg,
  main .d-lg-none .nav-link:hover svg,
  main section.my-5.py-5 .d-lg-flex img:hover,
  .whatsapp-float:hover {
    transform: none;
  }
}
