<section class="treat-club" data-reveal>
  <div class="container">
    <div class="treat-club__layout">
      <div class="treat-club__text">
        {%- if section.settings.eyebrow != blank -%}
          <span class="section-eyebrow">{{ section.settings.eyebrow }}</span>
        {%- endif -%}
        {%- if section.settings.heading != blank -%}
          <h2 class="section-heading">{{ section.settings.heading }}</h2>
        {%- endif -%}
        {%- if section.settings.text != blank -%}
          <p class="treat-club__desc">{{ section.settings.text }}</p>
        {%- endif -%}
      </div>
      <div class="treat-club__form-wrap">
        {%- form 'customer', id: 'treat-club-signup' -%}
          <input type="hidden" name="contact[tags]" value="treat-club">
          <div class="treat-club__field-group">
            <label for="treat-club-email" class="visually-hidden">{{ section.settings.email_placeholder }}</label>
            <input type="email" id="treat-club-email" name="contact[email]" class="treat-club__input" placeholder="{{ section.settings.email_placeholder }}" required autocomplete="email">
            <button type="submit" class="btn btn--primary treat-club__btn">{{ section.settings.cta_text }}</button>
          </div>
        {%- endform -%}
      </div>
    </div>
  </div>
</section>

{% schema %}
{
  "name": "Treat Club",
  "class": "section-treat-club",
  "settings": [
    { "type": "text", "id": "eyebrow", "label": "Eyebrow", "default": "JOIN THE PACK" },
    { "type": "text", "id": "heading", "label": "Heading", "default": "The Treat Club" },
    { "type": "textarea", "id": "text", "label": "Description" },
    { "type": "text", "id": "email_placeholder", "label": "Email placeholder", "default": "Your email address" },
    { "type": "text", "id": "cta_text", "label": "Button text", "default": "Join the Pack" }
  ],
  "presets": [{ "name": "Treat Club" }]
}
{% endschema %}