/* Onfy Discounts – Frontend Styles */
/* Author: Armin Saket | https://wpteam.ir */

:root {
    --ddd-primary:    #1a56db;
    --ddd-success:    #057a55;
    --ddd-bg:         #f8faff;
    --ddd-border:     #dce3f5;
    --ddd-radius:     10px;
    --ddd-shadow:     0 2px 12px rgba(26,86,219,.10);
}

/* ── Wrapper ── */
.ddd-pricing-box {
    direction: rtl;
    font-family: inherit;
    background: var(--ddd-bg);
    border: 1.5px solid var(--ddd-border);
    border-radius: var(--ddd-radius);
    margin: 16px 0 20px;
    box-shadow: var(--ddd-shadow);
    overflow: hidden;
}
.ddd-pricing-box:empty { display: none; }

/* ── Header ── */
.ddd-header {
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.ddd-header-icon { font-size: 15px; line-height: 1; }
.ddd-header-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

/* ── Live price strip ── */
.ddd-live-strip {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--ddd-border);
    background: #fff;
    gap: 10px;
    flex-wrap: wrap;
}
.ddd-live-unit, .ddd-live-total-wrap { flex: 1; min-width: 120px; }
.ddd-live-label {
    font-size: 10.5px;
    color: #6b7280;
    margin-bottom: 3px;
}
.ddd-live-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--ddd-primary);
    transition: color .3s, transform .2s;
    line-height: 1.1;
}
.ddd-live-price.ddd-discounted { color: var(--ddd-success); }
.ddd-live-price.ddd-pop { transform: scale(1.07); }
.ddd-live-original {
    font-size: 11px;
    color: #9ca3af;
    text-decoration: line-through;
}
.ddd-live-total {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    line-height: 1.1;
}
.ddd-live-badge {
    display: inline-block;
    background: var(--ddd-success);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
    align-self: center;
}
.ddd-live-badge.hidden { opacity: 0; pointer-events: none; }

/* ── Tiers Table ── */
.ddd-tiers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
.ddd-tiers-table th {
    text-align: center;
    padding: 6px 4px;
    background: #f0f4ff;
    color: #374151;
    font-weight: 600;
    border-bottom: 1px solid var(--ddd-border);
    font-size: 11px;
    overflow: hidden;
    word-break: break-word;
}
.ddd-tiers-table td {
    text-align: center;
    padding: 7px 4px;
    border-bottom: 1px solid var(--ddd-border);
    overflow: hidden;
    word-break: break-word;
}
.ddd-tiers-table tr:last-child td { border-bottom: none; }

.ddd-tier-row.active { background: var(--ddd-primary); }
.ddd-tier-row.active td { color: #fff; font-weight: 700; }
.ddd-tier-row.active .ddd-badge-discount {
    background: rgba(255,255,255,.22);
    color: #fff;
}

.ddd-badge-discount {
    display: inline-block;
    background: #dcfce7;
    color: var(--ddd-success);
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 7px;
}
.ddd-badge-none { color: #d1d5db; }
