/**
 * Frontend Styles for Product Discount Rates for WooCommerce
 */

.pdr-discount-container {
    margin: 20px 0 24px;
    font-family: inherit;
}

.pdr-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.pdr-card:hover {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
}

.pdr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.pdr-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.pdr-icon {
    color: #f59e0b;
}

.pdr-badge-highlight {
    background: #dcfce7;
    color: #15803d;
    font-size: 12.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
}

.pdr-table-wrapper {
    overflow-x: auto;
}

.pdr-pricing-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.pdr-pricing-table thead th {
    background: #ffffff;
    color: #64748b;
    font-weight: 600;
    padding: 11px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pdr-pricing-table tbody tr.pdr-tier-row {
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.pdr-pricing-table tbody tr.pdr-tier-row:last-child {
    border-bottom: none;
}

.pdr-pricing-table tbody tr.pdr-tier-row:hover {
    background-color: #f8fafc;
}

.pdr-pricing-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    color: #334155;
}

.pdr-col-qty strong {
    font-size: 13.5px;
    color: #0f172a;
    display: block;
}

.pdr-tier-label {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 3px;
    font-weight: 500;
}

.pdr-discount-pill {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
}

.pdr-unit-price {
    font-weight: 700;
    color: #0f172a;
    font-size: 13.5px;
}

.pdr-tier-total {
    font-weight: 700;
    color: #0f172a;
    font-size: 13.5px;
    display: block;
}

.pdr-qty-context {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
}

.pdr-savings-text {
    color: #16a34a;
    font-weight: 600;
    font-size: 12.5px;
}

.pdr-active-badge {
    display: none;
    background: #16a34a;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    white-space: nowrap;
}

/* Active Highlight when Quantity Input matches tier */
.pdr-pricing-table tbody tr.pdr-tier-row.pdr-tier-active {
    background-color: #f0fdf4 !important;
}

.pdr-pricing-table tbody tr.pdr-tier-row.pdr-tier-active td {
    color: #14532d;
    font-weight: 500;
}

.pdr-pricing-table tbody tr.pdr-tier-row.pdr-tier-active .pdr-discount-pill {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.pdr-pricing-table tbody tr.pdr-tier-row.pdr-tier-active .pdr-active-badge {
    display: inline-block;
}

/* -------------------------------------------------------------
 * Live Dynamic Total & Discount Summary Box
 * ------------------------------------------------------------- */
.pdr-live-summary-box {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdr-live-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.pdr-live-qty-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdr-summary-label {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
}

.pdr-live-qty-text {
    font-size: 13.5px;
    color: #0f172a;
    font-weight: 700;
}

.pdr-live-tier-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.pdr-badge-standard {
    background: #e2e8f0;
    color: #475569;
}

.pdr-badge-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.pdr-hint-text {
    font-size: 12px;
    color: #2563eb;
    background: #eff6ff;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid #dbeafe;
    display: inline-flex;
    align-items: center;
}

.pdr-hint-success {
    font-size: 12px;
    color: #15803d;
    background: #f0fdf4;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
    font-weight: 500;
}

.pdr-live-pricing-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

.pdr-live-breakdown-left {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
}

.pdr-live-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
}

.pdr-live-sublabel {
    color: #64748b;
    font-size: 12px;
}

.pdr-live-regular-amount {
    color: #94a3b8;
    font-size: 14px;
}

.pdr-live-discount-amount {
    color: #dc2626;
    font-weight: 600;
    font-size: 13px;
}

.pdr-live-total-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.pdr-live-total-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
}

.pdr-live-total-amount {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.pdr-savings-pill {
    background: #16a34a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.25);
}

.pdr-savings-pill strong {
    margin-left: 4px;
}

.pdr-card-footer {
    padding: 9px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pdr-footer-note {
    color: #64748b;
    font-size: 12px;
    display: flex;
    align-items: center;
}

/* Cart badge styling */
.pdr-cart-discount-badge {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid #bbf7d0;
    margin-top: 3px;
}

.pdr-cart-original-price {
    color: #94a3b8;
    margin-right: 6px;
    font-size: 0.9em;
}

.pdr-cart-discounted-price {
    color: #16a34a;
    font-weight: 700;
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 650px) {
    .pdr-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pdr-pricing-table thead th,
    .pdr-pricing-table tbody td {
        padding: 8px 10px;
        font-size: 11.5px;
    }

    .pdr-live-summary-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pdr-live-pricing-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .pdr-live-total-amount {
        font-size: 17px;
    }
}
