/**
 * SPARKLES MASTER ANIMATION LIBRARY
 * 
 * Consolidated from:
 * - /app/design/frontend/Sparkles/main/web/css/animations.css
 * - /sparkles-design-library/animations/sparkles-animations.css  
 * - /sparkles-design-library/animations/sparkles-animation-effects.css
 * 
 * This file contains all animation and micro-interaction styles for the Sparkles theme.
 * Duplicates removed, keyframes consolidated, organized by functional sections.
 * 
 * Dependencies: sparkles-tokens.css, Tailwind CSS
 * Extends: sparkles-utilities.css, sparkles-animations.css, sparkles-tokens.css
 * All 3 optimization layers applied: keyframes consolidated, patterns extracted, component organization
 */

/* ========== ANIMATION FOUNDATIONS ========== */
/* ALL animation tokens moved to tokens.css for proper architecture */

/* ========== BASIC ANIMATIONS ========== */

/* Fade Animations */
.sparkles-fade-in {
    animation: fade-in var(--animation-duration-normal) ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sparkles-fade {
    animation: sparkles-fade 2s ease-in-out infinite;
}

@keyframes sparkles-fade {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Slide Animations */
.sparkles-slide-up {
    animation: slide-up var(--animation-luxury) var(--animation-easing-standard);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(var(--space-lg));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sparkles-slide-down {
    animation: slide-down var(--animation-luxury) var(--animation-easing-standard);
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(calc(-1 * var(--space-lg)));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sparkles-slide-left {
    animation: slide-left var(--animation-luxury) var(--animation-easing-standard);
}

@keyframes slide-left {
    from {
        opacity: 0;
        transform: translateX(var(--space-lg));
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sparkles-slide-right {
    animation: slide-right var(--animation-luxury) var(--animation-easing-standard);
}

@keyframes slide-right {
    from {
        opacity: 0;
        transform: translateX(calc(-1 * var(--space-lg)));
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom Animations */
.sparkles-zoom-in {
    animation: zoom-in var(--animation-duration-slow) var(--animation-easing-standard);
}

@keyframes zoom-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Effect */
.sparkles-pulse,
.sparkle-pulse {
    animation: sparkle-pulse 2s infinite;
}

@keyframes sparkle-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Spin Animation */
.sparkles-spin,
.sparkles-loading {
    animation: sparkles-spin 1s linear infinite;
}

@keyframes sparkles-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* CONSOLIDATED: @keyframes spin removed - use sparkles-spin (line 137) for better naming consistency */

/* ========== BUTTON ANIMATIONS ========== */

/* Primary Button Ripple Effect */
.btn-sparkles-primary,
.action.primary,
.btn-primary,
.sparkle-ripple {
    position: relative;
    overflow: hidden;
    transition-property: all;
    transition-duration: .3s;
    transition-timing-function: cubic-bezier(0, 0, .2, 1);
}

.btn-sparkles-primary::before,
.action.primary::before,
.btn-primary::before,
.sparkle-ripple::before {
    content: '';
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    position: absolute;
    width: 0;
    height: 0;
    transition-property: all;
    transition-duration: .7s;
    transition-timing-function: cubic-bezier(0, 0, .2, 1);
}

.btn-sparkles-primary:hover::before,
.action.primary:hover::before,
.btn-primary:hover::before,
.sparkle-ripple:hover::before {
    width: 300px;
    height: 300px;
}

/* Button Lift Effect */
.btn-sparkles-primary:hover,
.btn-sparkles-secondary:hover,
.action.primary:hover,
.btn:hover,
.sparkle-lift:hover {
    box-shadow: 0 8px 25px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.btn-sparkles-primary:active,
.btn-sparkles-secondary:active,
.action.primary:active,
.btn:active,
.sparkle-lift:active {
    --tw-translate-y: 0px;
    transition-property: all;
    transition-duration: .15s;
    transition-timing-function: cubic-bezier(0, 0, .2, 1);
}

/* Button Scale Effect - Properties consolidated in sparkles-utilities.css (Selector Grouping) */

.sparkle-scale:active {
    --tw-scale-x: .95;
    --tw-scale-y: .95;
}

/* Gradient Shift Animation (for HyvaSocial button glow) */
@keyframes sparkles-gradient-shift {

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

    50% {
        background-position: 100% 50%;
    }
}

/* Button Bounce Animation */
.btn-animation-bounce:active,
.sparkles-btn-bounce:active {
    animation: sparkles-button-bounce 0.3s ease-in-out;
}

@keyframes sparkles-button-bounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* ========== COMPONENT ANIMATIONS ========== */

/* Marquee Animations (moved from sparkles-components.css) */
@keyframes sparkles-marquee-legacy {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@keyframes sparkles-shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Sparkle Float Effect (moved from sparkles-components.css) */
@keyframes sparkle-float {

    0%,
    100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
}

/* Slide In Animation (moved from sparkles-components.css) */
@keyframes sparkles-slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Download Pulse Animation (moved from sparkles-components.css) */
@keyframes sparkles-download-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Product Card Hover */
.product-item,
.product-item-sparkles,
.product-hover-enhanced,
.product-card,
.sparkles-product-card {
    transition: all var(--animation-duration) var(--animation-easing);
}

.product-item:hover,
.product-item-sparkles:hover,
.product-hover-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

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

/* Product Image Zoom */
.product-item .product-image-photo,
.product-item-sparkles img,
.product-image-zoom img {
    transition: transform 0.5s var(--animation-easing);
}

.product-item:hover .product-image-photo,
.product-item-sparkles:hover img,
.product-image-zoom:hover img {
    transform: scale(1.05);
}

.product-image-zoom {
    overflow: hidden;
}

/* Price Gold Glow */
.price,
.price-sparkle {
    transition: all var(--animation-duration) var(--animation-easing);
}

.product-item:hover .price,
.product-item-sparkles:hover .price,
.price-sparkle:hover {
    color: var(--color-primary);
    text-shadow: 0 0 8px color-mix(in srgb, var(--color-primary) 40%, transparent);
    transform: scale(1.05);
}

/* ========== NAVIGATION ANIMATIONS ========== */

/* Menu Item Hover */
.navigation ul li a,
.sparkles-nav-link,
.nav-link-animated {
    transition: color var(--animation-duration) var(--animation-easing);
    position: relative;
}

.navigation ul li a::after,
.sparkles-nav-link::after,
.nav-link-animated::after {
    content: '';
    bottom: -2px;
    background: var(--color-primary);
    transition: width var(--animation-duration) var(--animation-easing);
    position: absolute;
    left: 0;
    width: 0;
}

.navigation ul li a:hover::after,
.sparkles-nav-link:hover::after,
.nav-link-animated:hover::after {
    width: 100%;
}

/* Mega Menu Slide Down */
.mega-menu,
.dropdown-menu,
.mega-menu-animated {
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--animation-duration) var(--animation-easing);
    pointer-events: none;
}

.mega-menu.show,
.dropdown-menu.show,
.mega-menu-animated.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Breadcrumb Animation */
.breadcrumb-animated li {
    opacity: 0;
    transform: translateX(-20px);
    animation: breadcrumb-fade-in var(--animation-duration-normal) ease-out forwards;
}

.breadcrumb-animated li:nth-child(1) {
    animation-delay: 0.1s;
}

.breadcrumb-animated li:nth-child(2) {
    animation-delay: 0.2s;
}

.breadcrumb-animated li:nth-child(3) {
    animation-delay: 0.3s;
}

.breadcrumb-animated li:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes breadcrumb-fade-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== FORM ANIMATIONS ========== */
/* Extends: sparkles-utilities.css base form system */

/* Input Focus Effect - Enhanced base form inputs */
.input-text,
.form-control,
.input-animated,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    transition-property: all;
    transition-duration: .3s;
    transition-timing-function: cubic-bezier(0, 0, .2, 1);
    border-width: 2px;
    border-color: var(--gray-300);
}

.input-text:focus,
.form-control:focus,
.input-animated:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 10%, transparent);
    transform: scale(1.02);
}

/* Search Input Glow */
.search-glow:focus,
.sparkles-search-glow:focus {
    box-shadow: 0 0 8px color-mix(in srgb, var(--color-primary) 40%, transparent);
    transition: box-shadow 0.3s ease;
    border-color: var(--color-primary);
}

/* Checkbox/Radio Animation */
input[type="checkbox"],
input[type="radio"],
.checkbox-animated {
    transition: all var(--animation-duration) var(--animation-easing);
}

input[type="checkbox"]:checked,
input[type="radio"]:checked,
.checkbox-animated:checked {
    animation: sparkle-check 0.5s ease-out;
}

@keyframes sparkle-check {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Form Validation Success */
.form-success {
    animation: form-success-glow 0.8s ease-out;
}

@keyframes form-success-glow {

    0%,
    100% {
        border-color: var(--color-green-500);
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

    50% {
        border-color: var(--color-green-500);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.2);
    }
}

/* ========== LOADING ANIMATIONS ========== */
/* Extends: sparkles-utilities.css base loading system */

/* Shimmer Effect - Enhanced base loading */
.sparkles-shimmer {
    background: linear-gradient(90deg, var(--color-gray-100) 25%, var(--color-gray-200) 50%, var(--color-gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer var(--sparkles-image-skeleton-duration) infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.sparkles-skeleton,
.sparkles-image-placeholder,
.sparkles-carousel,
.sparkles-banner-carousel {
    position: relative;
    overflow: hidden;
}

/* Skeleton Loading - Extends base skeleton system */
.sparkles-skeleton {
    background-color: var(--gray-200);
    border-radius: .5rem;
}

.sparkles-skeleton::after {
    content: '';
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.2) 20%,
            rgba(255, 255, 255, 0.5) 60%,
            rgba(255, 255, 255, 0));
    animation: skeleton-shimmer 2s infinite;
    position: absolute;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Loading Pulse */
.sparkles-loading-pulse {
    animation: sparkles-pulse 1.5s ease-in-out infinite;
}

/* ========== STAGGER ANIMATIONS ========== */

/* Stagger Animation for Lists */
.stagger-animation>* {
    opacity: 0;
    animation: stagger-item 0.5s ease-out forwards;
}

.stagger-animation>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-animation>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-animation>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-animation>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-animation>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-animation>*:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-animation>*:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-animation>*:nth-child(8) {
    animation-delay: 0.8s;
}

@keyframes stagger-item {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progressive Load */
.sparkles-progressive-load {
    opacity: 0;
    transform: translateY(20px);
    animation: sparkles-fade-in-up var(--animation-duration-slow) ease-out forwards;
}

@keyframes sparkles-fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== SPARKLE EFFECTS ========== */

/* Floating Sparkles */
.sparkle-float {
    position: relative;
}

.sparkle-float::after {
    content: '✨';
    top: -5px;
    right: -5px;
    font-size: 12px;
    animation: sparkle-float-animation 2s ease-in-out infinite;
    opacity: 0;
    position: absolute;
}

.sparkle-float:hover::after {
    opacity: 1;
}

@keyframes sparkle-float-animation {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: translateY(-10px) rotate(180deg);
        opacity: 1;
    }
}

/* Gold Glow Effect */
.gold-glow,
.sparkle-glow {
    transition: all var(--animation-duration) var(--animation-easing);
}

.gold-glow:hover,
.sparkle-glow:hover {
    box-shadow: 0 0 20px color-mix(in srgb, var(--color-primary) 40%, transparent);
    filter: brightness(1.05);
}

/* Sparkles Glow Animation */
.sparkles-glow {
    animation: sparkles-glow 2s ease-in-out infinite;
}

@keyframes sparkles-glow {

    0%,
    100% {
        box-shadow: 0 0 10px color-mix(in srgb, var(--color-primary) 30%, transparent);
        filter: brightness(1);
    }

    50% {
        box-shadow: 0 0 25px color-mix(in srgb, var(--color-primary) 60%, transparent);
        filter: brightness(1.15);
    }
}

/* Sparkle Trail */
.sparkle-trail {
    overflow: hidden;
    position: relative;
}

.sparkle-trail::before,
.sparkles-trail::before,
.perf-progress-bar::before {
    content: '';
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    position: absolute;
}

.sparkle-trail::before {
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-primary) 20%, transparent), transparent);
    animation: sparkle-trail-animation 3s infinite;
}

@keyframes sparkle-trail-animation {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Sparkles Trail Animation */
.sparkles-trail {
    overflow: hidden;
    position: relative;
}

.sparkles-trail::before {
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-primary) 30%, transparent), transparent);
    animation: sparkles-trail-animation 2.5s infinite;
}

/* Sparkle Burst */
.sparkle-burst:hover,
.sparkle-hover:hover {
    animation: sparkle-burst-animation 1s ease-out;
}

@keyframes sparkle-burst-animation {

    0%,
    100% {
        filter: brightness(1);
        transform: scale(1);
    }

    50% {
        /* TW v4.1 upgrade path: colored drop-shadow with color-mix() can use native
           drop-shadow-* utilities with color tokens (e.g. drop-shadow-primary/50). */
        filter: brightness(1.2) drop-shadow(0 0 10px color-mix(in srgb, var(--color-primary) 50%, transparent));
        transform: scale(1.05);
    }
}

/* Sparkles Burst Animation */
.sparkles-burst {
    animation: sparkles-burst-animation 0.8s ease-out;
}

@keyframes sparkles-burst-animation {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
        filter: brightness(1.3);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
}

/* ========== ICON ANIMATIONS ========== */

/* Icon Bounce */
.icon-bounce:hover,
.sparkle-bounce:hover,
.sparkles-bounce {
    animation: sparkles-bounce 0.6s ease-in-out;
}

@keyframes sparkles-bounce {

    0%,
    20%,
    60%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(var(--sparkles-bounce-high, -8px));
    }

    80% {
        transform: translateY(var(--sparkles-bounce-low, -4px));
    }
}

/* Icon Rotation */
.icon-rotate:hover,
.icon-spin:hover,
.sparkle-rotate:hover {
    animation: sparkles-rotate 0.5s ease-in-out;
}

@keyframes sparkles-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Heart Animation */
.wishlist-btn:hover svg,
.icon-heart:hover,
.heart-beat:hover,
.wishlist-heart:hover,
.sparkles-wishlist-heart:hover {
    animation: heart-beat 0.8s ease-in-out;
    color: var(--color-primary);
}

@keyframes heart-beat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1.2);
    }

    75% {
        transform: scale(1.1);
    }
}

