/**
 * Dynamic Bucket Pricing Frontend Styles
 */

/* Pricing Container Styles */
.wc-pricing-container {
    display: inline-block;
    line-height: 1.4;
}

.wc-pricing-container .original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9em;
}

.wc-pricing-container .dynamic-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1em;
}

/* Pricing Information Box */
.wc-pricing-info {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #ba243a;
    border-radius: 4px;
}

.wc-pricing-info h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #ba243a;
    font-size: 1.2em;
}

.wc-pricing-info p {
    margin-bottom: 8px;
}

.wc-pricing-info small {
    color: #666;
    font-style: italic;
}

/* Quantity Pricing Table */
.wc-pricing-table {
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.wc-pricing-table h4 {
    margin: 0;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-size: 1.1em;
    color: #333;
}

.wc-pricing-table .shop_table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.wc-pricing-table .shop_table th {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #ddd;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.wc-pricing-table .shop_table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.wc-pricing-table .shop_table tr:last-child td {
    border-bottom: none;
}

.wc-pricing-table .shop_table tr:hover {
    background-color: #f9f9f9;
}

/* Cart Pricing Styles */
.wc-pricing-cart-price {
    line-height: 1.4;
}

.wc-pricing-cart-price .original-price {
    color: #999;
    font-size: 0.9em;
}

.wc-pricing-cart-price .dynamic-price {
    color: #e74c3c;
    font-weight: bold;
}

.wc-pricing-cart-subtotal {
    line-height: 1.4;
}

.wc-pricing-cart-subtotal .original-subtotal {
    color: #999;
    font-size: 0.9em;
}

.wc-pricing-cart-subtotal .dynamic-subtotal {
    color: #e74c3c;
    font-weight: bold;
}

.wc-pricing-cart-subtotal .savings-info {
    color: #27ae60;
    font-weight: normal;
}

/* Savings Display */
.wc-pricing-savings {
    margin-top: 10px;
    padding: 10px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
}

.wc-pricing-savings .savings-info {
    margin: 0;
}

.wc-pricing-savings strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 5px;
}

/* Enhanced Quantity Input */
.wc-pricing-enhanced {
    border: 2px solid #ba243a !important;
    border-radius: 4px !important;
}

/* Loading States */
.wc-pricing-loading {
    opacity: 0.6;
    transition: opacity 0.3s ease;
    position: relative;
}

.wc-pricing-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ba243a;
    border-radius: 50%;
    animation: wc-pricing-spin 1s linear infinite;
}

@keyframes wc-pricing-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cart Update States */
.wc-pricing-updating {
    background-color: #fff3cd !important;
    transition: background-color 0.3s ease;
}

.wc-pricing-discounted {
    background-color: #d1edff !important;
    transition: background-color 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wc-pricing-savings {
    animation: fadeIn 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-pricing-info {
        margin: 10px 0;
        padding: 12px;
    }
    
    .wc-pricing-table .shop_table th,
    .wc-pricing-table .shop_table td {
        padding: 8px;
        font-size: 0.9em;
    }
    
    
    .wc-pricing-container {
        display: block;
        line-height: 1.6;
    }
    
    .wc-pricing-container .original-price {
        display: block;
        margin-bottom: 2px;
    }
}

@media (max-width: 480px) {
    .wc-pricing-table {
        font-size: 0.85em;
    }
    
    .wc-pricing-table .shop_table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Print Styles */
@media print {
    .wc-pricing-loading::after {
        display: none !important;
    }
    
    .wc-pricing-info {
        border: 1px solid #000;
        background: transparent;
    }
    
    .wc-pricing-table {
        border: 1px solid #000;
    }
    
    .wc-pricing-container .original-price {
        color: #000;
    }
    
    .wc-pricing-container .dynamic-price {
        color: #000;
        font-weight: bold;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wc-pricing-info {
        border-left-width: 6px;
        background: #fff;
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .wc-pricing-loading,
    .wc-pricing-savings,
    .wc-pricing-updating,
    .wc-pricing-discounted {
        transition: none;
        animation: none;
    }
    
    .wc-pricing-loading::after {
        animation: none;
        display: none;
    }
}
