/**
 * Free Delivery Meter Styles
 */

.fdm-meter {
    margin: 15px 0;
    padding: 15px;
    background: var(--fdm-background-color, #f8f9fa);
    border: 1px solid var(--fdm-border-color, #dee2e6);
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fdm-meter-mini-cart {
    margin: 10px 0;
    padding: 12px;
    font-size: 13px;
}

.fdm-mini-cart-item {
    list-style: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    margin: 0;
}

.fdm-mini-cart-item:last-child {
    border-bottom: none;
}

/* Override default mini cart list item styling for FDM */
.product_list_widget .fdm-mini-cart-item {
    padding: 1em 0 0 0 !important;
    border-bottom: none !important;
}

.fdm-cart-page-wrapper {
    margin: 20px 0;
    clear: both;
}

.fdm-meter-cart-page {
    margin: 0;
    padding: 20px;
}

.fdm-meter-checkout {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 2px solid var(--fdm-progress-color, #0073aa);
}

.fdm-meter-checkout-order {
    margin: 10px 0;
    padding: 12px;
    background: var(--fdm-background-color, #f8f9fa);
    border: 1px solid var(--fdm-border-color, #dee2e6);
    border-radius: 6px;
    font-size: 13px;
}

.fdm-meter-content {
    text-align: center;
}

/* Progress Message (above bar) */
.fdm-progress-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--fdm-text-color, #333333);
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: center;
}

.fdm-meter-mini-cart .fdm-progress-message {
    font-size: 12px;
    margin-bottom: 8px;
}

/* Legacy support for old class name */
.fdm-custom-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--fdm-text-color, #333333);
    margin-bottom: 10px;
    line-height: 1.4;
}

.fdm-meter-mini-cart .fdm-custom-message {
    font-size: 12px;
    margin-bottom: 8px;
}

/* Terms & Conditions */
.fdm-terms-conditions {
    font-size: 11px;
    color: #666666;
    margin-top: 8px;
    line-height: 1.3;
    font-style: italic;
    text-align: center;
}

.fdm-meter-mini-cart .fdm-terms-conditions {
    font-size: 10px;
    margin-top: 6px;
}

/* Checkout Order Section Specific Styling */
.fdm-meter-checkout-order .fdm-custom-message {
    font-size: 13px;
    margin-bottom: 8px;
}

.fdm-meter-checkout-order .fdm-progress-text {
    font-size: 12px;
}

.fdm-meter-checkout-order .fdm-terms-conditions {
    font-size: 10px;
    margin-top: 6px;
}

.fdm-meter-checkout-order .fdm-success-message {
    font-size: 13px;
}

.fdm-meter-checkout-order .fdm-success-icon {
    width: 20px;
    height: 20px;
    font-size: 12px;
}

/* Shortcode Styling */
.fdm-meter-shortcode {
    margin: 15px 0;
    padding: 15px;
    background: var(--fdm-background-color, #f8f9fa);
    border: 1px solid var(--fdm-border-color, #dee2e6);
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Hide any duplicate checkout meters - temporarily disabled */
/* .fdm-meter-checkout-order:not(:first-of-type) {
    display: none !important;
} */

/* Success Message */
.fdm-success-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #28a745;
    font-weight: 600;
}

.fdm-success-icon {
    width: 24px;
    height: 24px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.fdm-success-text {
    font-size: 16px;
}

.fdm-meter-mini-cart .fdm-success-text {
    font-size: 13px;
}

/* Progress Container */
.fdm-progress-container {
    width: 100%;
}

.fdm-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.fdm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fdm-progress-color, #0073aa) 0%, var(--fdm-progress-color, #0073aa) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.fdm-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.fdm-progress-text {
    color: var(--fdm-text-color, #333333);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    margin-top: 5px;
}

.fdm-meter-mini-cart .fdm-progress-text {
    font-size: 12px;
    margin-top: 3px;
}

.fdm-amount {
    color: var(--fdm-progress-color, #0073aa);
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fdm-meter {
        margin: 10px 0;
        padding: 12px;
    }
    
    .fdm-meter-cart-page {
        margin: 15px 0;
        padding: 15px;
    }
    
    .fdm-success-message {
        flex-direction: column;
        gap: 8px;
    }
    
    .fdm-progress-text {
        font-size: 13px;
    }
    
    .fdm-progress-message {
        font-size: 13px;
    }
    
    .fdm-custom-message {
        font-size: 13px;
    }
    
    .fdm-terms-conditions {
        font-size: 10px;
    }
    
    .fdm-meter-checkout-order {
        margin: 8px 0;
        padding: 10px;
        font-size: 12px;
    }
    
    .fdm-meter-checkout-order .fdm-custom-message {
        font-size: 12px;
    }
    
    .fdm-meter-checkout-order .fdm-progress-text {
        font-size: 11px;
    }
    
    .fdm-meter-checkout-order .fdm-terms-conditions {
        font-size: 9px;
    }
    
    .fdm-meter-checkout-order .fdm-progress-message {
        font-size: 12px;
    }
}

/* RTL Support */
.rtl .fdm-success-message {
    direction: rtl;
}

.rtl .fdm-progress-fill::after {
    animation: shimmer-rtl 2s infinite;
}

@keyframes shimmer-rtl {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fdm-meter {
        border-width: 2px;
    }
    
    .fdm-progress-bar {
        border: 1px solid var(--fdm-text-color, #333333);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fdm-progress-fill {
        transition: none;
    }
    
    .fdm-progress-fill::after {
        animation: none;
    }
}

/* Print styles */
@media print {
    .fdm-meter {
        border: 1px solid #000;
        background: #fff !important;
        color: #000 !important;
    }
    
    .fdm-progress-fill::after {
        display: none;
    }
}
