/* ============================================
   PVC IDEAS - ANIMACIONES
============================================= */

/* ============================================
   KEYFRAMES - DEFINICIÓN DE ANIMACIONES
============================================= */

/* Fade In básico */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In desde abajo */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In desde arriba */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In desde la izquierda */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In desde la derecha */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In - Aparecer con escala */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse - Efecto de pulso */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Float - Efecto de flotación suave */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Scroll Line - Animación del indicador de scroll */
@keyframes scrollLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        transform: scaleY(1);
        transform-origin: top;
    }
    51% {
        transform-origin: bottom;
    }
    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* ============================================
   CLASES DE ANIMACIÓN REUTILIZABLES
============================================= */

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* ============================================
   DELAYS DE ANIMACIÓN
============================================= */

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ============================================
   ANIMACIONES DEL HERO
============================================= */

/* Elementos del hero con animación inicial */
.hero__subtitle {
    opacity: 0;
    animation: fadeIn 0.8s ease 0.2s forwards;
}

.hero__title {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero__description {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

.hero__buttons {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

/* Indicador de Scroll */
.hero__scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

/* Formas decorativas flotantes */
.shape--1 {
    animation: float 6s ease-in-out infinite;
}

.shape--2 {
    animation: float 8s ease-in-out infinite;
    animation-delay: 1s;
}

.shape--3 {
    animation: float 7s ease-in-out infinite;
    animation-delay: 2s;
}

/* ============================================
   ANIMACIONES DE SCROLL (Intersection Observer)
============================================= */

/* Estado inicial - elementos ocultos */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Estado visible - cuando entra en viewport */
.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Variantes de dirección */
.scroll-animate.from-left {
    transform: translateX(-40px);
}

.scroll-animate.from-left.visible {
    transform: translateX(0);
}

.scroll-animate.from-right {
    transform: translateX(40px);
}

.scroll-animate.from-right.visible {
    transform: translateX(0);
}

.scroll-animate.from-scale {
    transform: scale(0.9);
}

.scroll-animate.from-scale.visible {
    transform: scale(1);
}

/* ============================================
   ANIMACIONES DE TARJETAS DE SERVICIO
============================================= */

.service-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }

/* Efecto hover en iconos de servicio */
.service-card__icon {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover .service-card__icon {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(14, 36, 66, 0.3);
}

/* ============================================
   ANIMACIONES DE FEATURE ITEMS
============================================= */

.feature-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }
.feature-item:nth-child(4) { animation-delay: 0.4s; }

/* Efecto hover en número */
.feature-item__number {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.feature-item:hover .feature-item__number {
    opacity: 0.6;
    transform: scale(1.1);
}

/* ============================================
   ANIMACIONES DE GALERÍA
============================================= */

.gallery-preview__item {
    opacity: 0;
    transform: scale(0.95);
    animation: scaleIn 0.5s ease forwards;
}

.gallery-preview__item:nth-child(1) { animation-delay: 0.1s; }
.gallery-preview__item:nth-child(2) { animation-delay: 0.2s; }
.gallery-preview__item:nth-child(3) { animation-delay: 0.3s; }
.gallery-preview__item:nth-child(4) { animation-delay: 0.4s; }

/* Efecto hover en galería */
.gallery-preview__item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(14, 36, 66, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-preview__item:hover::after {
    opacity: 1;
}

/* ============================================
   ANIMACIONES DE BOTONES
============================================= */

.btn {
    position: relative;
    overflow: hidden;
}

/* Efecto ripple en botones */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   ANIMACIÓN DEL BOTÓN WHATSAPP
============================================= */

.whatsapp-float {
    animation: pulse 2s ease-in-out infinite;
}

.whatsapp-float:hover {
    animation: none;
}

/* ============================================
   ANIMACIONES DEL FOOTER
============================================= */

.footer__social-link {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.footer__social-link:hover {
    transform: translateY(-5px) rotate(5deg);
}

/* ============================================
   ANIMACIONES DE SECCIONES
============================================= */

.section__header {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

/* ============================================
   TRANSICIONES DE LINKS
============================================= */

.footer__list a,
.nav__link {
    position: relative;
}

.footer__list a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.footer__list a:hover::before {
    width: 100%;
}

/* ============================================
   PREFERENCIAS 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;
    }
    
    .hero__subtitle,
    .hero__title,
    .hero__description,
    .hero__buttons,
    .service-card,
    .feature-item,
    .gallery-preview__item,
    .section__header {
        opacity: 1;
        transform: none;
    }
}