{% macro link(channel, file) %}
    {% if channel.hostname is not null %}
        {{ 'http://' ~ channel.hostname ~ asset('build/dedi/'~file, 'dedi') }}
    {% else %}
        {{ absolute_url(asset('build/dedi/'~file, 'dedi')) }}
    {% endif %}
{% endmacro %}

{% block body %}
    {% autoescape false %}
        {% set homepageUrl = channel.hostname is not null ? 'http://' ~ channel.hostname ~ path('sylius_shop_homepage', {'_locale': localeCode}) : url('sylius_shop_homepage', {'_locale': localeCode}) %}
        {% set logo = _self.link(channel, 'images/logo.svg') %}

        {% set colorPrimary = '#2F4EFF' %}
        {% set colorPrimaryHover = '#001DC0' %}
        {% set backgroundBody = '#FFFFFF' %}

        <style>
            .btn {
                padding: 14px 30px;
                text-decoration: none;
                font-size: 14px;
                color: #fff;
                border-radius: 25px;
                background: {{ colorPrimary }};
                border: 2px solid {{ colorPrimary }};
                transition: 0.3s;
            }
            .btn:after {
                content: "›";
                margin-left: 10px;
            }
            .btn:hover {
                color: #FFF;
                background: {{ colorPrimaryHover }};
                border-color: {{ colorPrimaryHover }};
            }
        </style>

        <div style="background:{{ backgroundBody }}; font-family: sans-serif; padding-top: 30px; padding-bottom: 30px; font-size: 16px; color: #333; line-height: 1.5">
            <div style="max-width: 600px; margin: 20px auto;">
                <div style="margin-bottom: 30px; text-align: center;">
                    <a href="{{ homepageUrl|raw }}">
                        <img src="{{ logo }}" alt="Sylius" style="width: 170px">
                    </a>
                </div>

                <div style="background: #fff; padding: 40px 30px; border: 1px solid #E9EEEE;">
                    {% block content %}{% endblock %}
                </div>

                <div style="text-align: center; padding: 20px 0;">
                    <a href="{{ homepageUrl|raw }}" target="_blank" style="color: {{ colorPrimary }}; text-decoration: none;">{{ channel.name }}</a>
                </div>
            </div>
        </div>
    {% endautoescape %}
{% endblock %}
