<!DOCTYPE html>
<html lang="{{ locale|default('fr') }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="x-apple-disable-message-reformatting">
    <title>{{ 'order.credit_mail.subject_mail'|trans({'%company%': company, '%reference%': credit_reference ?: reference }, null, locale|default('fr')) }}</title>
</head>
<body style="margin:0; padding:0; background:#f7f2ea; color:#201917; font-family:Georgia, 'Times New Roman', serif;">
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; background:#f7f2ea; margin:0; padding:0;">
    <tr>
        <td align="center" style="padding:32px 16px;">
            <table role="presentation" width="640" cellspacing="0" cellpadding="0" style="width:100%; max-width:640px; background:#ffffff;">
                <tr>
                    <td style="padding:40px 40px 24px; text-align:center; background:#fcfaf7;">
                        {% if contact and contact.image and contact.image.path %}
                            <img
                                src="{{ absolute_url(asset(contact.image.path)|imagine_filter('logo_email_filter')) }}"
                                alt="{{ contact.image.title ?: company }}"
                                width="180"
                                style="display:block; width:100%; max-width:180px; margin:0 auto 24px;"
                            >
                        {% endif %}
                        <div style="font-size:12px; letter-spacing:0.32em; text-transform:uppercase; color:#9d7c47;">{{ 'order.credit_mail.eyebrow'|trans({}, null, locale|default('fr')) }}</div>
                        <h1 style="margin:18px 0 0; font-size:34px; line-height:1.2; font-weight:400; color:#201917;">{{ 'order.credit_mail.heading'|trans({}, null, locale|default('fr')) }}</h1>
                    </td>
                </tr>
                <tr>
                    <td style="padding:32px 40px 40px; font-family:Arial, Helvetica, sans-serif; font-size:16px; line-height:1.75; color:#5d4b41;">
                        <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; background:#fcfaf7;">
                            <tr>
                                <td style="padding:18px 22px;">
                                    <div style="margin:0 0 6px; font-size:12px; letter-spacing:0.18em; text-transform:uppercase; color:#9d7c47;">{{ 'order.credit_mail.reference_label'|trans({}, null, locale|default('fr')) }}</div>
                                    <div style="font-size:20px; line-height:1.35; color:#201917;">{{ 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; background:#fcfaf7;">
                                <tr>
                                    <td style="padding:18px 22px;">
                                        <p style="margin:0 0 10px; color:#201917; font-weight:700;">{{ 'order.credit_mail.total_label'|trans({}, null, locale|default('fr')) }}</p>
                                        <p style="margin:0; font-size:20px; line-height:1.35; color:#201917;">{{ credit_details.totals.total_ttc|price_format }} €</p>
                                    </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>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</body>
</html>
