/* ===================================
   Interactive Bakery Background
   Luxurious animated particles & patterns
   =================================== */

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(circle at 20% 50%, rgba(234, 186, 64, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(234, 186, 64, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(234, 186, 64, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #FFF9F0 0%, #F5E5B8 50%, #FFF9F0 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%, 100% 100%, 50% 0%, 0% 0%;
    }
    50% {
        background-position: 100% 50%, 0% 0%, 100% 100%, 0% 0%;
    }
}

/* Floating bakery elements */
.bakery-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
    animation: float-up 15s infinite ease-in-out;
    filter: blur(0.5px);
}

/* Different particles with varied animations */
.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 18s;
    font-size: 2.5rem;
}
.particle:nth-child(2) {
    left: 25%;
    animation-delay: 3s;
    animation-duration: 22s;
    font-size: 1.8rem;
}
.particle:nth-child(3) {
    left: 45%;
    animation-delay: 6s;
    animation-duration: 20s;
    font-size: 2.2rem;
}
.particle:nth-child(4) {
    left: 65%;
    animation-delay: 2s;
    animation-duration: 25s;
    font-size: 1.5rem;
}
.particle:nth-child(5) {
    left: 80%;
    animation-delay: 8s;
    animation-duration: 19s;
    font-size: 2rem;
}
.particle:nth-child(6) {
    left: 15%;
    animation-delay: 5s;
    animation-duration: 23s;
    font-size: 1.7rem;
}
.particle:nth-child(7) {
    left: 35%;
    animation-delay: 10s;
    animation-duration: 21s;
    font-size: 2.3rem;
}
.particle:nth-child(8) {
    left: 55%;
    animation-delay: 4s;
    animation-duration: 24s;
    font-size: 1.9rem;
}
.particle:nth-child(9) {
    left: 75%;
    animation-delay: 7s;
    animation-duration: 18s;
    font-size: 2.1rem;
}
.particle:nth-child(10) {
    left: 90%;
    animation-delay: 1s;
    animation-duration: 20s;
    font-size: 1.6rem;
}

@keyframes float-up {
    0% {
        bottom: -10%;
        opacity: 0;
        transform: translateX(0) rotate(0deg);
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(100px) rotate(360deg);
    }
}

/* Subtle texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 35px,
            rgba(234, 186, 64, 0.02) 35px,
            rgba(234, 186, 64, 0.02) 70px
        );
    pointer-events: none;
}

/* Hovering sparkle effect on cursor - desktop only */
@media (hover: hover) and (pointer: fine) {
    .cursor-glow {
        position: fixed;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(234, 186, 64, 0.15) 0%, transparent 70%);
        pointer-events: none;
        z-index: 9999;
        transition: transform 0.15s ease-out;
        mix-blend-mode: screen;
        display: none;
    }

    body:hover .cursor-glow {
        display: block;
    }
}

/* Interactive hover states for sections */
.hero,
.section {
    position: relative;
    transition: all 0.3s ease;
}

.hero::after,
.section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
                rgba(234, 186, 64, 0.05) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.hero:hover::after,
.section:hover::after {
    opacity: 1;
}

/* Ensure content stays above effects */
.hero > *,
.section > * {
    position: relative;
    z-index: 1;
}

/* Pulsing accent animation for CTAs */
@keyframes pulse-gold {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(234, 186, 64, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(234, 186, 64, 0.4);
    }
}

.btn:hover {
    animation: pulse-gold 2s ease infinite;
}

/* Shimmer effect on images */
.product-image::before,
.hero-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.product-card:hover .product-image::before,
.hero-image:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Parallax scroll effect */
@media (min-width: 1024px) {
    .parallax-layer {
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Loading animation enhancement */
@keyframes bakery-entrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* FIXED: Removed .product-card to prevent disappearing images on scroll */
.feature-card {
    animation: bakery-entrance 0.6s ease-out forwards;
    animation-play-state: paused;
}

.feature-card.visible {
    animation-play-state: running;
}

/* Stagger animations - only for feature cards */
.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

/* Performance optimizations */
.bakery-particles,
.particle {
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
        background: linear-gradient(135deg, #FFF9F0 0%, #F5E5B8 100%);
    }

    .bakery-particles {
        display: none;
    }
}
