/* ===================================
   ROADREADY SUPPLY - ENHANCED ANIMATIONS
   =================================== */

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleUp {
    from {
        transform: scale(0.9);
    }
    to {
        transform: scale(1);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.8), 0 0 60px rgba(255, 69, 0, 0.6);
    }
}

/* Slide Animations */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Heartbeat Animation */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}

/* Apply Animations to Elements */

/* Hero Badge - Pulse */
.hero-badge {
    animation: pulse 2s ease-in-out infinite;
}

/* Hero Title - Fade In Up */
.hero-title {
    animation: fadeInUp 1s ease-out;
}

/* Hero Subtitle - Fade In Up with Delay */
.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Hero Buttons - Fade In with Delay */
.hero-buttons .btn {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-buttons .btn:nth-child(2) {
    animation-delay: 0.8s;
}

/* Trust Badges - Fade In Sequence */
.trust-badge {
    opacity: 1; /* Start visible as fallback */
    animation: fadeInUp 0.6s ease-out forwards;
}

.trust-badge:nth-child(1) { animation-delay: 0.2s; }
.trust-badge:nth-child(2) { animation-delay: 0.4s; }
.trust-badge:nth-child(3) { animation-delay: 0.6s; }
.trust-badge:nth-child(4) { animation-delay: 0.8s; }

/* Product Cards - Hover Effects */
.product-card {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.product-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 70px rgba(0,0,0,0.3);
}

.product-card:hover .product-image img {
    transform: scale(1.1) rotate(2deg);
}

/* Product Images - Zoom on Hover */
.product-image img {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Product Badges - Shake */
.product-badge {
    animation: shake 3s ease-in-out infinite;
}

/* Buttons - Glow on Hover */
.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    animation: glow 1.5s ease-in-out infinite;
}

/* Feature Cards - staggered fadeIn */
.feature-card {
    opacity: 1; /* Start visible as fallback */
    animation: fadeInUp 0.8s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.3s; }
.feature-card:nth-child(3) { animation-delay: 0.5s; }
.feature-card:nth-child(4) { animation-delay: 0.7s; }

/* Category Cards - Hover Scale */
.category-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-card:hover {
    transform: translateY(-15px) scale(1.05);
}

.category-card:hover .category-image {
    animation: pulse 1s ease-in-out;
}

/* Testimonial Cards - Slide In */
.testimonial-card {
    opacity: 1; /* Start visible as fallback */
    animation: fadeInLeft 0.8s ease-out forwards;
}

.testimonial-card:nth-child(1) { animation-delay: 0.2s; }
.testimonial-card:nth-child(2) { animation-delay: 0.5s; }
.testimonial-card:nth-child(3) { animation-delay: 0.8s; }

/* Bundle Cards - Heartbeat Badge */
.bundle-badge {
    animation: heartbeat 2s ease-in-out infinite;
}

.bundle-card {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bundle-card:hover {
    transform: scale(1.05) rotate(1deg);
}

/* Price Display - Pop */
.price-current, .price, .bundle-current {
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Announcement Bar - Gradient Shift */
.announcement-bar {
    background: linear-gradient(270deg, #FF6B35, #FF4500, #FF6B35);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

/* Logo - Float */
.logo-icon {
    display: inline-block;
    animation: float 4s ease-in-out infinite;
}

/* Navigation Links - Underline Animation */
.nav-menu a {
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Cart Button - Bounce on Update */
.btn-cart {
    transition: all 0.3s ease;
}

.btn-cart.bounce {
    animation: bounce 0.6s ease;
}

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

.spinner {
    border: 4px solid rgba(255, 107, 53, 0.1);
    border-top: 4px solid var(--primary-orange);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Scroll Reveal Class (add via JS) */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effect Class */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Particle Effect */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Ribbon Animation */
@keyframes ribbonWave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Staggered List Animation */
.stagger-list > li {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

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

/* Countdown Timer Animation */
@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Image Overlay Reveal */
@keyframes overlayReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* Success Checkmark Animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Responsive Animation Adjustments */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .hero-title {
        animation: fadeIn 1s ease-out;
    }
    
    .product-card:hover {
        transform: translateY(-5px);
    }
}