/* Wiggle Animation */
.sparkle-wiggle:hover {
    animation: sparkle-wiggle 0.5s ease-out;
}

@keyframes sparkle-wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

/* Bounce Effect */
/* CONSOLIDATED: .sparkle-bounce:hover moved to line 623-626 with unified sparkles-bounce keyframe */

/* CONSOLIDATED: @keyframes sparkle-bounce removed - use sparkles-bounce (line 628) */

/* CONSOLIDATED: .sparkle-rotate:hover and @keyframes sparkle-rotate moved to lines 635-643 with unified sparkles-rotate */

/* ========== ADVANCED EFFECTS ========== */

/* Marquee Effects */
.sparkles-marquee {
    overflow: hidden;
    white-space: nowrap;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary), var(--color-primary-dark));
    padding: .5rem;
    border-radius: .375rem;
}

.sparkles-marquee-content {
    animation: sparkles-marquee-scroll 30s linear infinite;
    display: inline-block;
    color: var(--gray-800);
    font-weight: 600;
}

@keyframes sparkles-marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-5%);
    }
}

.sparkles-marquee-bounce .sparkles-marquee-content {
    animation: sparkles-marquee-bounce 20s ease-in-out infinite;
}

@keyframes sparkles-marquee-bounce {

    0%,
    100% {
        transform: translateX(10%);
    }

    50% {
        transform: translateX(-10%);
    }
}

