/*
 * TitanCart — Printable Invoice document styles.
 *
 * Loaded ONLY by templates/checkout/invoice.php (a standalone print document
 * rendered outside the theme). Registered as 'titancart-invoice-print' and
 * printed via the core styles API; the brand accent arrives as the
 * --tc-accent custom property through wp_add_inline_style().
 */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: #f1f3f6;
    color: #1c2430;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* ── Top action bar (never printed) ── */
.tc-inv-actions {
    max-width: 820px;
    margin: 24px auto 0;
    padding: 0 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.tc-inv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #d4d9e0;
    background: #ffffff;
    color: #1c2430;
}
.tc-inv-btn--primary {
    background: var(--tc-accent);
    border-color: var(--tc-accent);
    color: #ffffff;
}

/* ── The invoice sheet ── */
.tc-inv {
    max-width: 820px;
    margin: 16px auto 48px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    overflow: hidden;
}
.tc-inv__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 36px 44px 28px;
    border-bottom: 3px solid var(--tc-accent);
}
.tc-inv__brand img { max-height: 52px; width: auto; display: block; }
.tc-inv__brand-name { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: #0e2b53; }
.tc-inv__seller { margin-top: 10px; font-size: 12px; color: #5a6270; line-height: 1.6; }
.tc-inv__wordmark { text-align: right; }
.tc-inv__wordmark h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--tc-accent);
    text-transform: uppercase;
}
.tc-inv__meta { margin-top: 12px; font-size: 12.5px; color: #5a6270; line-height: 1.8; }
.tc-inv__meta strong { color: #1c2430; }
.tc-inv__status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    background: #eef2f7;
    color: #344256;
}

.tc-inv__body { padding: 28px 44px 40px; }

.tc-inv__addresses {
    display: flex;
    gap: 32px;
    margin-bottom: 28px;
}
.tc-inv__addr { flex: 1; }
.tc-inv__addr h3 {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #8a93a2;
}
.tc-inv__addr address { font-style: normal; font-size: 13px; line-height: 1.7; color: #1c2430; }
.tc-inv__addr .tc-inv__addr-meta { color: #5a6270; font-size: 12.5px; }

table.tc-inv__items { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
table.tc-inv__items thead th {
    background: #f6f8fb;
    color: #5a6270;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid #e1e5ea;
}
table.tc-inv__items thead th.tc-num,
table.tc-inv__items tbody td.tc-num { text-align: right; }
table.tc-inv__items tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: top;
    font-size: 13px;
}
.tc-inv__pname { font-weight: 600; color: #1c2430; }
.tc-inv__psku { display: block; font-size: 11.5px; color: #8a93a2; margin-top: 2px; }
.tc-inv__popts { display: block; font-size: 11.5px; color: #5a6270; margin-top: 2px; }
.tc-num { text-align: right; white-space: nowrap; }

.tc-inv__totals { width: 100%; max-width: 320px; margin-left: auto; margin-top: 18px; border-collapse: collapse; }
.tc-inv__totals td { padding: 5px 0; font-size: 13px; color: #5a6270; }
.tc-inv__totals td:last-child { text-align: right; color: #1c2430; font-weight: 600; }
.tc-inv__totals tr.tc-inv__grand td {
    border-top: 2px solid #e1e5ea;
    padding-top: 11px;
    font-size: 16px;
    font-weight: 800;
    color: #0e2b53;
}

.tc-inv__pay {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #f0f2f5;
    font-size: 12.5px;
    color: #5a6270;
    line-height: 1.8;
}
.tc-inv__pay strong { color: #1c2430; }

.tc-inv__note {
    margin-top: 18px;
    padding: 14px 16px;
    background: #f6f8fb;
    border-radius: 8px;
    font-size: 12.5px;
    color: #5a6270;
}
.tc-inv__note strong { color: #1c2430; display: block; margin-bottom: 3px; }

.tc-inv__foot {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid #f0f2f5;
    text-align: center;
    font-size: 12px;
    color: #8a93a2;
    line-height: 1.7;
}

/* ── Print rules ── */
@media print {
    body { background: #ffffff; }
    .tc-inv-actions, .no-print { display: none !important; }
    .tc-inv {
        max-width: none;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .tc-inv__head { padding: 0 0 20px; }
    .tc-inv__body { padding: 22px 0 0; }
    table.tc-inv__items thead { display: table-header-group; }
    tr { page-break-inside: avoid; }
}
@page { margin: 18mm 16mm; }
