/* Animation de livraison gratuite moderne */
.tf-mini-cart-threshold {
    position: relative;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tf-mini-cart-threshold.completed {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f1d4 100%);
    animation: completedPulse 2s ease-in-out;
}

@keyframes completedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.tf-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 100%);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    --progress-width: 0%;
}

.tf-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress-width);
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #7c3aed 100%);
    border-radius: 20px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tf-progress-bar.completed::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    animation: progressShine 1.5s ease-in-out;
}

@keyframes progressShine {
    0% { box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }
}

.progress-car {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: calc(var(--progress-width, 0%) - 12px);
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    color: #4f46e5;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    --progress-width: 0%;
}

.progress-car.completed {
    color: #10b981;
    animation: carBounce 0.6s ease-in-out;
}

@keyframes carBounce {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

.progress-car svg {
    width: 24px;
    height: 16px;
    transition: all 0.3s ease;
}

.tf-progress-msg {
    font-size: 14px;
    color: #374151;
    text-align: center;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.tf-progress-msg.completed {
    color: #059669;
    font-weight: 600;
}

.tf-progress-msg .price {
    color: inherit;
    font-weight: 600;
}

.tf-progress-msg.completed .price {
    color: #10b981;
}

/* Animation de célébration avec cadeau */
.gift-celebration {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.gift-celebration.active {
    opacity: 1;
    animation: giftPop 1.2s ease-in-out;
}

@keyframes giftPop {
    0% { 
        transform: translateY(-50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    50% { 
        transform: translateY(-50%) scale(1.3) rotate(180deg);
        opacity: 1;
    }
    70% { 
        transform: translateY(-50%) scale(0.9) rotate(360deg);
    }
    100% { 
        transform: translateY(-50%) scale(1) rotate(360deg);
        opacity: 1;
    }
}

.gift-celebration svg {
    width: 28px;
    height: 28px;
    color: #10b981;
    filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.4));
}

/* Particules de célébration */
.celebration-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    opacity: 0;
}

.particle.active {
    animation: particleFloat 1.5s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0);
    }
}

/* Animation de pulsation pour attirer l'attention */
.tf-mini-cart-threshold.near-completion {
    animation: nearCompletionPulse 2s ease-in-out infinite;
}

@keyframes nearCompletionPulse {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
    }
    50% { 
        box-shadow: 0 8px 24px rgba(79, 70, 229, 0.2);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .tf-mini-cart-threshold {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .tf-progress-msg {
        font-size: 13px;
    }
    
    .progress-car svg {
        width: 20px;
        height: 14px;
    }
    
    .gift-celebration svg {
        width: 24px;
        height: 24px;
    }
}
