/**
 * Tatamix Quantity Discount - Frontend Styles
 *
 * @package Tatamix_Quantity_Discount
 */

/* ==========================================================================
   Minimum Quantity Notice
   ========================================================================== */

.tatamix-min-qty-notice {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 16px;
    background-color: #fff8e5;
    border-left: 4px solid #ffb900;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.tatamix-min-qty-icon {
    margin-right: 10px;
    font-size: 18px;
    color: #ffb900;
    flex-shrink: 0;
}

.tatamix-min-qty-text strong {
    font-weight: 700;
}

/* ==========================================================================
   Discount Table
   ========================================================================== */

.tatamix-discount-table-wrap {
    margin: 15px 0 20px;
}

.tatamix-discount-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    font-size: 14px;
}

.tatamix-discount-table thead {
    background: #1a3a2a;
}

.tatamix-discount-table thead th {
    padding: 10px 14px;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #0e2218;
}

.tatamix-discount-table tbody tr {
    transition: background-color 0.15s ease;
}

.tatamix-discount-table tbody tr:nth-child(even) {
    background-color: #f8faf8;
}

.tatamix-discount-table tbody tr:hover {
    background-color: #eef5ee;
}

.tatamix-discount-table tbody tr.tatamix-tier-active {
    background-color: #e8f5e9 !important;
    font-weight: 600;
}

.tatamix-discount-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
}

.tatamix-discount-table tbody td:first-child {
    white-space: nowrap;
}

/* Savings column */
.tatamix-col-savings {
    color: #2e7d32;
}

.tatamix-savings-value {
    font-weight: 600;
}

.tatamix-per-piece {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Unit price column */
.tatamix-col-unit-price {
    font-weight: 600;
    color: #333;
}

.tatamix-unit-price-value {
    font-size: 15px;
}

/* Variable product placeholder */
.tatamix-variable-placeholder {
    color: #ccc;
}

/* ==========================================================================
   Dynamic Price Display (updated via JS when quantity changes)
   ========================================================================== */

.tatamix-dynamic-price-wrap {
    margin: 10px 0;
    padding: 12px 16px;
    background: #f0f7e8;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
    display: none; /* shown via JS when a discount is active */
}

.tatamix-dynamic-price-wrap.is-active {
    display: block;
}

.tatamix-dynamic-price-info {
    font-size: 14px;
    line-height: 1.5;
}

.tatamix-dynamic-price-info .tatamix-discount-amount {
    font-weight: 700;
    color: #2e7d32;
}

/* ==========================================================================
   Cart discount styling
   ========================================================================== */

.tatamix-cart-discount-label {
    display: inline-block;
    padding: 2px 6px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}

.tatamix-cart-savings {
    color: #2e7d32;
    font-weight: 600;
}

/* ==========================================================================
   Price display overrides (original/discounted in price area)
   ========================================================================== */

.product-price-container .price del {
    opacity: 0.5;
    font-size: 0.9em;
}

.product-price-container .price ins {
    text-decoration: none;
    color: #2e7d32;
    font-weight: 700;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .tatamix-discount-table {
        font-size: 12px;
    }

    .tatamix-discount-table thead th,
    .tatamix-discount-table tbody td {
        padding: 8px 10px;
    }

    .tatamix-unit-price-value {
        font-size: 13px;
    }
}
