/** Shopify CDN: Minification failed

Line 16:0 Unexpected "{"
Line 16:1 Expected identifier but found "%"
Line 17:2 Unexpected "="
Line 21:10 Expected identifier but found "%"
Line 23:22 Unexpected "("
Line 32:1 Expected identifier but found "%"
Line 34:0 Unexpected "{"
Line 34:1 Expected identifier but found "%"
Line 63:0 Unexpected "<"
Line 68:7 Expected identifier but found "%"
... and 130 more hidden warnings

**/
{% comment %}
  ============================================================
  Boldpurity® — Product Card Snippet
  snippets/bp-product-card.liquid

  Usage: {% render 'bp-product-card', product: product, section_id: section.id %}

  Required metafields (namespace: boldpurity):
    outcome_line     → String  "Reduces fine lines in 8 weeks"
    ingredient_1/2/3 → String  "PDRN", "Multi-Peptides", "Niacinamide"
    badge_label      → String  "Bestseller"
    badge_type       → String  "bestseller" | "clinical" | "sale"
    review_score     → Decimal 4.8
    review_count     → Integer 312
    urgency_stock    → Integer 9 (urgency shows if value is < 15)
  ============================================================
{% endcomment %}

{% liquid
  assign current_variant = product.selected_or_first_available_variant
  assign product_price   = current_variant.price
  assign compare_price   = current_variant.compare_at_price
  assign on_sale         = false
  if compare_price > product_price
    assign on_sale        = true
    assign savings_amount = compare_price | minus: product_price
    assign savings_pct    = savings_amount | times: 100 | divided_by: compare_price
  endif

  assign outcome_line = product.metafields.boldpurity.outcome_line.value
  assign ingredient_1 = product.metafields.boldpurity.ingredient_1.value
  assign ingredient_2 = product.metafields.boldpurity.ingredient_2.value
  assign ingredient_3 = product.metafields.boldpurity.ingredient_3.value
  assign badge_label  = product.metafields.boldpurity.badge_label.value
  assign badge_type   = product.metafields.boldpurity.badge_type.value
  assign review_score = product.metafields.boldpurity.review_score.value
  assign review_count = product.metafields.boldpurity.review_count.value
  assign urgency_qty  = product.metafields.boldpurity.urgency_stock.value | plus: 0
  assign show_urgency = false
  if urgency_qty > 0 and urgency_qty < 15
    assign show_urgency = true
  endif

  assign product_image = product.featured_media
  assign hover_image   = product.media[1]
%}

