{% if block.settings.style == 'style1' %}
  <div class="{{ block.settings.visibility }}"
    {{ block.shopify_attributes }}
    style="--margin-top: {{ block.settings.margin_top | divided_by: 10.0 }}rem;--margin-bottom: {{ block.settings.margin_bottom | divided_by: 10.0 }}rem;"
  >
    <div class="money-back">

<svg   class="money-back-img" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.10938 18.8906C4.24688 18.0281 4.81875 16.2187 4.37813 15.1594C3.9375 14.1 2.25 13.1719 2.25 12C2.25 10.8281 3.91875 9.9375 4.37813 8.84063C4.8375 7.74375 4.24688 5.97187 5.10938 5.10938C5.97187 4.24688 7.78125 4.81875 8.84063 4.37813C9.9 3.9375 10.8281 2.25 12 2.25C13.1719 2.25 14.0625 3.91875 15.1594 4.37813C16.2562 4.8375 18.0281 4.24688 18.8906 5.10938C19.7531 5.97187 19.1813 7.78125 19.6219 8.84063C20.0625 9.9 21.75 10.8281 21.75 12C21.75 13.1719 20.0813 14.0625 19.6219 15.1594C19.1625 16.2562 19.7531 18.0281 18.8906 18.8906C18.0281 19.7531 16.2187 19.1813 15.1594 19.6219C14.1 20.0625 13.1719 21.75 12 21.75C10.8281 21.75 9.9375 20.0813 8.84063 19.6219C7.74375 19.1625 5.97187 19.7531 5.10938 18.8906Z" stroke="#111111" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.125 9.75L10.6219 15L7.875 12.375" stroke="#111111" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

      <span class="money-back-text">{{ block.settings.moneybackguarantee }}</span>
    </div>
  </div>
{% endif %}

