/**
 * Animation Styles for BRICODIPAGINA Theme
 * Smooth animations and transitions
 */

/* Carousel Animations */
@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -30px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Slide Animations */
.slide {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide.active .slide-inner {
    animation: fadeInUp 1s ease-out;
}

.slide.active .slide-badge {
    animation: slideInLeft 0.8s ease-out;
}

.slide.active .slide-title {
    animation: slideInRight 1s ease-out 0.2s both;
}

.slide.active .slide-desc {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.slide.active .slide-actions {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Progress Bar Animation */
.progress-bar {
    animation: progress 5s linear infinite;
}

/* Button Hover Effects */
.btn-primary:hover,
.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.btn-primary:active,
.btn-outline:active {
    transform: translateY(0);
}

/* Cart Animation */
@keyframes cartBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.cart-bounce {
    animation: cartBounce 0.5s ease;
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Product Card Hover Effects */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.product-image {
    overflow: hidden;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
    transition: transform 0.5s ease;
}

/* Mobile Menu Animation */
.mobile-menu {
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-panel {
    animation: slideInRight 0.3s ease-out;
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus Animations */
.focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    animation: pulse 0.3s ease;
}

/* Micro-interactions */
.interactive {
    cursor: pointer;
    user-select: none;
}

.interactive:active {
    transform: scale(0.98);
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
