/* Custom Discount Bar Styling */
.custom-discount-bar {
    /* Use a fixed starting color and a dynamic ending color */
    background: linear-gradient(90deg, #caff6c 0%, var(--bar-color-to, #51a3a3) 100%);
    color: #fff;
    padding: 10px 15px;
    font-size: 16px;
    text-align: center;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 5px;
    
    /* Stronger, combined animation for "floating orb" effect */
    animation: floating-orb 3s ease-in-out infinite alternate;
}

/* Combined Animation for Glow and Float */
@keyframes floating-orb {
    0% { 
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.6); 
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 1);
        transform: translateY(-5px);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.6); 
        transform: translateY(0);
    }
}

.custom-discount-bar #discount-bar-text {
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1em;
    margin-right: 16px;
    
    /* Enhanced text shadow for maximum visibility */
    text-shadow: 0 0 5px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.8);
}

/* progress container */
.custom-discount-bar .progress-container {
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    height: 12px;
    width: 230px;
    overflow: hidden;
    position: relative;
}

/* progress bar with dynamic colors via CSS variables */
.custom-discount-bar .progress-bar {
    background: linear-gradient(90deg, var(--progress-color-from, #ffffff) 0%, var(--progress-color-to, #cccccc) 100%);
    height: 100%;
    width: 0;
    /* Use cubic-bezier for a smooth, attractive animation */
    transition: width 0.45s cubic-bezier(.2,.8,.2,1), background 0.6s ease;
    
    /* More noticeable progress-bar glow */
    animation: progress-glow 2.8s ease-in-out infinite alternate;
}

/* More prominent glow specifically for progress bar */
@keyframes progress-glow {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
    100% { box-shadow: 0 0 25px rgba(255, 255, 255, 0.6); }
}

/* --- Existing milestone flash (unchanged) --- */
@keyframes milestone-flash-bounce {
    0% { transform: scale(1); }
    20% { transform: scale(1.03); }
    40% { transform: scale(1); }
    60% { transform: scale(1.03); }
    80% { transform: scale(1); }
    100% { transform: scale(1); }
}

.milestone-notification-flash {
    animation: milestone-flash-bounce 2s ease-in-out forwards;
}

.milestone-notification-flash #discount-bar-text {
    animation: text-emphasis 0.5s ease-in-out infinite alternate;
}

@keyframes text-emphasis {
    from { color: #fff; transform: scale(1); }
    to { color: #FFD700; transform: scale(1.05); }
}

/* --- Mobile responsiveness --- */
@media (max-width: 768px) {
    .custom-discount-bar {
        flex-direction: column;
        font-size: 14px;
        text-align: center;
        padding: 8px;
    }

    .custom-discount-bar #discount-bar-text {
        margin-right: 0;
        margin-bottom: 8px;
        font-size: 1em;
    }

    .custom-discount-bar .progress-container {
        width: 100%;
        max-width: 320px;
        height: 10px;
    }
}