/* Widgetry Pro - WooCommerce Bulk Pricing Table Styles */

/* Base Styles */
.widgetry-bulk-pricing {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Top Section: Quantity Selector and Pricing Summary */
.pricing-top-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #333333;
    border-radius: 4px;
    background: #ffffff;
    overflow: hidden;
    min-width: 120px;
}

.quantity-selector .qty-btn {
    background: #ffffff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.quantity-selector .qty-btn:hover {
    background: #f5f5f5;
}

.quantity-selector .qty-btn:active {
    background: #e0e0e0;
}

.quantity-selector .qty-input {
    border: none;
    outline: none;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    background: #ffffff;
    padding: 8px 12px;
    min-width: 60px;
    max-width: 80px;
}

.quantity-selector .qty-input::-webkit-outer-spin-button,
.quantity-selector .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-selector .qty-input[type=number] {
    -moz-appearance: textfield;
}

/* Pricing Summary */
.pricing-summary {
    font-size: 16px;
    font-weight: 500;
    color: #2C5F5F;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.pricing-summary .separator {
    color: #2C5F5F;
}

.pricing-summary .subtotal {
    color: #00A651;
    font-weight: 600;
}

.pricing-summary .price-value,
.pricing-summary .subtotal-value {
    font-weight: 600;
}

/* Tax Disclaimer */
.tax-disclaimer {
    font-size: 12px;
    color: #999999;
    margin-top: 5px;
    width: 100%;
}

/* Promotional Text */
.promotional-text {
    font-size: 16px;
    font-weight: 600;
    color: #2C5F5F;
    margin-bottom: 20px;
    text-align: left;
}

/* Pricing Table Container */
.pricing-table-container {
    width: 100%;
    overflow-x: auto;
}

/* Pricing Table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

.pricing-table th {
    background: #ffffff;
    color: #999999;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-family: 'Poppins', sans-serif;
}

.pricing-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    color: #2C5F5F;
    font-family: 'Poppins', sans-serif;
}

.pricing-table tbody tr {
    transition: background-color 0.2s ease;
}

.pricing-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Highlighted Row */
.pricing-table tr.highlighted {
    background-color: #2C5F5F !important;
}

.pricing-table tr.highlighted td {
    color: #ffffff !important;
    font-weight: 600;
}

.pricing-table tr.highlighted:hover {
    background-color: #2C5F5F !important;
}

/* Table Column Styling */
.pricing-table th:nth-child(1),
.pricing-table td:nth-child(1) {
    text-align: left;
    font-weight: 600;
}

.pricing-table th:nth-child(2),
.pricing-table td:nth-child(2) {
    text-align: center;
}

.pricing-table th:nth-child(3),
.pricing-table td:nth-child(3) {
    text-align: right;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pricing-top-section {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .quantity-selector {
        align-self: flex-start;
        min-width: 140px;
    }
    
    .pricing-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        min-width: auto;
    }
    
    .pricing-table {
        font-size: 13px;
    }
    
    .pricing-table th,
    .pricing-table td {
        padding: 10px 12px;
    }
    
    .promotional-text {
        font-size: 14px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .widgetry-bulk-pricing {
        padding: 15px;
    }
    
    .pricing-table th,
    .pricing-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .quantity-selector .qty-input {
        min-width: 50px;
        max-width: 60px;
    }
    
    .quantity-selector .qty-btn {
        min-width: 35px;
        padding: 6px 8px;
    }
}

/* Animation for quantity changes */
.pricing-summary .price-value,
.pricing-summary .subtotal-value {
    transition: color 0.3s ease;
}

.pricing-table tbody tr {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.quantity-selector .qty-input:focus {
    outline: 2px solid #2C5F5F;
    outline-offset: 2px;
}

.quantity-selector .qty-btn:focus {
    outline: 2px solid #2C5F5F;
    outline-offset: 2px;
}

/* Loading state */
.widgetry-bulk-pricing.loading .pricing-summary .price-value,
.widgetry-bulk-pricing.loading .pricing-summary .subtotal-value {
    opacity: 0.6;
}

/* Error state */
.widgetry-bulk-pricing.error .quantity-selector {
    border-color: #e74c3c;
}

.widgetry-bulk-pricing.error .quantity-selector .qty-input {
    color: #e74c3c;
}

/* Success state for quantity updates */
.widgetry-bulk-pricing.success .pricing-summary .subtotal {
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% { background-color: transparent; }
    50% { background-color: rgba(0, 166, 81, 0.1); }
    100% { background-color: transparent; }
}

/* Print styles */
@media print {
    .widgetry-bulk-pricing {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .quantity-selector .qty-btn {
        display: none;
    }
    
    .quantity-selector .qty-input {
        border: 1px solid #000;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .widgetry-bulk-pricing {
        border: 2px solid #000;
    }
    
    .pricing-table th,
    .pricing-table td {
        border-bottom: 2px solid #000;
    }
    
    .pricing-table tr.highlighted {
        background-color: #000 !important;
        color: #fff !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pricing-summary .price-value,
    .pricing-summary .subtotal-value,
    .pricing-table tbody tr,
    .quantity-selector .qty-btn {
        transition: none;
    }
    
    .widgetry-bulk-pricing.success .pricing-summary .subtotal {
        animation: none;
    }
}
