{%- liquid
  assign sd_handles = ''
  assign sd_reasons = ''
  assign sd_guide_title = ''
  assign sd_guide_description = ''
  assign sd_schema_id = canonical_url | append: '#sofa-decor-editorial-products'

  case article.handle
    when 'cheap-couch-covers-australia'
      assign sd_guide_title = 'Compare affordable Decor Cedar cover options'
      assign sd_guide_description = 'A practical comparison of affordable couch cover styles, real variant choices and product links for American shoppers.'
      assign sd_handles = 'aria-textured-armchair-sofa-cover-pieces|alessia-woven-chenille-sofa-seat-cover|arcadia-arch-line-sofa-seat-cover|stylish-non-slip-pet-friendly-sofa-cover|luxury-chenille-sofa-cushion-cover-non-slip-sofa-towel-australia|ultra-plush-rabbit-fur-sofa-seat-covers' | split: '|'
      assign sd_reasons = 'Best when only the seat, back or side-rest area needs affordable protection.|Adds a premium woven chenille look without replacing the sofa.|A modern patterned piece option for modular and everyday lounge zones.|Useful for washable daily protection in pet and family homes.|Targets the high-use cushion area while keeping the original sofa shape visible.|A soft comfort-led choice when the sofa needs a warmer, more luxurious feel.' | split: '|'
    when 'pet-friendly-sofa-covers-australia-guide'
      assign sd_guide_title = 'Compare pet-friendly Decor Cedar cover options'
      assign sd_guide_description = 'A practical comparison of washable pet-friendly sofa covers, colours, sizes and product links for American homes with dogs or cats.'
      assign sd_handles = 'elegant-pet-friendly-sofa-cover|universal-chenille-sofa-cover-pet-friendly-anti-scratch|stylish-non-slip-pet-friendly-sofa-cover|alessia-woven-chenille-sofa-seat-cover|haven-quilted-corduroy-sofa-cover-piece|ultra-plush-rabbit-fur-sofa-seat-covers' | split: '|'
      assign sd_reasons = 'Decorative chenille styling for pet homes that still want a polished lounge.|A textured everyday option when pets, comfort and sofa protection matter together.|A practical daily cover when quick removal and washing are priorities.|Good for pets that favour one cushion, chaise side or backrest area.|Quilted texture for high-use seats, arms and back cushions.|A soft, cosy layer for comfort-focused pet and family spaces.' | split: '|'
    when 'chenille-sofa-covers-australia-guide'
      assign sd_guide_title = 'Compare chenille Decor Cedar cover options'
      assign sd_guide_description = 'A practical comparison of chenille sofa covers, fabric feel, colour choices, size options and product links for American homes.'
      assign sd_handles = 'alessia-woven-chenille-sofa-seat-cover|elegant-chenille-sofa-cover-tassels-pet-friendly|universal-chenille-sofa-cover-pet-friendly-anti-scratch|chenille-stretch-sofa-cover-non-slip-couch-protector|luxury-chenille-sofa-cushion-cover-non-slip-sofa-towel-australia|nordic-chenille-sofa-towel-cover-all-season-sofa-throw-blanket-for-pets-kids' | split: '|'
      assign sd_reasons = 'A strong piece-based chenille option for modular seats and everyday lounge zones.|Best for decorative tassels, warmer texture and a more styled finish.|A chenille direction for homes balancing pets, comfort and daily wear.|Useful when chenille warmth is wanted with a more fitted stretch-cover result.|Targets high-use cushions without covering the entire sofa frame.|A relaxed throw-style chenille layer for pets, kids and all-season comfort.' | split: '|'
  endcase
-%}

