/**
 * Modern WooCommerce Payment Plan Slider Styles
 * Modern design with smooth animations and responsive layout
 * Version: 2.0.0
 */

/* Hide default cart elements */
tr.cart-subtotal,
.cart-items-total-price.total-price,
.widget_shopping_cart .buttons .checkout {
    display: none !important;
}

.button.checkout.wc-forward {
    display: none !important;
}

.woocommerce-cart table.shop_table th.product-price,
.woocommerce-cart table.shop_table td.product-price {
    display: none;
}

/* Main Payment Slider Container */
.wps-payment-slider {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.wps-payment-slider:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

/* Slider Header */
.wps-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.wps-slider-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0;
}

.wps-term-display {
    background: linear-gradient(135deg, #0071a1 0%, #005077 100%);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 113, 161, 0.3);
    white-space: nowrap;
}

/* Modern Range Slider Container */
.wps-slider-container {
    position: relative;
    margin: 1.5rem 0;
}

/* Modern Range Slider */
.wps-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(
        to right, 
        #0071a1 0%, 
        #0071a1 var(--progress, 33%), 
        #dee2e6 var(--progress, 33%), 
        #dee2e6 100%
    );
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0;
}

.wps-range-slider:hover {
    background: linear-gradient(
        to right, 
        #005077 0%, 
        #005077 var(--progress, 33%), 
        #ced4da var(--progress, 33%), 
        #ced4da 100%
    );
}

.wps-range-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Webkit Slider Thumb */
.wps-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0071a1 0%, #005077 100%);
    border: 3px solid white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 113, 161, 0.4);
    transition: all 0.3s ease;
}

.wps-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 113, 161, 0.5);
}

.wps-range-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

/* Firefox Slider Thumb */
.wps-range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0071a1 0%, #005077 100%);
    border: 3px solid white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 113, 161, 0.4);
    transition: all 0.3s ease;
}

.wps-range-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 113, 161, 0.5);
}

/* Slider Labels */
.wps-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    flex-wrap: wrap;
}

.wps-slider-labels span {
    text-align: center;
    flex: 1;
    min-width: 60px;
}

/* Payment Summary */
.wps-payment-summary {
    background: white;
    border: 2px solid #0071a1;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.wps-payment-summary.calculating {
    opacity: 0.7;
}

.wps-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3f4;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wps-summary-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    font-weight: 600;
    color: #0071a1;
    border-top: 2px solid #e9ecef;
    padding-top: 0.8rem;
    margin-top: 0.5rem;
}

.wps-summary-label {
    color: #6c757d;
    font-size: 0.9rem;
    flex: 1;
    min-width: 120px;
}

.wps-summary-value {
    font-weight: 500;
    color: #2c3e50;
    text-align: right;
}

.wps-summary-total .wps-summary-value {
    font-size: 1.1rem;
    color: #0071a1;
}

/* Locked State */
.wps-payment-slider.slider-locked {
    opacity: 0.6;
    pointer-events: none;
}

.wps-locked-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(133, 100, 4, 0.1);
}

/* Price Display Enhancements */
.wps-weekly-price {
    display: inline-block;
    font-weight: bold;
    color: #0071a1;
    transition: all 0.3s ease;
}

.wps-price-period,
.wps-term-small,
.wps-subtotal-term {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
}

.wps-original-price,
.wps-subtotal-original {
    color: #6c757d;
    font-size: 0.85rem;
    text-decoration: line-through;
}

/* Animation for price changes */
.price-animate {
    animation: priceUpdate 0.3s ease-out;
}

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Loading state animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.calculating {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Cart Total Styling */
#wps-cart-total {
    font-weight: 600;
    color: #0071a1;
}

/* Mobile Responsive Design */
@media screen and (max-width: 768px) {
    .wps-payment-slider {
        margin: 1rem 0;
        padding: 1.5rem;
        border-radius: 8px;
    }
    
    .wps-slider-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        text-align: left;
    }
    
    .wps-term-display {
        align-self: stretch;
        text-align: center;
    }
    
    .wps-range-slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }
    
    .wps-range-slider::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
    
    .wps-payment-summary {
        padding: 1rem;
    }
    
    .wps-summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .wps-summary-value {
        text-align: left;
        align-self: flex-end;
    }
    
    .wps-slider-labels {
        font-size: 0.7rem;
    }
    
    .wps-slider-labels span {
        min-width: 50px;
    }
}

@media screen and (max-width: 480px) {
    .wps-payment-slider {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .wps-slider-header {
        gap: 0.8rem;
    }
    
    .wps-slider-label {
        font-size: 1rem;
    }
    
    .wps-term-display {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .wps-range-slider {
        height: 10px;
    }
    
    .wps-range-slider::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }
    
    .wps-range-slider::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }
    
    .wps-payment-summary {
        padding: 0.8rem;
    }
    
    .wps-summary-label,
    .wps-summary-value {
        font-size: 0.85rem;
    }
    
    .wps-slider-labels {
        display: none; /* Hide labels on very small screens */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wps-payment-slider {
        border: 2px solid #000;
        background: #fff;
    }
    
    .wps-range-slider {
        background: linear-gradient(
            to right, 
            #000 0%, 
            #000 var(--progress, 33%), 
            #ccc var(--progress, 33%), 
            #ccc 100%
        );
    }
    
    .wps-range-slider::-webkit-slider-thumb {
        background: #000;
        border: 2px solid #fff;
    }
    
    .wps-term-display {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wps-payment-slider,
    .wps-range-slider,
    .wps-range-slider::-webkit-slider-thumb,
    .wps-range-slider::-moz-range-thumb,
    .wps-payment-summary,
    .wps-weekly-price {
        transition: none;
        animation: none;
    }
}

/* Focus styles for accessibility */
.wps-range-slider:focus {
    outline: 2px solid #0071a1;
    outline-offset: 2px;
}

.wps-range-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(0, 113, 161, 0.3);
}

.wps-range-slider:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(0, 113, 161, 0.3);
}

/* Print styles */
@media print {
    .wps-payment-slider {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .wps-range-slider {
        display: none;
    }
    
    .wps-slider-container::after {
        content: "Interactive slider - see website for payment options";
        display: block;
        font-style: italic;
        color: #666;
        text-align: center;
        margin: 1rem 0;
    }
}
.my-account {
  display: none !important;
}