<?php
/**
 * Minimal — no colour, hairline rules, generous whitespace. Shared body from
 * _content.php.
 *
 * @var array<string, mixed> $data
 */

if (!defined('ABSPATH')) {
    exit;
}

// Template partial included in a render method; its locals are not globals.
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
    body { font-family: <?php echo esc_attr($data['font']); ?>; font-size: 12px; color: #0f172a; }
    .top { width: 100%; border-bottom: 1px solid #0f172a; padding-bottom: 14px; } .top td { vertical-align: bottom; }
    .top .title { font-size: 26px; letter-spacing: .06em; text-transform: uppercase; }
    .top .no { text-align: right; font-size: 11px; color: #64748b; }
    .logo img { max-height: 46px; }
    .meta { width: 100%; margin: 22px 0 26px; } .meta td { vertical-align: top; width: 50%; font-size: 11px; }
    .label { text-transform: uppercase; font-size: 9px; letter-spacing: .12em; color: #94a3b8; margin-bottom: 5px; }
    table.items { width: 100%; border-collapse: collapse; }
    table.items th { text-align: left; border-bottom: 1px solid #cbd5e1; padding: 9px 4px; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: #64748b; }
    table.items td { padding: 11px 4px; border-bottom: 1px solid #f1f5f9; }
    .right { text-align: right; }
    table.totals { width: 38%; margin-left: 62%; margin-top: 16px; border-collapse: collapse; }
    table.totals td { padding: 6px 4px; }
    table.totals tr:last-child td { border-top: 1px solid #0f172a; font-weight: bold; }
    .foot { margin-top: 44px; font-size: 10px; color: #94a3b8; }
</style>
</head>
<body>
    <?php require $data['partials'] . '/_watermark.php'; ?>

    <table class="top">
        <tr>
            <td>
                <?php if (!empty($data['logo'])) : ?>
                    <div class="logo"><img src="<?php echo esc_attr($data['logo']); ?>" alt=""></div>
                <?php else : ?>
                    <span class="title"><?php echo esc_html($data['doc_title']); ?></span>
                <?php endif; ?>
            </td>
            <td class="no">
                <?php echo esc_html($data['doc_title']); ?> #<?php echo esc_html($data['invoice_no']); ?><br>
                <?php echo esc_html($data['date']); ?>
                <?php if (!empty($data['po_number'])) : ?><br><?php echo esc_html__('PO', 'softminal-b2b-wholesale-for-woocommerce') . ': ' . esc_html($data['po_number']); ?><?php endif; ?><br>
                <strong><?php echo esc_html($data['seller']['name']); ?></strong>
            </td>
        </tr>
    </table>

    <?php require $data['partials'] . '/_content.php'; ?>
</body>
</html>