{%- if sd_handles != blank -%}
  {%- unless article.content contains 'data-sofa-decor-blog-enhancement' -%}
    <style data-sofa-decor-article-fallback="2026-06-14">
      .sd-article-fallback{max-width:980px;margin:2.2rem auto 0;color:#242424;line-height:1.62}
      .sd-article-fallback h2{font-size:clamp(1.45rem,2vw,1.95rem);line-height:1.2;margin:0 0 .85rem}
      .sd-article-fallback p{margin:0 0 1rem}
      .sd-product-grid--enriched{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:1.3rem 0 1.8rem}
      .sd-product-card--enriched{border:1px solid #e3ddd8;border-radius:8px;padding:12px;background:#fff;display:flex;flex-direction:column;gap:.55rem}
      .sd-product-card--enriched img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:6px;background:#f8f4f0}
      .sd-product-card--enriched strong{display:block;line-height:1.28}
      .sd-product-card--enriched a{color:#5b3f2f;text-decoration:underline;text-underline-offset:3px}
      .sd-price{font-weight:700;color:#3b2c23;margin:.1rem 0}
      .sd-compare{display:block;font-size:.88rem;font-weight:500;color:#7a6a60;text-decoration:line-through;text-decoration-thickness:1px}
      .sd-option-list{margin:.1rem 0 .35rem;padding-left:1.1rem;font-size:.91rem;color:#403a35}
      .sd-option-list li{margin:.25rem 0}
      .sd-card-link{margin-top:auto;font-weight:700}
      .sd-options-table{width:100%;border-collapse:collapse;margin:1.2rem 0 1.8rem;font-size:.94rem}
      .sd-options-table th,.sd-options-table td{border:1px solid #e0d9d2;padding:12px;text-align:left;vertical-align:top}
      .sd-options-table th{background:#f4eee8}
      @media(max-width:760px){.sd-product-grid--enriched{grid-template-columns:1fr}.sd-options-table{font-size:.88rem}}
    </style>
    <section class="sd-article-fallback" aria-label="Decor Cedar product options">
      <h2>{{ sd_guide_title }}</h2>
      <p>{{ sd_guide_description }}</p>
      <div class="sd-product-grid--enriched">
        {%- for sd_handle in sd_handles -%}
          {%- liquid
            assign sd_product = all_products[sd_handle]
            assign sd_reason = sd_reasons[forloop.index0]
          -%}
          {%- if sd_product != blank -%}
            <article class="sd-product-card--enriched">
              <a href="{{ sd_product.url }}"><img src="{{ sd_product.featured_image | image_url: width: 720 }}" alt="{{ sd_product.featured_image.alt | default: sd_product.title | escape }}" loading="lazy"></a>
              <strong><a href="{{ sd_product.url }}">{{ sd_product.title }}</a></strong>
              <p>{{ sd_reason }}</p>
              <p class="sd-price">
                from {{ sd_product.price_min | money }}
                {%- if sd_product.compare_at_price_min > sd_product.price_min -%}
                  <span class="sd-compare">regular/list from {{ sd_product.compare_at_price_min | money }}</span>
                {%- endif -%}
              </p>
              <ul class="sd-option-list">
                {%- for option in sd_product.options_with_values limit: 3 -%}
                  <li><strong>{{ option.name }}:</strong>
                    {%- for value in option.values limit: 7 -%}
                      {{ value }}{%- unless forloop.last -%}, {% endunless -%}
                    {%- endfor -%}
                  </li>
                {%- endfor -%}
              </ul>
              <a class="sd-card-link" href="{{ sd_product.url }}">Shop this Decor Cedar cover</a>
            </article>
          {%- endif -%}
        {%- endfor -%}
      </div>
      <table class="sd-options-table">
        <thead><tr><th>Product</th><th>Price point</th><th>Available options</th><th>Best use</th></tr></thead>
        <tbody>
          {%- for sd_handle in sd_handles -%}
            {%- liquid
              assign sd_product = all_products[sd_handle]
              assign sd_reason = sd_reasons[forloop.index0]
            -%}
            {%- if sd_product != blank -%}
              <tr>
                <td><a href="{{ sd_product.url }}">{{ sd_product.title }}</a></td>
                <td>from {{ sd_product.price_min | money }}</td>
                <td>
                  {%- for option in sd_product.options_with_values limit: 3 -%}
                    <strong>{{ option.name }}:</strong>
                    {%- for value in option.values limit: 7 -%}
                      {{ value }}{%- unless forloop.last -%}, {% endunless -%}
                    {%- endfor -%}
                    {%- unless forloop.last -%}; {% endunless -%}
                  {%- endfor -%}
                </td>
                <td>{{ sd_reason }}</td>
              </tr>
            {%- endif -%}
          {%- endfor -%}
        </tbody>
      </table>
    </section>
    <script type="application/ld+json" data-sofa-decor-article-fallback-schema="2026-06-14">
      {
        "@context": "https://schema.org",
        "@graph": [
          {
            "@type": "BlogPosting",
            "@id": {{ canonical_url | append: '#blogposting' | json }},
            "headline": {{ article.title | json }},
            "description": {{ sd_guide_description | json }},
            "author": {"@type": "Organization", "name": "Decor Cedar", "url": {{ shop.url | json }}},
            "publisher": {"@type": "Organization", "name": "Decor Cedar", "url": {{ shop.url | json }}},
            "mainEntityOfPage": {"@type": "WebPage", "@id": {{ canonical_url | json }}},
            "datePublished": {{ article.published_at | date: '%Y-%m-%dT%H:%M:%S%:z' | json }},
            "dateModified": {{ 'now' | date: '%Y-%m-%dT%H:%M:%S%:z' | json }}
          },
          {
            "@type": "ItemList",
            "@id": {{ sd_schema_id | json }},
            "name": {{ sd_guide_title | json }},
            "itemListElement": [
              {%- for sd_handle in sd_handles -%}
                {%- assign sd_product = all_products[sd_handle] -%}
                {%- if sd_product != blank -%}
                  {
                    "@type": "ListItem",
                    "position": {{ forloop.index | json }},
                    "url": {{ sd_product.url | prepend: shop.url | json }},
                    "item": {
                      "@type": "Product",
                      "name": {{ sd_product.title | json }},
                      "url": {{ sd_product.url | prepend: shop.url | json }},
                      "image": {{ sd_product.featured_image | image_url: width: 1200 | prepend: 'https:' | json }},
                      "brand": {"@type": "Brand", "name": "Decor Cedar"},
                      "offers": {
                        "@type": "AggregateOffer",
                        "priceCurrency": "USD",
                        "lowPrice": {{ sd_product.price_min | divided_by: 100.0 | json }},
                        "offerCount": {{ sd_product.variants.size | json }},
                        "availability": "https://schema.org/InStock"
                      }
                    }
                  }{%- unless forloop.last -%},{%- endunless -%}
                {%- endif -%}
              {%- endfor -%}
            ]
          }
        ]
      }
    </script>
  {%- endunless -%}
{%- endif -%}
