/* ── WC Tier Pricing — Frontend ────────────────────────────────── */

/* ── Price display on listings ───────────────────────────────── */
.wcqb-tp-price-from {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.wcqb-tp-per-unit {
    font-size: 0.8em;
    font-weight: 400;
    color: #888;
    margin-left: 2px;
}

/* ── Pricing table wrap ──────────────────────────────────────── */
.wcqb-tp-pricing-table-wrap {
    margin: 20px 0 24px;
    transition: opacity .2s ease;
}

.wcqb-tp-pricing-table-wrap.wcqb-tp-updating {
    opacity: .5;
    pointer-events: none;
}

/* ── Select prompt (variable, no selection yet) ──────────────── */
.wcqb-tp-select-prompt,
.wcqb-tp-no-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    font-size: 13px;
    color: #888;
}

.wcqb-tp-select-prompt svg {
    flex-shrink: 0;
    color: #bbb;
}

/* ── Table ───────────────────────────────────────────────────── */
.wcqb-tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.wcqb-tp-table thead th {
    background: #f5f5f5;
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    border-bottom: 1px solid #e8e8e8;
}

.wcqb-tp-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background .12s;
}

.wcqb-tp-table tbody tr:last-child {
    border-bottom: none;
}

.wcqb-tp-table tbody tr:hover {
    background: #fafafa;
}

.wcqb-tp-table td {
    padding: 11px 14px;
    vertical-align: middle;
}

/* Qty column */
.wcqb-tp-qty-col {
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Price column */
.wcqb-tp-price-col {
    font-size: 15px;
    white-space: nowrap;
}

.wcqb-tp-price-col .woocommerce-Price-amount {
    color: #111;
}

/* Saving column */
.wcqb-tp-saving-col {
    text-align: right;
}

.wcqb-tp-saving {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.wcqb-tp-saving-base {
    font-size: 12px;
    color: #aaa;
}

/* ── Best price row highlight ────────────────────────────────── */
.wcqb-tp-table tr.wcqb-tp-best-price {
    background: #f8fff8;
}

.wcqb-tp-table tr.wcqb-tp-best-price:hover {
    background: #f0fff0;
}

.wcqb-tp-badge {
    display: inline-block;
    background: #222;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: .03em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ── Animation when table updates ────────────────────────────── */
@keyframes wctp-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wcqb-tp-pricing-table-wrap.wcqb-tp-loaded .wcqb-tp-table {
    animation: wctp-fade-in .2s ease;
}