/* Typewriter Effect */
.sparkles-typewriter::after {
    content: '|';
    color: var(--color-primary);
    animation: sparkles-cursor-blink 1s infinite;
    font-weight: bold;
}

@keyframes sparkles-cursor-blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Error Shake */
.sparkles-shake-error {
    animation: sparkles-shake 0.5s ease-out;
    border-color: var(--color-red-500);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

@keyframes sparkles-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

/* Attention Wobble */
.sparkles-wobble-attention {
    animation: sparkles-wobble 1s ease-out;
}

@keyframes sparkles-wobble {
    0% {
        transform: translateX(0%);
    }

    15% {
        transform: translateX(-25%) rotate(-5deg);
    }

    30% {
        transform: translateX(20%) rotate(3deg);
    }

    45% {
        transform: translateX(-15%) rotate(-3deg);
    }

    60% {
        transform: translateX(10%) rotate(2deg);
    }

    75% {
        transform: translateX(-5%) rotate(-1deg);
    }

    100% {
        transform: translateX(0%);
    }
}

/* Magic Glow */
.sparkles-magic-glow {
    overflow: hidden;
    position: relative;
}

.sparkles-magic-glow::before {
    content: '';
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            color-mix(in srgb, var(--color-primary) 10%, transparent),
            transparent);
    animation: sparkles-magic-shimmer 2s infinite;
    pointer-events: none;
    position: absolute;
}

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

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Success Glow */
.sparkles-success-glow {
    animation: sparkles-success-pulse 2s ease-out;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    border-color: var(--color-green-500);
}