{% if block.settings.style == 'style2' %}
  <div
    class="new-money-back-block{% if block.settings.show_shine_animation %} has-shine-animation{% endif %} {{ block.settings.visibility }}"   {{ block.shopify_attributes }}
    style="
      background: {% if block.settings.use_gradient_bg %}linear-gradient(135deg, {{ block.settings.bg_color_1 }} 0%, {{ block.settings.bg_color_2 }} 100%){% else %}{{ block.settings.bg_color_1 }}{% endif %};
      {% if block.settings.show_dotted_border %}border: 1px dotted {{ block.settings.border_color }};{% endif %}
    "
  >
    <div class="new-guarantee-content">
      <div class="new-guarantee-icon">
        <div
          class="new-badge-container"
          style="width: {{ block.settings.badge_size }}px; height: {{ block.settings.badge_size }}px;"
        >
          {% if block.settings.custom_badge_image != blank %}
            <img
              src="{{ block.settings.custom_badge_image | img_url: '100x' }}"
              alt="{{ block.settings.heading }}"
              class="custom-badge-image"
            >
          {% else %}
            {% if block.settings.default_badge_image == 'moneybadge-2' %}
              <img
                src="https://cdn.shopify.com/s/files/1/0557/0887/6873/files/moneybadge-2.png?v=1755636695"
                alt="{{ block.settings.heading }}"
                class="custom-badge-image"
              >
            {% else %}
              <img
                src="https://cdn.shopify.com/s/files/1/0557/0887/6873/files/moneybadge.png?v=1755636695"
                alt="{{ block.settings.heading }}"
                class="custom-badge-image"
              >
            {% endif %}
          {% endif %}
        </div>
      </div>
      <div class="new-guarantee-text">
        <h3 style="color: {{ block.settings.heading_color }} !important;">{{ block.settings.heading }}</h3>
        <p style="color: {{ block.settings.text_color }} !important;">{{ block.settings.description }}</p>
      </div>
    </div>
  </div>

  <style>
    .new-money-back-block {
      border-radius: {{ block.settings.border_radius }}px;
      padding: {{ block.settings.padding }}px;
      margin: {{ block.settings.margin_top2 }}px 0 {{ block.settings.margin_bottom2 }}px 0;
      {% if block.settings.enable_boxshadow %}box-shadow: 0 1px 2px rgba(0,0,0,0.08);{% endif %}
      max-height: none;
      position: relative;
      overflow: hidden;
      letter-spacing: var(--letter-spacing-heading);
    }

    .new-money-back-block::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(255, 255, 255, 0.5);
      z-index: 0;
      pointer-events: none;
      border-radius: {{ block.settings.border_radius }}px;
    }

    .new-money-back-block.has-shine-animation::after {
      content: "";
      position: absolute;
      top: 0;
      left: -100%;
      width: 50%;
      height: 100%;
      background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, {{ block.settings.shine_opacity }}) 50%,
        rgba(255, 255, 255, 0) 100%
      );
      z-index: 1;
      animation: custom-shine-animation {{ block.settings.shine_duration }}s ease-in-out infinite;
      transform: skewX(-20deg);
      pointer-events: none;
    }

    @keyframes custom-shine-animation {
      0% {
        left: -100%;
      }
      30%, 100% {
        left: 150%;
      }
    }

    .new-guarantee-content {
      display: flex;
      align-items: center;
      gap: {{ block.settings.content_gap }}px;
      position: relative;
      z-index: 2;
    }

    .new-badge-container {
      min-width: 35px;
      display: flex;
      align-items: center;
      justify-content: center;
      align-self: flex-start;
      margin-top: 3px;
    }

    .custom-badge-image {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .new-guarantee-text {
      flex: 1;
      letter-spacing: var(--letter-spacing-body);
    }

    .new-guarantee-text h3 {
      font-size: {{ block.settings.heading_size }}px;
      font-weight: var(--font-weight-semibold);
      margin: 0 0 2px 0;
      line-height: 1.2;
      letter-spacing: var(--letter-spacing-body);
    }

    .new-guarantee-text p {
      font-size: {{ block.settings.text_size }}px;
      line-height: 1.3;
      margin: 0;
      letter-spacing: var(--letter-spacing-body);
    }

    @media screen and (max-width: 450px) {
      .new-badge-container {
        width: {{ block.settings.badge_size_mobile }}px !important;
        height: {{ block.settings.badge_size_mobile }}px !important;
        min-width: 32px;
      }

      .new-guarantee-text h3 {
        font-size: {{ block.settings.heading_size_mobile }}px;
        letter-spacing: var(--letter-spacing-body);
      }

      .new-guarantee-text p {
        font-size: {{ block.settings.text_size_mobile }}px;
        letter-spacing: var(--letter-spacing-body);
      }
    }
  </style>
{% endif %}

{% if block.settings.style == 'style3' %}
  <div
    class="guarantee-container-style3 {{ block.settings.visibility }}"
    style="
      background-color: {{ block.settings.style3_bg_color }};
      border: 1.5px {{ block.settings.style3_border_style }} {{ block.settings.style3_border_color }};
      border-radius: {{ block.settings.style3_border_radius }}px;
      margin: {{ block.settings.style3_margin_top }}px 0 {{ block.settings.style3_margin_bottom }}px 0;
    "
    {{ block.shopify_attributes }}
  >
    <div class="guarantee-content-style3">
      <div class="badge-circle" style="border-color: {{ block.settings.style3_border_color }}; border-style: {{ block.settings.style3_border_style }};">
        {% if block.settings.style3_custom_icon != blank %}
          <img
            src="{{ block.settings.style3_custom_icon | img_url: '60x' }}"
            alt="Guarantee Icon"
            class="guarantee-icon-style3"
          >
        {% else %}
          <img
            src="https://cdn.shopify.com/s/files/1/0557/0887/6873/files/less-than-1.png?v=1755116701"
            alt="Guarantee Icon"
            class="guarantee-icon-style3"
          >
        {% endif %}
      </div>
      {%- if block.settings.style3_text_two_lines and block.settings.style3_text_line_two != blank -%}
        {%- assign style3_br_tag = '<br class="style3-line-break style3-line-break--'
          | append: block.settings.style3_text_line_two_display
          | append: '">'
        -%}
        {%- assign style3_text_line_two_with_br = style3_br_tag | append: block.settings.style3_text_line_two -%}
        {%- assign style3_text_output = block.settings.style3_text
          | replace: block.settings.style3_text_line_two, style3_text_line_two_with_br
        -%}
      {%- else -%}
        {%- assign style3_text_output = block.settings.style3_text -%}
      {%- endif -%}
      <div 
        class="guarantee-text-style3"
        style="
          font-size: {{ block.settings.style3_font_size }}px;
          color: {{ block.settings.style3_text_color }};
        "
      >
        {{ style3_text_output }}
      </div>
    </div>
  </div>

  <style>
    .guarantee-container-style3 {
      padding: 12px 16px;
      /* display: inline-block; */
      max-width: 100%;
    }

    .guarantee-content-style3 {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .guarantee-container-style3 .badge-circle {
      border: 1.5px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: white;
      width: 45px;
      height: 45px;
      min-width: 45px;
      flex-shrink: 0;
    }

    .guarantee-icon-style3 {
      width: 30px;
      height: 30px;
      object-fit: contain;
    }

    .guarantee-text-style3 {
      font-weight: 500;
      line-height: 1.3;
      letter-spacing: var(--letter-spacing-body);
    }

    @media screen and (max-width: 450px) {
      .guarantee-container-style3 {
        padding: 10px 12px;
      }

      .guarantee-content-style3 {
        gap: 10px;
      }

      .guarantee-container-style3 .badge-circle {
        width: 40px;
        height: 40px;
        min-width: 40px;
      }

      .guarantee-icon-style3 {
        width: 26px;
        height: 26px;
      }

      .guarantee-text-style3 {
        font-size: {{ block.settings.style3_font_size_mobile }}px !important;
      }
    }
    .style3-line-break--desktop-only {
      display: none;
    }
    @media screen and (min-width: 750px) {
      .style3-line-break--desktop-only {
        display: inline;
      }
      .style3-line-break--mobile-only {
        display: none;
      }
    }
  </style>
{% endif %}