{% extends 'mail/_layout.html.twig' %}

{% block mail_subject %}{{ 'order.credit_mail.subject_mail'|trans({'%company%': company, '%reference%': credit_reference ?: reference }, null, locale|default('fr')) }}{% endblock %}
{% block mail_eyebrow %}{{ 'order.credit_mail.eyebrow'|trans({}, null, locale|default('fr')) }}{% endblock %}
{% block mail_heading %}{{ 'order.credit_mail.heading'|trans({}, null, locale|default('fr')) }}{% endblock %}

{% block mail_body %}
    <p style="margin:0 0 16px;">{{ 'order.credit_mail.intro'|trans({}, null, locale|default('fr')) }}</p>
    <p style="margin:0 0 24px;">{{ 'order.credit_mail.reference_intro'|trans({}, null, locale|default('fr')) }}</p>

    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; margin:0 0 24px; border:1px solid #eadfce; background:#fcf7f0;">
        <tr>
            <td class="email-block" style="padding:18px 22px;">
                <div style="margin:0 0 6px; font-size:11px; letter-spacing:0.18em; text-transform:uppercase; color:#8a6a2f;">{{ 'order.credit_mail.reference_label'|trans({}, null, locale|default('fr')) }}</div>
                <div style="font-family:Georgia, 'Times New Roman', serif; font-size:28px; line-height:1.2; color:#3f2f24;">{{ credit_reference ?: reference }}</div>
            </td>
        </tr>
    </table>

    <p style="margin:0 0 16px;">{{ 'order.credit_mail.attachment_notice'|trans({'%document%': document_label_lower }, null, locale|default('fr')) }}</p>

    {% if credit_details.totals.total_ttc is defined %}
        <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; margin:0 0 24px; border:1px solid #eadfce; background:#fffaf5;">
            <tr>
                <td class="email-block" style="padding:18px 22px;">
                    <div style="margin:0 0 8px; font-size:11px; letter-spacing:0.18em; text-transform:uppercase; color:#8a6a2f;">{{ 'order.credit_mail.total_label'|trans({}, null, locale|default('fr')) }}</div>
                    <div style="font-family:Georgia, 'Times New Roman', serif; font-size:28px; line-height:1.2; color:#3f2f24;">{{ credit_details.totals.total_ttc|price_format }} €</div>
                </td>
            </tr>
        </table>
    {% endif %}

    {% if refund_status %}
        <p style="margin:0 0 16px;">{{ ('order.credit_mail.refund_' ~ refund_status)|trans({}, null, locale|default('fr')) }}</p>
    {% endif %}

    <p style="margin:0;">{{ 'order.credit_mail.footer'|trans({'%company%': company }, null, locale|default('fr')) }}</p>
{% endblock %}