@keyframes sparkles-success-pulse {
    0% {
        box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.6);
    }

    100% {
        box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
    }
}

/* Attention Glow */
.sparkles-attention-glow {
    animation: sparkles-attention-glow-effect 2s ease-in-out infinite;
}

@keyframes sparkles-attention-glow-effect {

    0%,
    100% {
        box-shadow: 0 0 5px color-mix(in srgb, var(--color-primary) 30%, transparent);
    }

    50% {
        box-shadow: 0 0 20px color-mix(in srgb, var(--color-primary) 80%, transparent);
    }
}

/* Sale Flash */
.sparkles-sale-flash {
    animation: sparkles-sale-flash-effect 1s ease-in-out infinite;
}

@keyframes sparkles-sale-flash-effect {

    0%,
    50%,
    100% {
        background-color: var(--color-primary);
        color: white;
    }

    25%,
    75% {
        background-color: var(--color-red-400);
        color: white;
    }
}

/* Cart Bounce */
.sparkles-cart-bounce {
    --sparkles-bounce-high: -10px;
    --sparkles-bounce-low: -5px;
    animation: sparkles-bounce 0.6s ease-out;
}

/* ========== 3D TRANSFORMS & PERSPECTIVE EFFECTS ========== */

/* 3D Container for perspective */
.sparkles-3d-container {
    perspective: 1000px;
    perspective-origin: center center;
}

