/**
 * Free Shipping Bar - Frontend Styles
 */

.fsb-progress-wrapper {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Mini cart specific styles */
.widget_shopping_cart .fsb-progress-wrapper,
.woocommerce-mini-cart .fsb-progress-wrapper {
    margin: 10px 0;
    padding: 12px 15px;
    font-size: 13px;
}

/* Message */
.fsb-message {
    font-size: 16px;
    font-weight: 600;
    color: var(--fsb-text-color, #333);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fsb-message.fsb-success {
    color: var(--fsb-success-color, #4CAF50);
}

.fsb-icon {
    font-size: 20px;
}

.fsb-message .woocommerce-Price-amount {
    font-weight: 700;
    color: var(--fsb-bar-color, #4CAF50);
}

/* Mini cart message */
.widget_shopping_cart .fsb-message,
.woocommerce-mini-cart .fsb-message {
    font-size: 13px;
    margin-bottom: 8px;
}

.widget_shopping_cart .fsb-icon,
.woocommerce-mini-cart .fsb-icon {
    font-size: 16px;
}

/* Progress bar container */
.fsb-progress-bar {
    height: 12px;
    background: var(--fsb-bar-bg, #e0e0e0);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

/* Mini cart progress bar */
.widget_shopping_cart .fsb-progress-bar,
.woocommerce-mini-cart .fsb-progress-bar {
    height: 8px;
    border-radius: 4px;
}

/* Progress fill */
.fsb-progress-fill {
    height: 100%;
    background: var(--fsb-bar-color, #4CAF50);
    border-radius: 6px;
    transition: width 0.5s ease-out;
    position: relative;
}

/* Animated stripes for active progress */
.fsb-progress-fill:not(.fsb-complete) {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: fsb-stripes 1s linear infinite;
}

@keyframes fsb-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

/* Completed state - solid with checkmark pulse */
.fsb-progress-fill.fsb-complete {
    background-image: none;
    animation: fsb-pulse 2s ease-in-out infinite;
}

@keyframes fsb-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* Progress labels */
.fsb-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.fsb-progress-labels .woocommerce-Price-amount {
    font-weight: 600;
}

.fsb-current {
    color: var(--fsb-bar-color, #4CAF50);
}

.fsb-target {
    color: #999;
}

/* Mini cart labels */
.widget_shopping_cart .fsb-progress-labels,
.woocommerce-mini-cart .fsb-progress-labels {
    font-size: 11px;
    margin-top: 5px;
}

/* Shake animation for almost there */
.fsb-progress-wrapper.fsb-almost-there {
    animation: fsb-shake 0.5s ease-in-out;
}

@keyframes fsb-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

/* Success celebration animation */
.fsb-progress-wrapper.fsb-just-qualified {
    animation: fsb-celebrate 0.6s ease-out;
}

@keyframes fsb-celebrate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .fsb-progress-wrapper {
        padding: 12px 15px;
    }

    .fsb-message {
        font-size: 14px;
    }

    .fsb-icon {
        font-size: 18px;
    }

    .fsb-progress-bar {
        height: 10px;
    }
}
