/**
 * DTF Tiered Pricing – Estilos do frontend (página do produto).
 *
 * Design minimalista inspirado no WooCommerce Tiered Price Table:
 * header claro com labels em cinza, linhas limpas com separadores sutis,
 * e linha ativa destacada em roxo/lilás sem bordas pesadas.
 */

/* ── Variáveis ──────────────────────────────────────────────────────────────── */

:root {
    --dtf-active-bg:      #faf5ff;
    --dtf-active-color:   #7c3d98;
    --dtf-active-border:  #e9d5ff;
    --dtf-header-bg:      #f9fafb;
    --dtf-header-text:    #9ca3af;
    --dtf-row-text:       #374151;
    --dtf-muted:          #6b7280;
    --dtf-price-color:    #374151;
    --dtf-border:         #e5e7eb;
    --dtf-row-sep:        #f3f4f6;
    --dtf-radius:         8px;
}

/* ── Wrapper ────────────────────────────────────────────────────────────────── */

.dtf-price-table-wrapper {
    margin: 0 0 24px;
    border-radius: var(--dtf-radius);
    overflow: hidden;
    border: 1px solid var(--dtf-border);
    background: #fff;
    font-family: inherit;
}

/* ── Tabela ─────────────────────────────────────────────────────────────────── */

.dtf-price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Cabeçalho – clean, sem fundo roxo escuro ───────────────────────────────── */

.dtf-price-table thead tr {
    background: var(--dtf-header-bg);
    border-bottom: 1px solid var(--dtf-border);
}

.dtf-price-table thead th {
    padding: 10px 18px;
    color: var(--dtf-header-text);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    text-align: left;
    border: none;
}

/* ── Linhas ─────────────────────────────────────────────────────────────────── */

.dtf-price-table tbody .dtf-tier-row {
    border-bottom: 1px solid var(--dtf-row-sep);
    transition: background 0.12s ease;
    cursor: default;
}

.dtf-price-table tbody .dtf-tier-row:last-child {
    border-bottom: none;
}

.dtf-price-table tbody .dtf-tier-row:hover {
    background: #fdfcff;
}

.dtf-price-table tbody td {
    padding: 11px 18px;
    color: var(--dtf-row-text);
    border: none;
}

/* ── Coluna de quantidade ───────────────────────────────────────────────────── */

.dtf-col-qty {
    font-weight: 400;
    color: var(--dtf-row-text);
}

/* ── Coluna de desconto ─────────────────────────────────────────────────────── */

.dtf-col-disc {
    color: var(--dtf-muted);
    font-size: 13px;
}

/* ── Coluna de preço ────────────────────────────────────────────────────────── */

.dtf-col-price {
    text-align: right;
}

.dtf-price-val {
    color: var(--dtf-price-color);
    font-weight: 400;
}

/* ── Linha ativa (faixa correspondente à quantidade atual) ───────────────────── */

.dtf-price-table tbody .dtf-tier-row.dtf-tier-active {
    background: var(--dtf-active-bg);
    border-bottom-color: var(--dtf-active-border);
}

.dtf-price-table tbody .dtf-tier-row.dtf-tier-active td {
    color: var(--dtf-active-color);
    font-weight: 700;
}

.dtf-price-table tbody .dtf-tier-row.dtf-tier-active .dtf-col-disc {
    color: var(--dtf-active-color);
    opacity: 0.85;
}

.dtf-price-table tbody .dtf-tier-row.dtf-tier-active .dtf-price-val {
    color: var(--dtf-active-color);
    font-weight: 700;
}

/* ── Animação ao atualizar o preço ──────────────────────────────────────────── */

.dtf-price-updating {
    animation: dtf-pulse 0.25s ease-out;
}

@keyframes dtf-pulse {
    0%   { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ── Responsivo ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .dtf-price-table thead th,
    .dtf-price-table tbody td {
        padding: 9px 12px;
        font-size: 12px;
    }

    /*
     * Oculta a coluna de desconto em telas pequenas:
     * Precisa esconder tanto o <th> do cabeçalho (2ª coluna)
     * quanto o <td> do corpo, senão as colunas ficam desalinhadas.
     */
    .dtf-price-table thead th:nth-child(2),
    .dtf-col-disc {
        display: none;
    }

    /* Layout 2 colunas (Quantidade | Preço) */
    .dtf-price-table thead th:first-child,
    .dtf-col-qty {
        width: 60%;
    }

    .dtf-price-table thead th:last-child,
    .dtf-col-price {
        width: 40%;
        text-align: right;
    }
}

/* ── Compatibilidade com temas (reset de estilos indesejados) ───────────────── */

.dtf-price-table-wrapper table {
    margin: 0 !important;
    border: none !important;
    background: transparent;
}

.dtf-price-table-wrapper table th,
.dtf-price-table-wrapper table td {
    background: transparent !important;
    box-shadow: none !important;
}

/* ── Caixas de informação dinâmica ──────────────────────────────────────────── */

.dtf-info-box {
    display: none;              /* Ocultas por padrão; JS adiciona classe visível */
    margin: 8px 0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13.5px;
    line-height: 1.5;
    animation: dtf-slide-in 0.22s ease-out;
}

@keyframes dtf-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Próxima faixa – upsell (amarelo/âmbar) */
.dtf-next-box.dtf-next-visible {
    display: block;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

/* Total calculado (roxo suave) */
.dtf-total-box.dtf-total-visible {
    display: block;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    color: #4b1d82;
}

.dtf-total-detail {
    color: #7c3d98;
    font-size: 12px;
    margin-left: 4px;
}

/* Economia (verde) */
.dtf-save-box.dtf-saving-visible {
    display: block;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
}

/* Responsivo: ajusta padding nos boxes */
@media (max-width: 600px) {
    .dtf-info-box {
        font-size: 12.5px;
        padding: 8px 12px;
    }
}
