.free-shipping-progress-bar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 95%;
    justify-self: left;
    max-width: 400px;
}

.free-shipping-message {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

.free-shipping-message.success {
    color: #28a745 !important;
    font-weight: 600;
}

.free-shipping-message i {
    margin-right: 5px;
    font-size: 16px;
}

.progress-container {
    position: relative;
}

.progress-bar-bg {
    width: 100%;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease-in-out;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0) 50%, 
        rgba(0, 0, 0, 0.1) 100%);
    border-radius: 10px;
}

/* Progress ball at the end of the bar */
.progress-ball {
    position: absolute;
    right: -0px;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translateY(-50%);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 10;
}

/* Hide ball when progress is 0 */
.progress-bar-fill[style*="width: 0%"] .progress-ball,
.progress-bar-fill[data-progress="0"] .progress-ball {
    display: none;
}

.progress-text {
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
    font-weight: 500;
}

/* Animation for progress bar */
.progress-bar-fill {
    animation: progressAnimation 0.5s ease-out;
}

/* Ensure progress bar is always visible */
#free-shipping-progress {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

/* Consistent styling for ALL mini cart instances */
.leo-dropdown-cart .free-shipping-progress-bar,
.blockcart-modal .free-shipping-progress-bar,
.shopping-cart .free-shipping-progress-bar,
.cart-dropdown .free-shipping-progress-bar,
.dropdown-cart .free-shipping-progress-bar,
.minicart .free-shipping-progress-bar,
.cart-modal-content .free-shipping-progress-bar {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 15px;
    width: calc(100% - 30px);
    justify-self: auto;
}

/* Consistent message styling for mini carts */
.leo-dropdown-cart .free-shipping-progress-bar .free-shipping-message,
.blockcart-modal .free-shipping-progress-bar .free-shipping-message,
.shopping-cart .free-shipping-progress-bar .free-shipping-message,
.cart-dropdown .free-shipping-progress-bar .free-shipping-message,
.dropdown-cart .free-shipping-progress-bar .free-shipping-message,
.minicart .free-shipping-progress-bar .free-shipping-message,
.cart-modal-content .free-shipping-progress-bar .free-shipping-message {
    font-size: 13px;
    margin-bottom: 8px;
}

/* Consistent progress bar height for mini carts */
.leo-dropdown-cart .free-shipping-progress-bar .progress-bar-bg,
.blockcart-modal .free-shipping-progress-bar .progress-bar-bg,
.shopping-cart .free-shipping-progress-bar .progress-bar-bg,
.cart-dropdown .free-shipping-progress-bar .progress-bar-bg,
.dropdown-cart .free-shipping-progress-bar .progress-bar-bg,
.minicart .free-shipping-progress-bar .progress-bar-bg,
.cart-modal-content .free-shipping-progress-bar .progress-bar-bg {
    height: 16px;
}

/* Consistent progress text for mini carts */
.leo-dropdown-cart .free-shipping-progress-bar .progress-text,
.blockcart-modal .free-shipping-progress-bar .progress-text,
.shopping-cart .free-shipping-progress-bar .progress-text,
.cart-dropdown .free-shipping-progress-bar .progress-text,
.dropdown-cart .free-shipping-progress-bar .progress-text,
.minicart .free-shipping-progress-bar .progress-text,
.cart-modal-content .free-shipping-progress-bar .progress-text {
    font-size: 11px;
    margin-top: 4px;
}

/* Smaller progress ball for mini carts */
.leo-dropdown-cart .free-shipping-progress-bar .progress-ball,
.blockcart-modal .free-shipping-progress-bar .progress-ball,
.shopping-cart .free-shipping-progress-bar .progress-ball,
.cart-dropdown .free-shipping-progress-bar .progress-ball,
.dropdown-cart .free-shipping-progress-bar .progress-ball,
.minicart .free-shipping-progress-bar .progress-ball,
.cart-modal-content .free-shipping-progress-bar .progress-ball {
    width: 16px;
    height: 16px;
    right: -0px;
}

/* Product page specific styles - position above add to cart */
.product-add-to-cart .free-shipping-progress-bar {
    margin: 0 0 15px 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    order: -1; /* This will move it above other elements in flexbox */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.product-actions .free-shipping-progress-bar {
    margin: 0 0 15px 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

/* Cart page specific styles */
.cart .free-shipping-progress-bar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.no-initial-animation .progress-bar-fill {
    animation: none !important;
}

/* Prevent any theme from hiding the progress bar */
.free-shipping-progress-bar[style*="display: none"] {
    display: block !important;
}

.free-shipping-progress-bar[style*="visibility: hidden"] {
    visibility: visible !important;
}

.free-shipping-progress-bar[style*="opacity: 0"] {
    opacity: 1 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .free-shipping-progress-bar {
        margin: 10px;
        padding: 12px;
    }
    
    .free-shipping-message {
        font-size: 13px;
    }
    
    .progress-text {
        font-size: 11px;
    }
    
    /* Mobile mini cart styling */
    .leo-dropdown-cart .free-shipping-progress-bar,
    .blockcart-modal .free-shipping-progress-bar,
    .shopping-cart .free-shipping-progress-bar,
    .cart-dropdown .free-shipping-progress-bar,
    .dropdown-cart .free-shipping-progress-bar,
    .minicart .free-shipping-progress-bar,
    .cart-modal-content .free-shipping-progress-bar {
        margin: 8px 10px;
        padding: 10px;
        width: calc(100% - 20px);
    }
}

/* Success state animation */
.free-shipping-message.success {
    animation: successPulse 0.6s ease-in-out;
}

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

/* Loading state */
.free-shipping-progress-bar.loading .progress-bar-fill {
    background: linear-gradient(90deg, 
        #e9ecef 25%, 
        #f8f9fa 50%, 
        #e9ecef 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Additional specificity to ensure mini cart styles override theme defaults */
body .leo-dropdown-cart .free-shipping-progress-bar,
body .blockcart-modal .free-shipping-progress-bar,
body .shopping-cart .free-shipping-progress-bar,
body .cart-dropdown .free-shipping-progress-bar,
body .dropdown-cart .free-shipping-progress-bar,
body .minicart .free-shipping-progress-bar,
body .cart-modal-content .free-shipping-progress-bar {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 12px !important;
    margin: 10px 15px !important;
    width: calc(100% - 30px) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}