/**
 * ITPlus WooCommerce Discounts - Frontend CSS
 */

/* Quantity Discount Badge */
.quantity-discount-info {
    margin: 10px 0;
}

.quantity-discount-info .discount-badge {
    display: inline-block;
    background: #5a3e85;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Quantity Discount Info Box */
.quantity-discount-info-box {
    background: #f3eef8;
    border: 1px solid #5a3e85;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.quantity-discount-info-box strong {
    color: #5a3e85;
}

/* Price Display with Discount */
.has-quantity-discount {
    display: block;
    font-size: 12px;
    color: #5a3e85;
    margin-top: 5px;
}

/* Cart Item Discount */
.discount-type {
    color: #5a3e85;
    font-weight: 500;
}

/* Checkout Discount Summary */
.checkout-quantity-discounts {
    background: #f3eef8;
    border: 1px solid #5a3e85;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.checkout-quantity-discounts strong {
    color: #5a3e85;
}

/* Customer Discount Badge */
.customer-discount-badge {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-top: 5px;
}

/* Customer Discount Account Info */
.itplus-customer-discount-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.itplus-customer-discount-info h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #fff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

.itplus-customer-discount-info .discount-details p {
    margin: 8px 0;
}

.itplus-customer-discount-info .discount-details strong {
    opacity: 0.8;
    margin-right: 5px;
}

/* Customer Discount Shortcode */
.itplus-customer-discount-shortcode {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 5px;
}

.itplus-customer-discount-shortcode .discount-value {
    font-weight: 700;
    color: #00a32a;
    font-size: 1.2em;
}

.itplus-customer-discount-shortcode .discount-expiry {
    font-size: 0.85em;
    color: #666;
}

/* Discount Notice */
.woocommerce-info.itplus-discount-notice {
    border-color: #00a32a;
    background: #f0f9f0;
}

.woocommerce-info.itplus-discount-notice::before {
    color: #00a32a;
}

/* Quantity Discount Table Wrapper */
.quantity-discount-table-wrapper {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Header */
.quantity-discount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #5a3e85 0%, #2e1a47 100%);
    color: #fff;
    padding: 12px 16px;
}

.quantity-discount-header .header-title {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quantity-discount-header .header-price {
    font-size: 13px;
    opacity: 0.9;
}

/* Meta Section */
.quantity-discount-meta {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
}

.quantity-discount-stacking-note {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-bottom: 8px;
}

.quantity-discount-current-info {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    display: none;
}

.quantity-discount-current-info.active {
    display: block;
}

.quantity-discount-total-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    display: none;
}

.quantity-discount-total-preview.active {
    display: block;
}

.quantity-discount-total-preview .total-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin: 4px 0;
}

.quantity-discount-total-preview .total-including {
    font-weight: 600;
    color: #5a3e85;
}

.quantity-discount-total-preview .total-excluding {
    color: #666;
}

/* Table */
.quantity-discount-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.quantity-discount-table thead {
    background: #f0f0f0;
}

.quantity-discount-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e5e5;
}

.quantity-discount-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.quantity-discount-table tbody tr:last-child td {
    border-bottom: none;
}

.quantity-discount-table tbody tr {
    transition: background-color 0.2s ease;
}

.quantity-discount-table tbody tr:hover {
    background: #f8f9fa;
}

.quantity-discount-table tbody tr.current-tier,
.quantity-discount-table tbody tr.active-tier {
    background: #f3eef8;
}

.quantity-discount-table tbody tr.base-price-row {
    background: #fafafa;
}

/* Table Cells */
.quantity-discount-table .quantity-range {
    width: 40%;
}

.quantity-discount-table .quantity-range .range-label {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.quantity-discount-table .quantity-range .range-note {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.quantity-discount-table .price-cell {
    width: 60%;
}

.quantity-discount-table .price-cell .price-value {
    display: block;
    font-weight: 600;
    color: #5a3e85;
    font-size: 15px;
}

.quantity-discount-table .price-cell .price-note {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.quantity-discount-table .base-price-row .price-cell .price-value {
    color: #666;
}

.quantity-discount-table .no-discounts {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

/* Product Discount Row */
.quantity-discount-table tr.product-discount .range-note {
    color: #5a3e85;
}

/* Category Discount Row */
.quantity-discount-table tr.category-discount .range-note {
    color: #2271b1;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .quantity-discount-info-box,
    .checkout-quantity-discounts {
        padding: 10px;
    }
    
    .itplus-customer-discount-info {
        padding: 15px;
    }
    
    .quantity-discount-table th,
    .quantity-discount-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .quantity-discount-header {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .quantity-discount-table .quantity-range,
    .quantity-discount-table .price-cell {
        width: 50%;
    }
}

/* Clickable Table Rows */
.quantity-discount-table tbody tr {
    cursor: pointer;
}

/* Live Discount Info */
.quantity-discount-live-info {
    margin: 15px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f3eef8 0%, #e8dff5 100%);
    border: 1px solid #5a3e85;
    border-radius: 8px;
}

.quantity-discount-live-info .discount-applied {
    color: #2e1a47;
}

.quantity-discount-live-info .discount-label {
    font-size: 14px;
}

.quantity-discount-live-info .discount-value {
    font-weight: 700;
    font-size: 18px;
}

.quantity-discount-live-info small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.8;
}
