<!DOCTYPE html>
<html lang="{{ locale|default('fr') }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>
        {{ (is_reminder ? 'marketing.review_request.mail.reminder_subject' : 'marketing.review_request.mail.subject')|trans({'%company%': company}, 'messages', locale|default('fr')) }}
    </title>
</head>
<body style="margin:0; padding:0; background:#f7f2ea; color:#201917; font-family:Arial, Helvetica, sans-serif;">
    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; background:#f7f2ea;">
        <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; text-align:center;">
                            {% if contact and contact.image and contact.image.path %}
                                <img src="{{ absolute_url(asset(contact.image.path)|imagine_filter('logo_email_filter')) }}" alt="{{ company }}" width="180" style="display:block; max-width:180px; margin:0 auto 28px;">
                            {% endif %}
                            <h1 style="margin:0 0 20px; font-family:Georgia, 'Times New Roman', serif; font-size:32px; font-weight:400;">
                                {{ email_title }}
                            </h1>
                            <p style="margin:0 0 28px; font-size:16px; line-height:1.7; color:#5d4b41;">
                                {{ (is_reminder ? 'marketing.review_request.mail.reminder_intro' : 'marketing.review_request.mail.intro')|trans({'%company%': company}, 'messages', locale|default('fr')) }}
                            </p>
                            <div style="margin:0 0 28px; padding:22px 24px; background:#f7f2ea; text-align:left;">
                                <p style="margin:0 0 14px; font-size:17px; line-height:1.5; color:#201917;">
                                    <strong>
                                        {{ 'marketing.review_request.mail.order_heading'|trans({'%reference%': cart.token ?: cart.id}, 'messages', locale|default('fr')) }}
                                    </strong>
                                </p>
                                <p style="margin:0 0 10px; font-size:14px; line-height:1.5; color:#5d4b41;">
                                    {{ 'marketing.review_request.mail.products_heading'|trans({}, 'messages', locale|default('fr')) }}
                                </p>
                                <ul style="margin:0; padding:0 0 0 20px; color:#5d4b41;">
                                    {% for item in cart.items %}
                                        {% set variant = item.variant %}
                                        {% set product_name = variant ? (variant.fullName ?: (variant.product ? variant.product.fullName : '')) : '' %}
                                        {% if product_name %}
                                            <li style="margin:0 0 6px; font-size:14px; line-height:1.5;">
                                                {{ 'marketing.review_request.mail.product_line'|trans({
                                                    '%quantity%': item.quantity,
                                                    '%product%': product_name,
                                                }, 'messages', locale|default('fr')) }}
                                            </li>
                                        {% endif %}
                                    {% endfor %}
                                </ul>
                            </div>
                            <p style="margin:0 0 30px;">
                                <a href="{{ review_url }}" style="display:inline-block; padding:15px 26px; background:#201917; color:#ffffff; text-decoration:none; font-weight:700;">
                                    {{ 'marketing.review_request.mail.button'|trans({}, 'messages', locale|default('fr')) }}
                                </a>
                            </p>
                            {% if google_business_review_url %}
                                <p style="margin:0 0 14px; font-size:15px; line-height:1.6; color:#5d4b41;">
                                    {{ 'marketing.review_request.mail.google_intro'|trans({}, 'messages', locale|default('fr')) }}
                                </p>
                                <p style="margin:0 0 30px;">
                                    <a href="{{ google_business_review_url }}" style="display:inline-block; padding:13px 22px; border:1px solid #201917; color:#201917; text-decoration:none; font-weight:700;">
                                        {{ 'marketing.review_request.mail.google_button'|trans({}, 'messages', locale|default('fr')) }}
                                    </a>
                                </p>
                            {% endif %}
                            <p style="margin:0; font-size:13px; color:#806f65;">
                                {{ 'marketing.review_request.mail.expiry'|trans({'%date%': expires_at|date('d/m/Y')}, 'messages', locale|default('fr')) }}
                            </p>
                            <p style="margin:18px 0 0; font-size:12px; line-height:1.6; color:#806f65;">
                                <a href="{{ review_policy_url }}" style="color:#806f65;">
                                    {{ 'marketing.review_request.mail.policy_link'|trans({}, 'messages', locale|default('fr')) }}
                                </a>
                                ·
                                <a href="{{ opt_out_url }}" style="color:#806f65;">
                                    {{ 'marketing.review_request.mail.opt_out_link'|trans({}, 'messages', locale|default('fr')) }}
                                </a>
                            </p>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
