/*
 * Free Shipping Progress Bar Styles
 * Copyright © LexisNexis. All rights reserved.
 */

.free-shipping-progress-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    position: relative;
    overflow: hidden;
}

.free-shipping-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bb6, #28a745);
}

.progress-message {
    text-align: center;
    margin-bottom: 20px;
}

.message-text {
    font-size: 17px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    display: block;
}

.progress-bar-container {
    margin: 20px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
}

.progress-bar-background {
    background: linear-gradient(to right, #f1f3f4, #e1e5e9);
    border-radius: 25px;
    height: 35px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #dadce0;
    width: 100%;
}

.total-target-amount {
    width: 20%;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #333;
    /* background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-radius: 15px;
    border: 1px solid #c3e6cb;
    padding: 2px 5px;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; */
}

.total-target-amount-text {
    font-weight: 600;
    color: #333;
    font-size: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bb6 0%, #28a745 70%, #20c997 100%);
    border-radius: 25px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    box-shadow: 0 2px 4px rgba(0, 123, 182, 0.3);
}

.progress-bar-fill[data-progress="100"] {
    background: linear-gradient(90deg, #28a745 0%, #20c997 30%, #ffd700 70%, #ff6b35 100%);
    animation: celebration 2s ease-in-out;
}

.progress-bar-text {
    color: white;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 14px;
    color: #495057;
}

.current-total,
.target-amount {
    font-weight: 500;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.current-total {
    color: #007bb6;
}

.target-amount {
    color: #28a745;
}

/* Celebration animation for when free shipping is achieved */
@keyframes celebration {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 2px 4px rgba(0, 123, 182, 0.3);
    }
    25% { 
        transform: scale(1.02); 
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 6px 12px rgba(255, 215, 0, 0.5);
    }
    75% { 
        transform: scale(1.02); 
        box-shadow: 0 4px 8px rgba(255, 107, 53, 0.4);
    }
}

/* Confetti animation */
@keyframes confetti-fall {
    0% { 
        transform: translateY(-100vh) rotate(0deg); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh) rotate(720deg); 
        opacity: 0; 
    }
}

.confetti {
    animation: confetti-fall linear forwards;
    pointer-events: none;
    z-index: 1000;
    border-radius: 50%;
}

.progress-bar-fill.celebrating {
    animation: celebration 2s ease-in-out, glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from { 
        box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3); 
    }
    to { 
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6), 0 0 30px rgba(255, 215, 0, 0.4); 
    }
}

/* Qualified state styling */
.free-shipping-progress-bar.qualified .message-text {
    color: #28a745;
    font-size: 19px;
    font-weight: 700;
}

.free-shipping-progress-bar.qualified .progress-bar-fill {
    background: linear-gradient(90deg, #28a745 0%, #20c997 30%, #ffd700 70%, #ff6b35 100%);
}

.free-shipping-progress-bar.qualified::before {
    background: linear-gradient(90deg, #28a745, #ffd700);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .free-shipping-progress-bar {
        padding: 20px 15px;
        margin: 15px 10px;
    }
    
    .message-text {
        font-size: 15px;
    }
    
    .progress-bar-container {
        gap: 8px;
    }
    
    .progress-bar-background {
        height: 30px;
        width: 78%;
    }
    
    .total-target-amount {
        width: 12%;
        font-size: 12px;
        padding: 6px 3px;
    }
    
    .total-target-amount-text {
        font-size: 11px;
    }
    
    .progress-details {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .current-total,
    .target-amount {
        width: 100%;
        text-align: center;
    }
    
    .progress-bar-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .free-shipping-progress-bar {
        padding: 15px 10px;
    }
    
    .message-text {
        font-size: 14px;
    }
    
    .progress-bar-container {
        gap: 6px;
    }
    
    .progress-bar-background {
        height: 25px;
        width: 76%;
    }
    
    .total-target-amount {
        width: 14%;
        font-size: 11px;
        padding: 4px 2px;
    }
    
    .total-target-amount-text {
        font-size: 10px;
    }
}

/* Loading state */
.free-shipping-progress-bar.loading {
    opacity: 0.7;
}

.free-shipping-progress-bar.loading .progress-bar-fill {
    background: linear-gradient(90deg, #6c757d 0%, #adb5bd 100%);
}

/* Pulse animation for loading */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.free-shipping-progress-bar.loading .progress-bar-fill {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Specific styling when placed in checkout methods section */
.checkout-methods-items .free-shipping-progress-bar {
    margin: 15px 0;
    padding: 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checkout-methods-items .free-shipping-progress-bar .message-text {
    font-size: 15px;
    margin-bottom: 12px;
}

.checkout-methods-items .free-shipping-progress-bar .progress-bar-background {
    height: 30px;
}

.checkout-methods-items .free-shipping-progress-bar .progress-details {
    margin-top: 12px;
}

.checkout-methods-items .free-shipping-progress-bar .progress-details span {
    font-size: 13px;
}

/* Order summary specific styling */
.cart-summary .free-shipping-progress-bar {
    margin: 20px 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 18px;
}

.cart-summary .free-shipping-progress-bar .message-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive adjustments for order summary placement */
@media (max-width: 768px) {
    .checkout-methods-items .free-shipping-progress-bar {
        margin: 12px 0;
        padding: 15px;
    }
    
    .checkout-methods-items .free-shipping-progress-bar .message-text {
        font-size: 14px;
    }
    
    .checkout-methods-items .free-shipping-progress-bar .progress-bar-background {
        height: 28px;
    }
}