/* 3D Product Card */
.sparkles-3d-card {
    transform-style: preserve-3d;
    transition: transform 0.5s ease-out;
    cursor: pointer;
}

.sparkles-3d-card:hover {
    transform: rotateY(15deg) rotateX(5deg) translateZ(20px);
}

/* 3D Card Flip */
.sparkles-3d-card-flip {
    transform-style: preserve-3d;
    transition: transform 0.7s ease-out;
    position: relative;
}

.sparkles-3d-card-flip:hover {
    transform: rotateY(180deg);
}

.sparkles-3d-card-front,
.sparkles-3d-card-back {
    backface-visibility: hidden;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    position: absolute;
}

/* CONSOLIDATED: .sparkles-3d-card-back duplicate removed - see line 889 for canonical definition */

/* 3D Button Effects */
.sparkles-3d-button {
    transform-style: preserve-3d;
    transition: all 0.3s ease-out;
    position: relative;
}

.sparkles-3d-button::before {
    content: '';
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(0, 0, 0, 0.1) 100%);
    transform: translateZ(1px);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    position: absolute;
}

.sparkles-3d-button:hover {
    transform: translateZ(10px) rotateX(5deg) rotateY(5deg);
}

.sparkles-3d-button:hover::before {
    opacity: 1;
}

.sparkles-3d-button:active {
    transform: translateZ(2px) rotateX(2deg) rotateY(2deg);
}

/* 3D Floating Elements */
.sparkles-3d-float {
    transform-style: preserve-3d;
    animation: sparkles-3d-float-animation 6s ease-in-out infinite;
}

@keyframes sparkles-3d-float-animation {

    0%,
    100% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg);
    }

    25% {
        transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    }

    50% {
        transform: translateY(-5px) rotateX(-3deg) rotateY(10deg);
    }

    75% {
        transform: translateY(-15px) rotateX(3deg) rotateY(-5deg);
    }
}

