/* =============================================
   SCROLL ANIMATIONS CSS
   ============================================= */

/* Base state for all animated elements */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Keep section titles centered */
.section-title.scroll-animate,
h2.scroll-animate,
.contact-title.scroll-animate,
.reviews-header.scroll-animate {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Animated state */
.scroll-animate.animate-in {
    opacity: 1;
}

/* Ensure centered elements stay centered */
.scroll-animate.animate-in[class*="section-title"],
.section-title.animate-in {
    text-align: center;
}

/* =============================================
   ANIMATION TYPES
   ============================================= */

/* Fade Up */
.fade-up {
    transform: translateY(40px);
}

.fade-up.animate-in {
    transform: translateY(0);
}

/* Fade Down */
.fade-down {
    transform: translateY(-40px);
}

/* Fade Left */
.fade-left {
    transform: translateX(40px);
}

/* Fade Right */
.fade-right {
    transform: translateX(-40px);
}

/* Fade In (no movement) */
.fade-in {
    transform: translateY(0);
}

/* Zoom In */
.zoom-in {
    transform: scale(0.9);
}

/* Zoom Out */
.zoom-out {
    transform: scale(1.1);
}

/* Flip In */
.flip-in {
    transform: perspective(1000px) rotateY(90deg);
}

/* Slide Up */
.slide-up {
    transform: translateY(100px);
}

/* =============================================
   STAGGER DELAYS FOR GRID ITEMS
   ============================================= */

.scroll-animate:nth-child(1) { transition-delay: 0s; }
.scroll-animate:nth-child(2) { transition-delay: 0.1s; }
.scroll-animate:nth-child(3) { transition-delay: 0.2s; }
.scroll-animate:nth-child(4) { transition-delay: 0.3s; }
.scroll-animate:nth-child(5) { transition-delay: 0.4s; }
.scroll-animate:nth-child(6) { transition-delay: 0.5s; }
.scroll-animate:nth-child(7) { transition-delay: 0.6s; }
.scroll-animate:nth-child(8) { transition-delay: 0.7s; }

/* =============================================
   SPECIAL SECTION ANIMATIONS
   ============================================= */

/* Hero section - always visible */
.hero .scroll-animate,
.hero-content {
    opacity: 1;
    transform: none;
    animation: heroFadeIn 1s ease forwards;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section titles - stay centered */
.section-title.scroll-animate,
h2.section-title {
    text-align: center !important;
    width: 100%;
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
}

.section-title.fade-up {
    transform: translateY(20px);
    text-align: center !important;
}

.section-title.animate-in,
.section-title.fade-up.animate-in {
    opacity: 1;
    transform: translateY(0);
    text-align: center !important;
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product cards - subtle hover enhancement */
.product-card.animate-in {
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.product-card.animate-in:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Footer sections stagger */
.footer-section.scroll-animate:nth-child(1) { transition-delay: 0s; }
.footer-section.scroll-animate:nth-child(2) { transition-delay: 0.15s; }
.footer-section.scroll-animate:nth-child(3) { transition-delay: 0.3s; }
.footer-section.scroll-animate:nth-child(4) { transition-delay: 0.45s; }

/* =============================================
   REDUCED MOTION PREFERENCE
   ============================================= */

@media (prefers-reduced-motion: reduce) {
    .scroll-animate {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }
    
    .scroll-animate.animate-in {
        transform: none;
    }
}

/* =============================================
   LOADING ANIMATION FOR IMAGES
   ============================================= */

.product-card img,
.category-img-carousel,
.gallery-item img {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.product-card:hover img,
.gallery-item:hover img {
    transform: scale(1.05);
}

/* =============================================
   BUTTON HOVER ANIMATIONS
   ============================================= */

.btn,
.add-to-cart,
.view-products-btn,
.see-more-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::after,
.add-to-cart::after,
.view-products-btn::after,
.see-more-btn::after {
    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:hover::after,
.add-to-cart:hover::after,
.view-products-btn:hover::after,
.see-more-btn:hover::after {
    width: 300px;
    height: 300px;
}

/* =============================================
   TEXT REVEAL ANIMATION (Optional)
   ============================================= */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.text-reveal.animate-in span {
    transform: translateY(0);
}

/* =============================================
   PULSE ANIMATION FOR CTAs
   ============================================= */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(246, 173, 85, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(246, 173, 85, 0.5);
    }
}

.cta-pulse {
    animation: pulse 2s infinite;
}

/* =============================================
   GLOW EFFECT FOR SPECIAL ELEMENTS
   ============================================= */

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(246, 173, 85, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(246, 173, 85, 0.8);
    }
}

.glow-effect {
    animation: glow 2s infinite;
}