@php
    $companyDetails = $company ?? \App\Models\CompanySettings::query()->first();
@endphp

<div class="pdf-header no-print-pdf" style="margin-bottom: 10px; text-align: center; font-size: 10px; color: #444;">
    <div style="font-size: 14px; font-weight: 700; color: #111;">
        {{ $companyDetails->company_name ?? config('app.name', 'Law Firm') }}
    </div>
    @if(!empty($companyDetails?->address))
        <div>{{ $companyDetails->address }}</div>
    @endif
    <div>
        @if(!empty($companyDetails?->contact_phone))
            {{ $companyDetails->contact_phone }}
        @endif
        @if(!empty($companyDetails?->contact_email))
            {{ !empty($companyDetails?->contact_phone) ? ' | ' : '' }}{{ $companyDetails->contact_email }}
        @endif
        @if(!empty($companyDetails?->website))
            {{ (!empty($companyDetails?->contact_phone) || !empty($companyDetails?->contact_email)) ? ' | ' : '' }}{{ $companyDetails->website }}
        @endif
    </div>
    @if(!empty($companyDetails?->tax_id) || !empty($companyDetails?->bank_name) || !empty($companyDetails?->bank_acc_number) || !empty($companyDetails?->bank_account_type) || !empty($companyDetails?->bank_branch_address))
        <div>
            @if(!empty($companyDetails?->tax_id))
                ZIMRA TIN: {{ $companyDetails->tax_id }}
            @endif
            @if(!empty($companyDetails?->bank_name))
                {{ !empty($companyDetails?->tax_id) ? ' | ' : '' }}Bank: {{ $companyDetails->bank_name }}
            @endif
            @if(!empty($companyDetails?->bank_acc_number))
                {{ (!empty($companyDetails?->tax_id) || !empty($companyDetails?->bank_name)) ? ' | ' : '' }}A/C: {{ $companyDetails->bank_acc_number }}
            @endif
            @if(!empty($companyDetails?->bank_account_type))
                {{ (!empty($companyDetails?->tax_id) || !empty($companyDetails?->bank_name) || !empty($companyDetails?->bank_acc_number)) ? ' | ' : '' }}Type: {{ strtoupper($companyDetails->bank_account_type) }}
            @endif
            @if(!empty($companyDetails?->bank_branch_address))
                {{ (!empty($companyDetails?->tax_id) || !empty($companyDetails?->bank_name) || !empty($companyDetails?->bank_acc_number) || !empty($companyDetails?->bank_account_type)) ? ' | ' : '' }}Branch: {{ $companyDetails->bank_branch_address }}
            @endif
        </div>
    @endif
</div>