/* 3D Perspective Tilt */
.sparkles-3d-tilt {
    transform-style: preserve-3d;
    transition: transform 0.4s ease-out;
}

.sparkles-3d-tilt:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}

/* ========== PARTICLE & SPECIAL EFFECTS ========== */

/* Emoji Animation Specific Classes - Using Tailwind Utilities */
body .emoji-no-rotation * {
    transform: none;
    animation: none;
}

.emoji-no-rotation .sparkles-gravity-particle,
.emoji-no-rotation .sparkles-physics-particle {
    animation: sparkles-gravity-fall-no-rotation 3s linear forwards;
}

@keyframes sparkles-gravity-fall-no-rotation {
    0% {
        --tw-translate-y: 0px;
        opacity: 1;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.emoji-performance-mode .sparkles-gravity-particle,
.emoji-performance-mode .sparkles-physics-particle {
    animation-duration: 1.5s;
    transform: translateZ(0);
}

.emoji-performance-mode .sparkle-burst {
    animation-duration: 1s;
    transform: translateZ(0);
}

/* Opacity-aware animation classes for emoji particles */
.sparkles-gravity-particle-opacity-aware {
    animation: sparkles-gravity-fall-opacity-aware 3s linear forwards;
    /* Support for dynamic animation duration */
    animation-duration: var(--animation-duration, 3s);
}

.sparkle-burst-opacity-aware {
    animation: sparkle-burst-opacity-aware 2s ease-out forwards;
    /* Support for dynamic animation duration */
    animation-duration: var(--animation-duration, 2s);
}

/* Sparkle Particles */
.sparkle {
    pointer-events: none;
    z-index: var(--z-fixed);
    transition: all 0.3s ease-out;
    position: absolute;
}

.sparkle.animate {
    transform: translate(var(--spacing-24, 6rem), calc(-1 * var(--spacing-12, 3rem)));
    opacity: 0;
    animation: sparkle-burst-opacity-aware 2s ease-out forwards;
}

/* Opacity-respecting variant for emoji animations */
@keyframes sparkle-burst-opacity-aware {
    0% {
        transform: translate(-50%, -50%) scale(1);
        /* No opacity override - respect the base opacity */
    }

    50% {
        transform: translate(100px, -50px) scale(1.2);
        /* Multiply base opacity by 0.8 for fade effect */
        opacity: calc(var(--base-opacity, 1) * 0.8);
    }

    /* Begin fade-out phase (configurable timing) */
    calc(100% - var(--fade-out-duration, 1s) / var(--animation-duration, 2s) * 100%) {
        transform: translate(100px, -50px) scale(1.2);
        opacity: calc(var(--base-opacity, 1) * 0.8);
    }

    100% {
        transform: translate(100px, -50px) scale(0);
        opacity: 0;
        /* Final fade to 0 */
    }
}

/* Gravity fall animation for rain effect */
@keyframes sparkles-gravity-fall-opacity-aware {
    0% {
        transform: translateY(0) translateX(0);
        opacity: var(--base-opacity, 1);
    }

    /* Fade-out phase starts based on configuration */
    calc(100% - var(--fade-out-duration, 1s) / var(--animation-duration, 3s) * 100%) {
        opacity: var(--base-opacity, 1);
    }

    100% {
        transform: translateY(100vh) translateX(var(--horizontal-drift, 0px));
        opacity: 0;
    }
}

/* Emoji Reactions */
.emoji-reaction,
.sparkles-heart {
    position: fixed;
    pointer-events: none;
    z-index: var(--z-modal);
}

.emoji-reaction {
    font-size: 1.5rem;
    animation: sparkle-bounce 2s ease-out forwards;
}

/* Confetti Effects */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-modal);
    overflow: hidden;
}

.confetti-piece {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confetti-fall 3s linear infinite;
    position: absolute;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotateZ(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotateZ(720deg);
        opacity: 0;
    }
}

/* Sparkles Confetti Animation */
.sparkles-confetti {
    animation: sparkles-confetti 3s linear infinite;
}

