/**
 * Streamline Shipping Cart Loading Styles
 */

/* Loading overlay for cart totals */
.streamline-shipping-loading {
    position: relative;
}

.streamline-shipping-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading animation container */
.streamline-loading-container {
    text-align: center;
    padding: 20px;
    max-width: 300px;
}

/* Animated truck icon */
.streamline-truck-loader {
    width: 60px;
    height: 40px;
    margin: 0 auto 15px;
    position: relative;
}

.streamline-truck-loader .truck-body {
    width: 40px;
    height: 30px;
    background: #2271b1;
    border-radius: 4px;
    position: absolute;
    left: 0;
    top: 5px;
    animation: truck-bounce 0.5s ease-in-out infinite alternate;
}

.streamline-truck-loader .truck-cab {
    width: 15px;
    height: 20px;
    background: #1a5490;
    border-radius: 0 4px 4px 0;
    position: absolute;
    right: 5px;
    top: 10px;
}

.streamline-truck-loader .wheel {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    bottom: -4px;
    animation: wheel-spin 1s linear infinite;
}

.streamline-truck-loader .wheel.front {
    left: 8px;
}

.streamline-truck-loader .wheel.back {
    right: 12px;
}

@keyframes truck-bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

@keyframes wheel-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress steps */
.streamline-loading-steps {
    margin-top: 20px;
}

.streamline-loading-step {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.streamline-loading-step.active {
    opacity: 1;
    color: #2271b1;
}

.streamline-loading-step.completed {
    opacity: 1;
    color: #46b450;
}

.streamline-loading-step .step-icon {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.streamline-loading-step.active .step-icon::after {
    content: '';
    width: 10px;
    height: 10px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

.streamline-loading-step.completed .step-icon::after {
    content: '✓';
    font-weight: bold;
    animation: none;
}

@keyframes pulse {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Loading message */
.streamline-loading-message {
    font-size: 16px;
    color: #2271b1;
    margin-bottom: 15px;
    font-weight: 500;
}

.streamline-loading-submessage {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Shipping method skeleton loader */
.streamline-shipping-skeleton {
    background: #f7f7f7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.streamline-shipping-skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: skeleton-shimmer 2s infinite;
}

.skeleton-line {
    height: 12px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

@keyframes skeleton-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Smooth transitions */
.shipping .amount {
    transition: all 0.3s ease;
}

.shipping-calculator-form {
    transition: opacity 0.3s ease;
}

.streamline-shipping-loading .shipping-calculator-form {
    opacity: 0.5;
    pointer-events: none;
}