{% block cms_element_bc_discount_banner_element %}
    

    {% set link = element.config.link.value~'/' %} 
    {% set media = element.config.media.value %} 
    {% set title = element.config.title.value %} 
    {% set buttonText = element.config.buttonText.value %} 
    {% set discountText = element.config.discountText.value %} 
    {% set mediaCollection = searchMedia([media],context.context) %}
    {% set mediaEntity = mediaCollection.get(media) %}
    
    {% set btnBgColor = element.config.btnBgColor.value %}
    {% set titleColor = element.config.titleColor.value %}
    {% set btnTxtColor = element.config.btnTxtColor.value %}
    {% set topTextColor = element.config.topTextColor.value %}


    <div class="offer--box">
            {% set attributes = {
                'height':'486',
                'width' : '660',
                'alt': (mediaEntity.translated.alt ?: discountText),
                'title': (mediaEntity.translated.title ?: discountText)
            } %}
            {% sw_thumbnails 'product-manufacturer-image-thumbnails' with {
                media: mediaEntity
            } %}


        <div class="overlay">
            <div class="offer--details">
                {% if discountText %}
                    <span style="color: {{topTextColor}}";>{{discountText}}</span>
                {% endif %}
                {% if title %}
                    <div class="title" style="color: {{titleColor}}";>{{title}}</div>
                {% endif %}
                {% if buttonText %}
                    <div class="offer--action">
                        <a href="{{link}}" style="color: {{btnTxtColor}}; background: {{btnBgColor}}";>{{buttonText}}</a>
                    </div>
                {% endif %}
            </div>
        </div>
    </div>

{% endblock %}