@keyframes sparkles-confetti {
    0% {
        transform: translateY(-100vh) translateX(0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    25% {
        transform: translateY(25vh) translateX(-20px) rotateZ(180deg) scale(1.1);
        opacity: 0.9;
    }

    50% {
        transform: translateY(50vh) translateX(20px) rotateZ(360deg) scale(0.9);
        opacity: 0.7;
    }

    75% {
        transform: translateY(75vh) translateX(-10px) rotateZ(540deg) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translateY(100vh) translateX(0) rotateZ(720deg) scale(0.8);
        opacity: 0;
    }
}

/* Mouse Trail */
.sparkles-mouse-particle {
    position: fixed;
    pointer-events: none;
    z-index: var(--z-modal);
    font-size: 12px;
    color: var(--color-primary);
    animation: sparkle-trail 1s ease-out forwards;
}

@keyframes sparkle-trail {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.6;
    }

    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* Holiday Effects */
.sparkles-snow {
    position: fixed;
    pointer-events: none;
    z-index: var(--z-fixed);
    color: var(--color-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: sparkles-snow-fall 5s linear infinite;
}

/* ========== COLORED EMOJI LIBRARY ========== */
/* Color-adaptive emojis that use store color variables */

/* Base class for all colored emojis */
.sparkles-emoji-colored {
    display: inline-block;
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
}

/* Solid color geometric emojis */
.sparkles-emoji-star::before {
    content: "★";
    color: var(--color-primary);
}

.sparkles-emoji-diamond::before {
    content: "◆";
    color: var(--color-secondary);
}

.sparkles-emoji-heart::before {
    content: "♥";
    color: var(--color-accent);
}

.sparkles-emoji-sparkle::before {
    content: "✦";
    color: var(--color-primary-light);
}

.sparkles-emoji-gem::before {
    content: "♦";
    color: var(--color-secondary-light);
}

.sparkles-emoji-circle::before {
    content: "●";
    color: var(--color-primary);
}

.sparkles-emoji-square::before {
    content: "■";
    color: var(--color-secondary);
}

.sparkles-emoji-medium-star::before {
    content: "⭐";
    color: var(--color-primary);
}

.sparkles-emoji-sparkles::before {
    content: "✨";
    color: var(--color-primary-light);
}

.sparkles-emoji-glowing-star::before {
    content: "🌟";
    color: var(--color-accent);
}

.sparkles-emoji-white-circle::before {
    content: "⚪";
    color: var(--color-primary);
}

.sparkles-emoji-white-square::before {
    content: "⬜";
    color: var(--color-secondary);
}

.sparkles-emoji-moon::before {
    content: "🌙";
    color: var(--color-secondary-light);
}

.sparkles-emoji-lightning::before {
    content: "⚡";
    color: var(--color-accent);
}

/* Gradient variants for premium feel */
.sparkles-emoji-gradient::before {
    background: linear-gradient(45deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Size modifiers using rem for consistency */
.sparkles-emoji-sm::before {
    font-size: 0.875rem;
}

.sparkles-emoji-md::before {
    font-size: 1.25rem;
}

.sparkles-emoji-lg::before {
    font-size: 1.75rem;
}

.sparkles-emoji-xl::before {
    font-size: 2.5rem;
}

.sparkles-emoji-2xl::before {
    font-size: 3.5rem;
}

/* Animation compatibility - inherit existing emoji animations */
.sparkles-emoji-colored.sparkle-burst {
    animation: sparkle-burst-opacity-aware 2s ease-out forwards;
}

.sparkles-emoji-colored.sparkles-gravity-particle {
    animation: sparkles-gravity-fall 3s linear forwards;
}

/* Store-specific color overrides (automatically applied) */
/* These work with your existing multi-store CSS variables */

@keyframes sparkles-snow-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.sparkles-heart {
    font-size: 1.2rem;
    animation: sparkles-heart-float 3s ease-out forwards;
}

@keyframes sparkles-heart-float {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}

/* ========== UTILITY CLASSES ========== */

/* Smooth transitions for any element */
.smooth-transition {
    transition: all var(--animation-duration) var(--animation-easing);
}

/* Hover lift for any element */
.hover-lift:hover {
    transform: translateY(-2px);
}

/* Hover scale for any element */
.hover-scale:hover {
    transform: scale(1.05);
}

/* Hover glow for any element */
.hover-glow:hover {
    box-shadow: 0 0 20px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

/* Animation Control Utilities */
.sparkles-animate-once {
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
}

.sparkles-animate-infinite {
    animation-iteration-count: infinite;
}

.sparkles-animate-slow {
    animation-duration: 2s;
}

.sparkles-animate-fast {
    animation-duration: 0.5s;
}

/* Animation Delays */
.sparkles-delay-1 {
    animation-delay: 0.1s;
}

.sparkles-delay-2 {
    animation-delay: 0.2s;
}

.sparkles-delay-3 {
    animation-delay: 0.3s;
}

.sparkles-delay-4 {
    animation-delay: 0.4s;
}

.sparkles-delay-5 {
    animation-delay: 0.5s;
}

.sparkles-delay-6 {
    animation-delay: 0.6s;
}

.sparkles-delay-7 {
    animation-delay: 0.7s;
}

.sparkles-delay-8 {
    animation-delay: 0.8s;
}

/* ========== ACCESSIBILITY ========== */

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    html body *,
    html body *::before,
    html body *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
        scroll-behavior: auto;
    }

    /* Disable specific animations */
    body .sparkle-pulse,
    body .sparkles-shimmer,
    body .sparkle-trail::before,
    body .sparkle-float::after,
    body .sparkles-marquee-content,
    body .sparkles-typewriter::after,
    body .sparkles-magic-glow::before,
    body .sparkles-loading-pulse,
    body .sparkles-attention-glow,
    body .sparkles-sale-flash,
    body .sparkles-3d-float,
    body .sparkles-mouse-particle,
    body .sparkles-snow,
    body .sparkles-heart,
    body .confetti-piece,
    body .emoji-reaction {
        animation: none;
    }

    /* Disable 3D transforms */
    body .sparkles-3d-card,
    body .sparkles-3d-button,
    body .sparkles-3d-tilt {
        transform: none;
    }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {

    .sparkle-glow:hover,
    .hover-glow:hover {
        box-shadow: 0 0 0 3px currentColor;
    }

    .nav-link-animated::after,
    .sparkles-nav-link::after {
        height: 3px;
    }

    .sparkles-3d-card,
    .sparkles-3d-button {
        border: 2px solid currentColor;
    }

    .sparkles-success-glow {
        border: 2px solid var(--color-success);
        box-shadow: none;
    }

    .sparkles-shake-error {
        border: 2px solid var(--color-error);
        box-shadow: none;
    }
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {

    /* Reduce animation intensity on mobile */
    .sparkle-lift:hover,
    .hover-lift:hover,
    .btn-sparkles-primary:hover,
    .action.primary:hover {
        transform: translateY(-1px);
    }

    .product-hover-enhanced:hover,
    .product-item:hover {
        transform: translateY(-4px);
    }

    .sparkles-product-card:hover,
    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    }

    /* Disable complex 3D transforms on mobile */
    .sparkles-3d-card:hover {
        transform: rotateY(10deg) rotateX(3deg) translateZ(10px);
    }

    /* Slower marquee on mobile */
    .sparkles-marquee-content {
        animation-duration: 30s;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Disable hover effects on touch devices */
    .sparkle-glow:hover,
    .sparkle-lift:hover,
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-glow:hover {
        transform: none;
        box-shadow: none;
        filter: none;
    }

    /* Use active states instead */
    .sparkles-hover-lift:active {
        transform: translateY(-2px);
    }

    /* Hide mouse trail on touch devices */
    .sparkles-mouse-particle {
        display: none;
    }

    /* Reduce animation complexity */
    .sparkles-magic-glow::before {
        animation-duration: 1s;
    }
}

/* ========== SCROLL REVEAL ANIMATIONS ========== */
/* Used by sparkles-scroll-animations.js for scroll-triggered reveals */

/* Revealed State - Element is visible */
.sparkles-revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Pre-Reveal State - Element hidden before scroll */
.sparkles-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Reveal Base Styles - Transition properties */
.sparkles-reveal-styles {
    transition-property: opacity, transform;
    transition-duration: 0.5s;
    transition-timing-function: ease-out;
}