{% if this.isEnabled %}
    <div {{ attributes }} class="flex w-full max-w-2xl mx-auto flex-col md:flex-row gap-10">
        <div class="w-full rounded-sm border border-gold/30 bg-white/95 p-3 shadow-[0_12px_30px_rgba(15,23,42,0.12)] backdrop-blur">
            {% if this.isActive %}
                <div class="flex items-start justify-between gap-3">
                    <div>
                        <div class="text-[10px] font-semibold uppercase tracking-[0.16em] text-gold">
                            {{ 'shop.partner_area'|trans }}
                        </div>
                        <div class="mt-1 text-sm text-dark">
                            {{ 'shop.view_partner_price'|trans({'%code%': currentCode}) }}
                        </div>
                    </div>

                    <button
                        type="button"
                        data-action="live#action"
                        data-live-action-param="reset"
                        class="shrink-0 cursor-pointer border border-dark/15 px-3 py-2 text-[10px] font-semibold uppercase tracking-[0.14em] text-dark transition hover:border-dark hover:bg-dark hover:text-white"
                        title="{{ 'shop.reset_partner_code'|trans }}"
                    >
                        {{ 'shop.reset'|trans }}
                    </button>
                </div>
            {% else %}
                <div class="text-[10px] font-semibold uppercase tracking-[0.16em] text-gold">
                    {{ 'shop.partner_area'|trans }}
                </div>

                <div class="mt-3 flex gap-2">
                    <input
                        type="text"
                        data-model="norender|code"
                        value="{{ code }}"
                        placeholder="{{ 'shop.group_code_placeholder'|trans }}"
                        class="min-w-0 flex-1 border border-gold/30 bg-white px-3 py-2 text-base uppercase tracking-[0.08em] text-dark outline-none placeholder:text-sm placeholder:text-dark/35"
                    >
                    <button
                        type="button"
                        data-action="live#action"
                        data-live-action-param="apply"
                        class="shrink-0 cursor-pointer border border-gold bg-gold px-4 py-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-dark transition hover:bg-[#c0af86]"
                    >
                        {{ 'shop.partner_valid'|trans }}
                    </button>
                </div>

                {% if errorMessage %}
                    <div class="mt-2 text-sm text-red-700">
                        {{ errorMessage }}
                    </div>
                {% endif %}
            {% endif %}
        </div>
    </div>
{% endif %}
