/* Product Detail Animations */

/* Hero Section Animations */
.product-hero {
    animation: heroSlideIn 1s ease-out;
}

@keyframes heroSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.breadcrumb-nav {
    animation: breadcrumbFadeIn 1.2s ease-out 0.3s both;
}

@keyframes breadcrumbFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product Gallery Animations */
.product-gallery {
    animation: gallerySlideIn 0.8s ease-out 0.5s both;
}

@keyframes gallerySlideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.main-image {
    animation: imageZoomIn 1s ease-out 0.8s both;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.thumbnail-item {
    animation: thumbnailSlideIn 0.6s ease-out;
    animation-fill-mode: both;
}

.thumbnail-item:nth-child(1) { animation-delay: 1s; }
.thumbnail-item:nth-child(2) { animation-delay: 1.1s; }
.thumbnail-item:nth-child(3) { animation-delay: 1.2s; }
.thumbnail-item:nth-child(4) { animation-delay: 1.3s; }
.thumbnail-item:nth-child(5) { animation-delay: 1.4s; }

@keyframes thumbnailSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product Info Animations */
.product-info {
    animation: infoSlideIn 0.8s ease-out 0.7s both;
}

@keyframes infoSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-title {
    animation: titleFadeIn 1s ease-out 1s both;
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-badge {
    animation: badgeBounceIn 0.8s ease-out 1.2s both;
}

@keyframes badgeBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rating Animations */
.rating-section {
    animation: ratingSlideIn 0.8s ease-out 1.4s both;
}

@keyframes ratingSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.star.filled {
    animation: starFill 0.5s ease-out;
}

@keyframes starFill {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Price Animations */
.price-section {
    animation: priceSlideIn 0.8s ease-out 1.6s both;
}

@keyframes priceSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-value {
    animation: priceGlow 2s ease-in-out infinite;
}

@keyframes priceGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
}

/* Stock Status Animations */
.stock-section {
    animation: stockSlideIn 0.8s ease-out 1.8s both;
}

@keyframes stockSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stock-status {
    animation: stockPulse 2s ease-in-out infinite;
}

@keyframes stockPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Cart Section Animations */
.cart-section {
    animation: cartSlideIn 0.8s ease-out 2s both;
}

@keyframes cartSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quantity-btn {
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    animation: buttonPulse 0.3s ease;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.add-to-cart-btn, .buy-now-btn {
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover, .buy-now-btn:hover {
    animation: buttonFloat 0.3s ease;
}

@keyframes buttonFloat {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(-2px);
    }
}

/* Product Stats Animations */
.product-stats {
    animation: statsSlideIn 0.8s ease-out 2.2s both;
}

@keyframes statsSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item {
    animation: statFadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-item:nth-child(1) { animation-delay: 2.4s; }
.stat-item:nth-child(2) { animation-delay: 2.6s; }
.stat-item:nth-child(3) { animation-delay: 2.8s; }

@keyframes statFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Features Animations */
.features-section {
    animation: featuresSlideIn 0.8s ease-out 3s both;
}

@keyframes featuresSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-item {
    animation: featureSlideIn 0.6s ease-out;
    animation-fill-mode: both;
}

.feature-item:nth-child(1) { animation-delay: 3.2s; }
.feature-item:nth-child(2) { animation-delay: 3.4s; }
.feature-item:nth-child(3) { animation-delay: 3.6s; }
.feature-item:nth-child(4) { animation-delay: 3.8s; }
.feature-item:nth-child(5) { animation-delay: 4.0s; }
.feature-item:nth-child(6) { animation-delay: 4.2s; }

@keyframes featureSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tabs Animations */
.product-tabs-section {
    animation: tabsSlideIn 0.8s ease-out 4.5s both;
}

@keyframes tabsSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-tabs .nav-link {
    transition: all 0.3s ease;
}

.product-tabs .nav-link:hover {
    animation: tabHover 0.3s ease;
}

@keyframes tabHover {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Review Animations */
.review-item {
    animation: reviewSlideIn 0.6s ease-out;
    animation-fill-mode: both;
}

.review-item:nth-child(1) { animation-delay: 0.2s; }
.review-item:nth-child(2) { animation-delay: 0.4s; }
.review-item:nth-child(3) { animation-delay: 0.6s; }

@keyframes reviewSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reviewer-avatar {
    animation: avatarBounce 0.8s ease-out;
}

@keyframes avatarBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Related Products Animations */
.related-product-card {
    animation: relatedSlideIn 0.6s ease-out;
    animation-fill-mode: both;
}

.related-product-card:nth-child(1) { animation-delay: 0.2s; }
.related-product-card:nth-child(2) { animation-delay: 0.4s; }
.related-product-card:nth-child(3) { animation-delay: 0.6s; }
.related-product-card:nth-child(4) { animation-delay: 0.8s; }

@keyframes relatedSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animations */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Hover Effects */
.product-gallery:hover .main-image {
    animation: imageHover 0.3s ease;
}

@keyframes imageHover {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

.thumbnail-item:hover {
    animation: thumbnailHover 0.3s ease;
}

@keyframes thumbnailHover {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Responsive Animations */
@media (max-width: 768px) {
    .product-gallery {
        animation: gallerySlideInMobile 0.8s ease-out 0.5s both;
    }
    
    @keyframes gallerySlideInMobile {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .product-info {
        animation: infoSlideInMobile 0.8s ease-out 0.7s both;
    }
    
    @keyframes infoSlideInMobile {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Success/Error Animations */
.success-animation {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
    }
    100% {
        transform: scale(1);
    }
}

.error-animation {
    animation: errorShake 0.6s ease;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
} 