/* ===================== DOCUMENTO - IDENTIDADE VISUAL MAGIC FIREWORKS ===================== */
/* Baseado no catálogo oficial: header preto, linhas horizontais finas, sem bordas laterais  */
/* Mexer aqui = mexer no que sai no PDF. Não afeta sidebar nem interface.                    */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- CONTAINER --- */
.recibo-wrapper {
    width: 100%;
    max-width: 210mm;
}

.recibo {
    background: #fff;
    color: #1a1a1a;
    padding: 15mm;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 400;
}

/* ==========================================================================
   CABEÇALHO DA EMPRESA
   ========================================================================== */
.doc-header-table {
    width: 100%;
    margin-bottom: 25px;
    border-collapse: separate;
    border-spacing: 0;
}

.doc-header-table td {
    vertical-align: middle;
    padding: 0;
    border: none !important;
}

.r-logo-rect {
    width: 150px;
    height: 75px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    margin-left: -10px;
}

.r-logo-rect img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#rEmpresaNome {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.doc-info {
    font-size: 11px;
    color: #555;
    margin: 2px 0;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* Caixa número do pedido — fundo preto como catálogo */
.doc-box-number {
    border: 1px solid #cdcdcd !important;
    color: #000 !important;
    padding: 10px 14px;
    text-align: center;
    min-width: 140px;
    display: inline-block;
    background-color: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.doc-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    letter-spacing: 1px;
}

.doc-big-num {
    font-size: 26px;
    font-weight: 800;
    margin: 4px 0;
    color: #000;
}

.doc-date {
    border-top: 1px solid #cdcdcd;
    padding-top: 4px;
    font-weight: 400;
    display: block;
    font-size: 11px;
    margin-top: 4px;
    color: #000;
}

/* Linha decorativa preta grossa (estilo catálogo) */
.doc-header-line {
    height: 3px;
    background: #000;
    margin: 15px 0 20px 0;
    border: none;
}

/* ==========================================================================
   DADOS DO CLIENTE — Tabelas com barra preta + linhas cinza (estilo catálogo)
   ========================================================================== */

/* Barra preta: VENDEDOR / Nº PEDIDO */
.client-data-table-title {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.client-data-table-title td {
    border-right: 1px solid #ccc !important;
    border-bottom: 1px solid #ccc !important;
    border-top: none !important;
    border-left: none !important;
}

.client-data-table-title td:first-child {
    border-left: 1px solid #ccc !important;
}

.client-data-table-title tr:first-child td {
    border-top: 1px solid #ccc !important;
}

/* Dados do cliente */
.client-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 25px;
    border-bottom: 3px solid #000;
}

.client-data-table td {
    border-right: 1px solid #ccc !important;
    border-bottom: 1px solid #ccc !important;
    border-top: none !important;
    border-left: none !important;
}

.client-data-table tr:first-child td {
    border-top: 1px solid #ccc !important;
}

.client-data-table td:first-child {
    border-left: 1px solid #ccc !important;
}

