/* Animaciones Corporativas y Profesionales */

/* Animaciones de entrada para secciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes borderGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(26, 54, 93, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(26, 54, 93, 0.3);
    }
}

/* Clases de animación */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

/* Animaciones para tarjetas de servicios */
.service-card.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.service-card.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Animaciones para números estadísticos */
.stat-number {
    transition: transform 0.3s ease;
    display: inline-block;
}

.stat-number:hover {
    transform: scale(1.1);
}

/* Animaciones para botones */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 54, 93, 0.4);
}

/* Animaciones para proceso de operación */
.process-step {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.15s);
    opacity: 0;
}

.process-step.animated {
    opacity: 1;
}

.process-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.process-step .step-number {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.process-step:hover .step-number {
    transform: scale(1.1) rotate(5deg);
    background-color: var(--azul-claro);
}

/* Animaciones para testimonios */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
    opacity: 0;
}

.testimonial-card.animated {
    opacity: 1;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.testimonial-image {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover .testimonial-image {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(26, 54, 93, 0.3);
}

/* Animaciones para tarjetas de blog */
.blog-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
    opacity: 0;
}

.blog-card.animated {
    opacity: 1;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.blog-card img {
    transition: transform 0.5s ease;
}

.blog-card:hover img {
    transform: scale(1.05);
}

/* Animaciones para navegación */
nav ul li a {
    position: relative;
    transition: color 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--azul-claro);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

/* Animaciones para el logo */
.logo {
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-image {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover .logo-image {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Animaciones para imágenes */
img {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.about-image,
.coverage-image {
    animation: fadeIn 1s ease forwards;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.about-image:hover,
.coverage-image:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Animaciones para formularios */
.form-group input,
.form-group select,
.form-group textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 54, 93, 0.1);
}

/* Animaciones para secciones */
section {
    animation: fadeIn 0.8s ease forwards;
}

.section-title {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.section-title.animated {
    opacity: 1;
}

.section-subtitle {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.section-subtitle.animated {
    opacity: 1;
}

/* Animación para el hero */
.hero-text-overlay {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.hero-text-overlay.animated {
    opacity: 1;
}

.hero-image {
    animation: fadeIn 1.5s ease forwards;
}

/* Animación para rutas */
.route-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-width 0.3s ease;
    animation: slideInLeft 0.6s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
    opacity: 0;
}

.route-item.animated {
    opacity: 1;
}

.route-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-left-width: 5px;
}

/* Animación para el header */
header {
    animation: slideInLeft 0.6s ease forwards;
}

/* Animación para el footer */
footer {
    animation: fadeInUp 0.8s ease forwards;
}

/* Efecto de parallax sutil */
.hero {
    transition: transform 0.3s ease;
}

/* Animación de carga para números */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-animate {
    animation: countUp 1s ease forwards;
}

/* Animación para iconos */
.service-card h3::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background-color: var(--azul-oscuro);
    transition: height 0.3s ease;
}

.service-card:hover h3::before {
    height: 80%;
}

/* Animación de pulso sutil para CTA */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(26, 54, 93, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(26, 54, 93, 0);
    }
}

.btn-primary {
    animation: pulse 2s infinite;
}

/* Animación para el botón de WhatsApp */
.whatsapp-float {
    animation: fadeIn 0.5s ease forwards, pulse 2s infinite 1s;
    animation-delay: 1s, 2s;
}

.whatsapp-float:hover {
    animation: none;
    transform: scale(1.15);
}

/* Retrasos escalonados para elementos en grid */
.services-grid > *:nth-child(1) { 
    --delay: 0; 
    animation-delay: 0s;
}
.services-grid > *:nth-child(2) { 
    --delay: 1; 
    animation-delay: 0.2s;
}
.services-grid > *:nth-child(3) { 
    --delay: 2; 
    animation-delay: 0.4s;
}

.testimonials-grid > *:nth-child(1) { --delay: 0; }
.testimonials-grid > *:nth-child(2) { --delay: 1; }
.testimonials-grid > *:nth-child(3) { --delay: 2; }

.process-steps > *:nth-child(1) { --delay: 0; }
.process-steps > *:nth-child(2) { --delay: 1; }
.process-steps > *:nth-child(3) { --delay: 2; }
.process-steps > *:nth-child(4) { --delay: 3; }
.process-steps > *:nth-child(5) { --delay: 4; }

.routes-list > *:nth-child(1) { --delay: 0; }
.routes-list > *:nth-child(2) { --delay: 1; }
.routes-list > *:nth-child(3) { --delay: 2; }

/* Prevenir animaciones en dispositivos con preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

