/* Animaciones y Micro-interacciones Adicionales */

/* Smooth scroll para toda la página */
html {
    scroll-behavior: smooth;
}

/* Efecto de loading para imágenes */
.product-image {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
}

.product-image.loading {
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Animación de "ripple" para clicks en tarjetas */
.product-card {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animación de bounce suave para badges */
.product-badge {
    animation: badge-bounce 1s ease-in-out 0.5s;
}

@keyframes badge-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Efecto de brillo en precios */
.product-price {
    position: relative;
    display: inline-block;
}

.product-price::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: price-shine 3s infinite;
}

@keyframes price-shine {

    0%,
    100% {
        left: -100%;
    }

    50% {
        left: 100%;
    }
}

/* Efecto parallax suave para el header */
.site-header {
    transform: translateZ(0);
    will-change: transform;
}

/* Animación de entrada para filtros */
.filters-sidebar {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animación para el contador de productos */
.products-count {
    animation: fadeIn 0.8s ease-out 0.3s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Efecto de glow para elementos interactivos */
.btn-whatsapp {
    position: relative;
    overflow: hidden;
}

.btn-whatsapp::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, height 0.6s;
}

.btn-whatsapp:hover::before {
    width: 300px;
    height: 300px;
}

/* Animación de shake para elementos con error */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.error {
    animation: shake 0.5s;
}

/* Efecto de typing para títulos */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* Hover lift para tags */
.tag {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Transición suave para cambios de tema */
body,
.site-header,
.product-card,
.filters-sidebar {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Animación de pulso para elementos destacados */
@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(251, 191, 36, 0);
    }
}

.badge-featured {
    animation: pulse-glow 2s infinite;
}

/* Efecto de zoom suave en imágenes principales */
.main-image img {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-image:hover img {
    transform: scale(1.05);
}

/* Animación de carga para el estado vacío */
.empty-state {
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Efecto de focus mejorado para inputs */
.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Animación para social links */
.social-link {
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.social-link:hover::before {
    left: 0;
}

/* Lazy loading fade-in effect */
img[loading="lazy"] {
    opacity: 1;
    /* Changed from 0 to 1 - images should be visible by default */
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Reducir animaciones para usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}