/* Nível 1: Títulos pretos (VENDEDOR, Nº PEDIDO) */
.bg-black-title {
    background-color: #000 !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
    width: 110px;
    vertical-align: middle;
    padding: 10px 12px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Nível 2: Labels cinza (CLIENTE, CNPJ, etc.) */
.bg-gray-title {
    background-color: #f0f0f0 !important;
    color: #000 !important;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    text-align: left;
    letter-spacing: 0.5px;
    width: 110px;
    vertical-align: middle;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Células de dados */
.data-cell {
    background-color: #fff !important;
    color: #1a1a1a !important;
    font-weight: 400;
    text-transform: uppercase;
    text-align: left;
    vertical-align: middle;
    padding: 8px 14px;
    border-bottom: 1px solid #e0e0e0 !important;
    font-size: 12px;
}

.data-cell.highlight {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   TABELA DE ITENS — Header preto, linhas horizontais, sem bordas laterais
   ========================================================================== */
.r-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    font-size: 11px;
}

.r-table thead th {
    background-color: #000 !important;
    color: #fff !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 12px;
    border: none;
    text-align: left;
    font-size: 10px;
    letter-spacing: 0.8px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.r-table tbody td {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    vertical-align: middle;
    color: #1a1a1a;
    font-weight: 400;
}

/* Sem borda externa: esquerda da primeira coluna, direita da última */
.r-table thead th:first-child,
.r-table tbody td:first-child {
    border-left: none !important;
}

.r-table thead th:last-child,
.r-table tbody td:last-child {
    border-right: none !important;
}

.r-table tbody tr:last-child td {
    border-bottom: 2px solid #000;
}

.c-img {
    width: 65px;
    text-align: center;
    padding: 4px !important;
}

.c-item {
    width: 35px;
    text-align: center;
    font-weight: 600;
}

.c-sku {
    width: 100px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: #000;
}

.c-desc {
    font-weight: 400;
    font-size: 11px;
}

.c-qtd, .c-un {
    text-align: center;
    font-weight: 500;
}

.c-preco, .c-total {
    text-align: right;
    font-family: var(--mono);
    font-weight: 600;
}

.prod-thumb {
    width: 55px;
    height: 55px;
    object-fit: contain;
    border: 1px solid #eee;
    background: #fff;
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   TOTAIS
   ========================================================================== */
.totals-area {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    margin-bottom: 20px;
}

.totals-table {
    width: 280px;
    border-collapse: separate;
    border-spacing: 0;
}

.totals-table td {
    padding: 6px 10px;
    text-align: right;
    font-size: 11px;
    border: none;
    font-weight: 500;
}

.totals-value {
    border-bottom: 1px solid #ddd !important;
    font-family: var(--mono);
    width: 120px;
    font-weight: 600;
}

.final-row td {
    background: #000 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 800;
    padding: 10px;
    border: none !important;
    letter-spacing: 0.5px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* ==========================================================================
   RODAPÉ — Pagamento, Observações, Footer
   ========================================================================== */
.section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #000;
    padding-bottom: 6px;
    border-bottom: 2px solid #000;
    margin-bottom: 0;
}

.doc-obs-box {
    border: none;
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
    font-size: 11px;
    min-height: 30px;
    font-style: italic;
    background: transparent;
    color: #444;
}

.doc-footer {
    margin-top: 30px;
    border-top: 3px solid #000;
    padding-top: 12px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #000;
}

/* ==========================================================================
   IMPRESSÃO PDF
   ========================================================================== */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .recibo-wrapper {
        max-width: 100%;
        width: 100%;
        margin: 0;
        box-shadow: none;
    }

    .recibo {
        padding: 0;
        box-shadow: none;
        border: none;
        width: 100%;
    }

    .r-table thead th,
    .bg-black-title,
    .final-row td {
        background-color: #000 !important;
        color: #fff !important;
    }

    .bg-gray-title {
        background-color: #f0f0f0 !important;
        color: #000 !important;
    }

    .r-table,
    .client-data-table,
    .client-data-table-title,
    .totals-table {
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .client-data-table td,
    .client-data-table-title td {
        border: 1px solid #ccc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .bg-gray-title {
        background-color: #f0f0f0 !important;
        border: 1px solid #ccc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .data-cell {
        border: 1px solid #ccc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .client-data-table tr:first-child td,
    .client-data-table-title tr:first-child td {
        border-top: 1px solid #ccc !important;
    }

    .client-data-table td:first-child,
    .client-data-table-title td:first-child {
        border-left: 1px solid #ccc !important;
    }

    .bg-gray-title,
    .data-cell {
        border: 1px solid #ccc !important;
    }

    .r-table thead th:first-child,
    .r-table tbody td:first-child {
        border-left: none !important;
    }

    .r-table thead th:last-child,
    .r-table tbody td:last-child {
        border-right: none !important;
    }

    .r-table tbody tr:last-child td {
        border-bottom: 2px solid #000 !important;
    }

    .r-table tbody td {
        border-right: 1px solid #e0e0e0 !important;
        border-bottom: 1px solid #e0e0e0 !important;
        border-top: none !important;
        border-left: none !important;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .r-table thead {
        display: table-header-group;
    }

    hr {
        display: block !important;
        height: 0 !important;
        border: none !important;
        border-top: 1px solid #000 !important;
        margin: 0 !important;
        padding: 0 !important;
        visibility: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