<div class="bp-card" data-product-id="{{ product.id }}">

  <!-- IMAGE SECTION -->
  <div class="bp-card__image-wrap">
    <a href="{{ product.url }}" class="bp-card__image-link" aria-label="{{ product.title | escape }}">
      {% if product_image %}
        <img
          class="bp-card__img bp-card__img--primary"
          src="{{ product_image | image_url: width: 600 }}"
          srcset="
            {{ product_image | image_url: width: 300 }} 300w,
            {{ product_image | image_url: width: 600 }} 600w,
            {{ product_image | image_url: width: 900 }} 900w
          "
          sizes="(max-width: 640px) 50vw, 300px"
          alt="{{ product_image.alt | escape }}"
          width="{{ product_image.preview_image.width }}"
          height="{{ product_image.preview_image.height }}"
          loading="lazy"
        >
        {% if hover_image %}
          <img
            class="bp-card__img bp-card__img--hover"
            src="{{ hover_image | image_url: width: 600 }}"
            srcset="
              {{ hover_image | image_url: width: 300 }} 300w,
              {{ hover_image | image_url: width: 600 }} 600w
            "
            sizes="(max-width: 640px) 50vw, 300px"
            alt="{{ hover_image.alt | escape }}"
            loading="lazy"
            aria-hidden="true"
          >
        {% endif %}
      {% else %}
        {{ 'product-1' | placeholder_svg_tag: 'bp-card__placeholder' }}
      {% endif %}
    </a>

    <!-- BADGES -->
    <div class="bp-card__badges">
      {% if badge_label != blank %}
        <span class="bp-badge bp-badge--{{ badge_type | default: 'clinical' }}">{{ badge_label }}</span>
      {% endif %}
      {% if on_sale %}
        <span class="bp-badge bp-badge--sale">Sale</span>
      {% endif %}
      {% unless current_variant.available %}
        <span class="bp-badge bp-badge--soldout">Sold Out</span>
      {% endunless %}
    </div>

    <!-- QUICK ADD (hover reveal on desktop) -->
    {% if current_variant.available %}
      <button
        class="bp-card__quick-add"
        data-variant-id="{{ current_variant.id }}"
        aria-label="Quick add {{ product.title | escape }} to cart"
      >
        Add to Cart &mdash; {{ product_price | money }}
      </button>
    {% else %}
      <span class="bp-card__quick-add bp-card__quick-add--unavailable">Sold Out</span>
    {% endif %}
  </div>

  <!-- BODY -->
  <div class="bp-card__body">

    <!-- SOCIAL PROOF -->
    {% if review_score != blank and review_count != blank %}
      {% assign full_stars = review_score | floor %}
      <div class="bp-card__stars" aria-label="{{ review_score }} out of 5 stars, {{ review_count }} reviews">
        <div class="bp-stars-row" aria-hidden="true">
          {% for i in (1..5) %}
            {% if i <= full_stars %}
              <svg class="bp-star bp-star--filled" viewBox="0 0 10 10"><polygon points="5,1 6.2,3.8 9.5,4.1 7,6.4 7.8,9.6 5,8 2.2,9.6 3,6.4 0.5,4.1 3.8,3.8"/></svg>
            {% else %}
              <svg class="bp-star bp-star--empty" viewBox="0 0 10 10"><polygon points="5,1 6.2,3.8 9.5,4.1 7,6.4 7.8,9.6 5,8 2.2,9.6 3,6.4 0.5,4.1 3.8,3.8"/></svg>
            {% endif %}
          {% endfor %}
        </div>
        <span class="bp-card__review-count">{{ review_score }} ({{ review_count }})</span>
      </div>
    {% endif %}

    <!-- TITLE -->
    <a href="{{ product.url }}" class="bp-card__title-link">
      <h3 class="bp-card__title">{{ product.title }}</h3>
    </a>

    <!-- OUTCOME LINE -->
    <p class="bp-card__outcome">
      {%- if outcome_line != blank -%}
        {{ outcome_line }}
      {%- else -%}
        {{ product.description | strip_html | truncate: 80 }}
      {%- endif -%}
    </p>

    <!-- INGREDIENT STRIP -->
    {% if ingredient_1 != blank %}
      <div class="bp-card__ingredients">
        <span class="bp-ingredient">{{ ingredient_1 }}</span>
        {% if ingredient_2 != blank %}<span class="bp-ingredient">{{ ingredient_2 }}</span>{% endif %}
        {% if ingredient_3 != blank %}<span class="bp-ingredient">{{ ingredient_3 }}</span>{% endif %}
      </div>
    {% endif %}

    <!-- URGENCY -->
    {% if show_urgency %}
      <p class="bp-card__urgency">
        <span class="bp-urgency-dot" aria-hidden="true"></span>
        Only {{ urgency_qty }} left in stock
      </p>
    {% endif %}

    <!-- PRICE -->
    <div class="bp-card__price-row">
      <product-price data-product-id="{{ product.id }}">
        <span class="bp-card__price">{{ product_price | money }}</span>
        {% if on_sale %}
          <s class="bp-card__compare">{{ compare_price | money }}</s>
          <span class="bp-card__save">Save {{ savings_pct }}%</span>
        {% endif %}
      </product-price>
    </div>

    <!-- TRUST STRIP -->
    <div class="bp-card__trust">
      <span class="bp-trust-item">Free shipping</span>
      <span class="bp-trust-dot" aria-hidden="true"></span>
      <span class="bp-trust-item">COD available</span>
      <span class="bp-trust-dot" aria-hidden="true"></span>
      <span class="bp-trust-item">Easy returns</span>
    </div>

  </div>
</div>
