/**
 * Product Price Animation Styles
 * 
 * Premium animation styles for product prices
 */

/* Base styles for all animated prices */
.price-animated {
    position: relative;
    display: inline-block;
    transform-origin: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform, opacity, color, text-shadow;
    z-index: 1;
    overflow: visible;
    opacity: 1; /* Always start visible */
    visibility: visible !important; /* Ensure visibility */
}

/* Fallback styles to ensure prices are always displayed */
.discount-price, .current-price, .original-price, .regular-price {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ==== ENTRANCE ANIMATIONS ==== */

/* Scale reveal animation for price elements */
.price-reveal-wrapper {
    overflow: hidden;
    display: inline-block;
}

.price-reveal-text {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

/* Glow flash animation for price elements */
@keyframes glowFlash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
    }
}

/* Fade in and slide up animation for price elements */
@keyframes premiumPriceEntrance {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
        filter: blur(5px);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.02);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ==== DISCOUNT PRICE ANIMATIONS ==== */

/* Advanced pulse with glow effect for discount prices */
@keyframes premiumDiscountPulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0px rgba(228, 27, 23, 0);
    }
    50% {
        transform: scale(1.08);
        text-shadow: 0 0 8px rgba(228, 27, 23, 0.5);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0px rgba(228, 27, 23, 0);
    }
}

/* Shimmer effect for discount prices */
@keyframes premiumPriceShimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ==== REGULAR PRICE ANIMATIONS ==== */

/* Subtle floating animation for regular prices */
@keyframes premiumPriceFloat {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* ==== ORIGINAL PRICE ANIMATIONS ==== */

/* Strike-through animation for original prices */
@keyframes premiumStrikeThrough {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

/* Apply specific animations to price elements */
/* Regular price (non-discounted products) */
.regular-price.price-animated {
    position: relative;
    color: #2a6ee3; /* Premium blue color */
    font-weight: bold;
}

/* Discount price styling - with premium red gradient */
.discount-price.price-animated,
.current-price.price-animated {
    background: linear-gradient(90deg, #e41b17, #ff4b47, #e41b17);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    text-shadow: 0px 0px 3px rgba(228, 27, 23, 0.2);
}

/* Original price styling - more elegant */
.original-price.price-animated {
    position: relative;
    color: #888;
    margin-right: 8px;
    font-size: 0.9em;
}

/* Create a premium strike-through line for original prices */
.original-price.price-animated::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(228, 27, 23, 0.8), transparent);
    transition: width 0.4s ease-out;
    animation-fill-mode: forwards;
}

/* ==== HOVER EFFECTS ==== */

/* Hover effects for all product cards */
.product-card:hover .price-animated {
    z-index: 2;
}

/* Premium hover effect for discount prices */
.product-card:hover .discount-price.price-animated,
.product-card:hover .current-price.price-animated {
    animation: premiumDiscountPulse 1.5s infinite ease-in-out, premiumPriceShimmer 2s infinite linear;
    transform-origin: center;
    filter: drop-shadow(0 0 3px rgba(228, 27, 23, 0.3));
}

/* Premium hover for regular prices */
.product-card:hover .regular-price.price-animated {
    animation: premiumPriceFloat 3s infinite ease-in-out;
    text-shadow: 0 5px 15px rgba(42, 110, 227, 0.4);
}

/* Premium hover for original prices - animate the strike-through */
.product-card:hover .original-price.price-animated::after {
    animation: premiumStrikeThrough 0.4s forwards ease-out;
}

/* ==== RESPONSIVE ADJUSTMENTS ==== */
@media (max-width: 768px) {
    .discount-price.price-animated,
    .current-price.price-animated,
    .regular-price.price-animated {
        font-size: 1em;
    }
    
    .original-price.price-animated {
        font-size: 0.8em;
    }
}
