← back to Dw Theme Boost Fix

layout/theme.liquid

1348 lines

{% comment %}DW-CHINA-BLOCK-START{% endcomment %}
{% assign dw_blocked_countries = "CN" | split: "," %}
{% assign dw_visitor_country = localization.country.iso_code | upcase %}
{% assign dw_is_blocked = false %}
{% for dw_bc in dw_blocked_countries %}
  {% assign dw_bc_trimmed = dw_bc | strip %}
  {% if dw_visitor_country == dw_bc_trimmed %}
    {% assign dw_is_blocked = true %}
  {% endif %}
{% endfor %}

{% if dw_is_blocked %}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- DW-CHINA-JS-BLOCK-START -->
<script>
(function() {
  var blockedCountries = ['CN'];
  fetch('/browsing_context_suggestions.json', {method: 'GET', credentials: 'same-origin'})
    .then(function(r) { return r.json(); })
    .catch(function() { return null; })
    .then(function(data) {
      if (data && data.detected_values && data.detected_values.country && data.detected_values.country.handle) {
        var detectedCountry = data.detected_values.country.handle.toUpperCase();
        if (blockedCountries.indexOf(detectedCountry) !== -1) {
          var container = document.createElement('div');
          container.innerHTML = '<div style="position:fixed;top:0;left:0;width:100%;height:100%;background:#f5f5f5;z-index:999999;display:flex;align-items:center;justify-content:center;font-family:-apple-system,BlinkMacSystemFont,sans-serif"><div style="text-align:center;padding:60px 40px;background:#fff;border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,.08);max-width:520px;width:90%"><div style="font-size:48px;margin-bottom:20px">&#127760;</div><h1 style="font-size:24px;margin-bottom:16px;font-weight:600;color:#333">Region Not Available</h1><p style="font-size:16px;line-height:1.6;color:#666;margin-bottom:12px">This store is not available in your region.</p><p style="font-size:16px;line-height:1.6;color:#666">We do not ship to or serve customers in your area at this time.</p></div></div>';
          document.body.innerHTML = '';
          document.body.appendChild(container);
        }
      }
    });
})();
</script>
<!-- DW-CHINA-JS-BLOCK-END -->

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Region Not Available</title>
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: #f5f5f5;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      color: #333;
    }
    .container {
      text-align: center;
      padding: 60px 40px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.08);
      max-width: 520px;
      width: 90%;
    }
    .icon { font-size: 48px; margin-bottom: 20px; }
    h1 { font-size: 24px; margin-bottom: 16px; font-weight: 600; }
    p { font-size: 16px; line-height: 1.6; color: #666; margin-bottom: 12px; }
    .contact { margin-top: 24px; font-size: 14px; color: #999; }
    .contact a { color: #2563eb; text-decoration: none; }
  </style>
<script src="{{ 'dw-grid-control.js' | asset_url }}" defer></script>





<!-- cache-bust: 2026-03-25T00:54:55.724677 -->
</head>
<body>
  <div class="container">
    <div class="icon">&#127760;</div>
    <h1>Region Not Available</h1>
    <p>We're sorry, but this store is not available in your region.</p>
    <p>We do not ship to or serve customers in your area at this time.</p>
    <div class="contact">
      Questions? Contact us at <a href="mailto:info@designerwallcoverings.com">info@designerwallcoverings.com</a>
    </div>
  </div>


</body>
</html>
{% break %}
{% endif %}
{% comment %}DW-CHINA-BLOCK-END{% endcomment %}

<!doctype html>
<html
  class="
    no-js
    loading
  "
  lang="{{ request.locale.iso_code }}"
>
<head>
<!-- Google tag (gtag.js) GA4 G-53F1QBZSG0 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-53F1QBZSG0"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-53F1QBZSG0');</script>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <!-- Preconnect Domains -->
  <link rel="preconnect" href="https://cdn.shopify.com" crossorigin>
  <link rel="preconnect" href="https://fonts.shopify.com" crossorigin>
  <link rel="preconnect" href="https://monorail-edge.shopifysvc.com">

  <!-- Preload Assets -->
  <link rel="preload" href="{{ 'chiko-icons.woff' | asset_url }}" as="font" type="font/woff" crossorigin>
  <link rel="preload" href="{{ 'pxu-social-icons.woff' | asset_url }}" as="font" type="font/woff" crossorigin>

  <link rel="preload" href="{{ 'theme.css' | asset_url }}" as="style">

  <link rel="preload" href="{{ 'modernizr-2.8.2.min.js' | asset_url  }}" as="script">

  {% if template contains 'cart' %}
    <link rel="preload" href="{{ '/services/javascripts/countries.js' }}" as="script">
    <link rel="preload" href="{{ 'shopify_common.js' | shopify_asset_url }}" as="script">
  {% endif %}

  {% if template contains 'customers' %}
    <link rel="preload" href="{{ 'shopify_common.js' | shopify_asset_url }}" as="script">
    <link rel="preload" href="{{ 'customer_area.js' | shopify_asset_url }}" as="script">
  {% endif %}

  <link rel="preload" href="{{ 'grid.js' | asset_url }}" as="script">

  <script src="//cdata.modernpostcard.com/js/E3CA4636CEDAD4.js" async defer></script>

  <title>
    {{ page_title }}

    {% if current_tags %}
      &#8211; {{ current_tags | join: ', ' }}
    {% endif %}

    {% if current_page != 1 %}
      &#8211; {{ 'general.pagination.page' | t: page_number: current_page }}
    {% endif %}

    {% unless page_title contains shop.name %}
      &#8211; {{ shop.name }}
    {% endunless %}
  </title>

  {% if page_description %}
    <meta name="description" content="{{ page_description | escape }}" />
  {% endif %}

  {% if settings.favicon %}
    <link rel="shortcut icon" href="{{ settings.favicon | img_url: '32x32' }}" type="image/png" />
  {% endif %}

  {% if template contains 'collection' and current_tags %}
    <meta name="robots" content="noindex" />
    <link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
  {% else %}
    <link rel="canonical" href="{{ canonical_url }}" />
  {% endif %}
  <meta name="viewport" content="width=device-width,initial-scale=1" />

  {%- render 'head.import-map' -%}
  {%- render 'head.is-land' -%}

  {% comment %}
  {% render 'boost-sd-fallback' %}
  {% endcomment %}
    {% render 'boost-infinite-override' %}
    {{ content_for_header }}

  {% liquid
     assign heading_text_transform = 'none'
     if settings.heading-font-small-caps
       assign heading_text_transform = 'uppercase'
     endif

     assign button_text_transform = 'none'
     assign button_letter_spacing = '0em'
     if settings.button-font-small-caps
       assign button_text_transform = 'uppercase'
       assign button_letter_spacing = '0.05em'
     endif
  %}

  <style>
    :root {
      /* ------------------------------------------------------------
        Typography
      ------------------------------------------------------------ */
      /* Body */
      --element-text-font-size--body-lg: 1.286rem; /* Product price */
      --element-text-font-size--body-sm: var(--text-size-3-5); /* SKU, installments, variant labels */
      --element-text-font-family--body: {{ settings.font_body.family }}, {{ settings.font_body.fallback_families }};
      --element-text-font-weight--body: {{ settings.font_body.weight }};

      /* Headings */
      --element-text-font-size--heading-xl: 2.5rem; /* Product title */
      --element-text-font-family--heading: {{ settings.font_heading.family }}, {{ settings.font_heading.fallback_families }};
      --element-text-font-weight--heading: {{ settings.font_heading.weight }};
      --element-text-line-height--heading: 1.25;
      --element-text-text-transform--heading: {{ heading_text_transform }};

      /* Buttons */
      --element-button-font-family: {{ settings.font_button.family }}, {{ settings.font_button.fallback_families }};
      --element-button-text-transform: {{ button_text_transform }};
      --element-button-letter-spacing: {{ button_letter_spacing }};

      /* ------------------------------------------------------------
        Colors
      ------------------------------------------------------------ */
      --color-primary: {{ settings['body-text-color'] }}; 
      --color-secondary: {{ settings['background-color'] }};
      --root-color-primary: {{ settings['body-text-color'] }}; 
      --root-color-secondary: {{ settings['background-color'] }};
      --color-focus: #0000ff;

      --color-sale-tag-text: {{ settings['background-color'] }};
      --color-sale-tag: {{ settings['product-badge-background-color'] }};
      
      --element-button-color-primary: {{ settings['button-color'] }};
      --element-button-color-secondary: {{ settings['accent-color'] }};
      
      --element-text-color: {{ settings['body-text-color'] }};
      --element-text-color--heading: {{ settings['heading-color'] }};

      --element-input-color-primary: {{ settings['form-select-color'] }};
      --element-input-color-secondary: {{ settings['form-select-background'] }};

      /* ------------------------------------------------------------
        Other
      ------------------------------------------------------------ */
      --element-badge-radius: 2px;
      --element-button-radius: 2px;

      --layout-section-max-inline-size: 1260px;
      --layout-section-padding-inline: 30px;
    }

    /* ------------------------------------------------------------
      Component overrides
    ------------------------------------------------------------ */

    ::before,
    ::after {
      box-sizing: content-box;
    }
    product-hot-reload ::before,
    product-hot-reload ::after {
      box-sizing: border-box;
    }

    /* Lightbox */
    .overlay-lightbox__overlay {
      z-index: 9999;
    }

    /* Pick up */
    .element-icon-in-stock {
      fill: currentColor;
    }

    /* Divider */
    hr.element-divider {
      height: 0;
      background: transparent;
    }

    /* Drawer */
    overlay-drawer .element-button {
      --element-button-color-primary: {{ settings.body-text-color }};
      --element-icon-stroke-width: 3px;
    }

    /* Heading */
    .element-text:is([class*=element-text--heading]) {
      --_color: var(--element-text-color--heading);
    }

    /* Element Input */
    .element-input {
      --_color-box-shadow: {{ settings['form-select-border-color'] }};
    }

    /* Variant Labels */
    label.element-text:is([class*=element-text--body]):where(.element-text--body-sm) {
      color: {{ settings['heading-color'] }};
      font-size: 1rem;

      .element-text:first-child {
        color: {{ settings['heading-color'] }};
      }
    }

    /* Element Select */
    element-select {
      --color-primary: {{ settings['form-select-border-color'] }};
      --element-button-color-primary: {{ settings['form-select-color'] }};
      --element-button-color-secondary: {{ settings['form-select-background'] }};
      --element-button-box-shadow: inset 0 0 0 1px {{ settings['form-select-border-color'] }};
      --element-button-font-family: {{ settings.font_body.family }}, {{ settings.font_body.fallback_families }};
      --element-button-text-transform: none;
    }
    element-select.element-select__wrapper--focused .element-button {
      box-shadow: inset 0 0 0 var(--element-button-border-width--focus) var(--_color-focus);
      border: none;
    }

    /* Media Gallery */
    .media-gallery__thumb {
      border-radius: 0;
    }

    /* ATC */

    product-form .element-button[type="submit"] {
      --element-button-padding-block: var(--size-5);
      --_color-text: {{ settings['button-color'] }};
      --_color-background: {{ settings['accent-color'] }};
      --_box-shadow: none;

      &:disabled {
        color: #888888 !important;
        background-color: #cccccc !important;
      }
    }

    product-form:has(.element-button--shopify-payment-wrapper) .element-button[type="submit"] {
      --element-button-color-primary: {{ settings['secondary-button-color'] }};
      --element-button-color-secondary: {{ settings['secondary-button-background'] }};
    }

    .shopify-payment-button .shopify-payment-button__button.shopify-payment-button__button--unbranded,
    .shopify-payment-button .shopify-payment-button__button {
      --element-text-line-height--body-md: 1;
      --element-button-color-primary: {{ settings['accent-color'] }};
      --element-button-color-secondary: {{ settings['button-color'] }};
      --element-button-padding-block: var(--size-5);
      --_box-shadow: none;

      text-transform: var(--element-button-text-transform);
    }
  </style>

  {% assign x_handle = settings.social-x-link | split: 'x.com/' | last | split: 'twitter.com/' | last %}
  {%
    render 'social-meta-tags',
    twitter_handle: x_handle,
    default_image: page_image,
  %}

  <!-- Theme CSS -->
  <link rel="stylesheet" href="{{ 'theme.css' | asset_url }}">
  {% render 'dw-product-styles' %}
  <link rel="stylesheet" href="{{ 'custom.css' | asset_url }}">
  <link rel="stylesheet" href="{{ 'dw-pdp-restyle.css' | asset_url }}">
  {% if settings.custom-css != blank %}
    <style>
      {{ settings.custom-css }}
    </style>
  {% endif %}

  <!-- Theme object -->
  {% comment %}Inject theme-object begin{% endcomment %}
  <script>
    var Theme = {};
    Theme.version = "7.1.0";
    Theme.name = 'Grid';
  
    Theme.currency = {{ shop.currency | json }};
    Theme.moneyFormat = {{ shop.money_format | strip_html | json }};
  
    Theme.pleaseSelectText = "{{ 'general.general.please_select' | t | strip_newlines | escape }}";
  
    Theme.addToCartSuccess = "{{ 'products.product.success_html' | t: product: '**product**', cart_link: '**cart_link**', continue_link: '**continue_link**', checkout_link: '**checkout_link**' | strip_newlines | escape }}";
  
    {% if shop.customer_accounts_enabled and customer %}
      Theme.customerLoggedIn = true;
    {% endif %}
  
    Theme.shippingCalculator = true;
    Theme.shippingButton = "{{ 'cart.shipping_calculator.submit' | t | strip_newlines | escape }}";
    Theme.shippingDisabled = "{{ 'cart.shipping_calculator.disabled' | t | strip_newlines | escape }}";
  
    {% if shop.customer_accounts_enabled and customer and customer.default_address %}
      Theme.customerAddress = {{ customer.default_address | json }};
    {% endif %}
  
    Theme.shippingCalcErrorMessage = "{{ 'cart.shipping_calculator.error' | t | strip_newlines | replace: '"','\\"' }}";
    Theme.shippingCalcMultiRates = "{{ 'cart.shipping_calculator.rates_html' | t | strip_newlines | replace: '"','\\"' }}";
    Theme.shippingCalcOneRate = "{{ 'cart.shipping_calculator.rate' | t | strip_newlines | replace: '"','\\"' }}";
    Theme.shippingCalcNoRates = "{{ 'cart.shipping_calculator.no_rates' | t | strip_newlines | replace: '"','\\"' }}";
    Theme.shippingCalcRateValues = "{{ 'cart.shipping_calculator.rate_values_html' | t | strip_newlines | replace: '"','\\"' }}";
  
    Theme.routes = {
      "root_url": "{{ routes.root_url }}",
      "account_url": "{{ routes.account_url }}",
      "account_login_url": "{{ routes.account_login_url }}",
      "account_logout_url": "{{ routes.account_logout_url }}",
      "account_register_url": "{{ routes.account_register_url }}",
      "account_addresses_url": "{{ routes.account_addresses_url }}",
      "collections_url": "{{ routes.collections_url }}",
      "all_products_collection_url": "{{ routes.all_products_collection_url }}",
      "search_url": "{{ routes.search_url }}",
      "cart_url": "{{ routes.cart_url }}",
      "cart_add_url": "{{ routes.cart_add_url }}",
      "cart_change_url": "{{ routes.cart_change_url }}",
      "cart_clear_url": "{{ routes.cart_clear_url }}",
      "product_recommendations_url": "{{ routes.product_recommendations_url }}",
      "predictive_search_url": "{{ routes.predictive_search_url }}",
    };
  </script>
  {% comment %}Inject theme-object end{% endcomment %}

  {% render 'jquery-snippet' %}
  <script src="{{ 'custom.js' | asset_url }}" defer></script>

  <script>
    (function() {
      document.documentElement.classList.remove('no-js');
      window.addEventListener('DOMContentLoaded', function() {
        document.documentElement.classList.remove('loading');
      });
      window.setTimeout(function() {
        document.documentElement.classList.remove('loading');
      }, 2000);

      if (!window.MutationObserver || !window.MutationObserver.prototype) {
        return;
      }
      var originalObserve = window.MutationObserver.prototype.observe;
      window.MutationObserver.prototype.observe = function(target, options) {
        if (!(target instanceof Node)) {
          return;
        }
        return originalObserve.call(this, target, options);
      };
    })();
  </script>

<script src="{{ 'dw-grid-control.js' | asset_url }}" defer></script>
<script src="{{ 'dw-pdp-size-pills.js' | asset_url }}" defer></script>











<!-- DW: Price hiding script REMOVED 2026-03-24 -->

<style>
/* DW 2026-06-25: grid price-hide REMOVED (Steve) — show prices everywhere */
/* Restore on product pages + cart */
#shopify-section-product [class*="price"],
#shopify-section-product span.money,
.product-add-to-cart span.money,
.shopify-product-form span.money,
.mini-cart span.money,
.cart span.money {
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  font-size: inherit !important;
  line-height: inherit !important;
  position: static !important;
  pointer-events: auto !important;
}
/* Square images */
.boost-sd__product-item [class*="product-image"],
.boost-sd__product-item [class*="image-wrapper"] {
  aspect-ratio: 1/1 !important;
  overflow: hidden !important;
}
.boost-sd__product-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
/* Hide View As toggle */
[class*="view-as"], [class*="viewAs"], .boost-sd__toolbar [class*="view"], .boost-sd [class*="toolbar-view"] {
  display: none !important;
}
/* Hide View As toggle */
[class*="view-as"],[class*="viewAs"],.boost-sd__toolbar [class*="view"],.boost-sd [class*="toolbar"] [class*="view"]{display:none!important}
/* Center text */
.boost-sd__product-item,
.boost-sd__product-item [class*="title"],
.boost-sd__product-item [class*="vendor"],
.boost-sd__product-item p,
.dw-vendor-link {
  text-align: center !important;
}
</style>
<!-- DW: killPrices REMOVED 2026-03-24 -->

<!-- /DW -->

{% comment %} DW: ItemList structured data for the Shop-by-Brand page (script tags are stripped from page body_html, so injected here) {% endcomment %}
{% if page.handle == 'brands' %}{% render 'brands-jsonld' %}{% endif %}

<!-- cache-bust: 2026-03-25T00:54:55.724677 -->

{% if template contains 'product' %}
<!-- DW: qty-inline v1 — quantity stepper moved to the right of the price (2026-07-02) -->
<style>
  .dw-price-qty-row{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
  .dw-price-qty-row .product-price{margin:0}
  .dw-price-qty-row .product-price__unit-price{flex-basis:100%}
  .dw-qty-inline{display:inline-flex;align-items:center;gap:8px}
  .dw-qty-inline .product-option-quantity-label{margin:0;white-space:nowrap}
  .dw-qty-inline .mm_quantity{margin:0}
  .dw-qty-inline .product-option-quantity-label.hidden,
  .dw-qty-inline .mm_quantity.hidden{display:none!important}
</style>
<script>
(function(){
  function relocate(){
    if(document.querySelector('.dw-qty-inline')) return;
    var qty=document.querySelector('form[action*="/cart/add"] .mm_quantity');
    if(!qty) return;
    var form=qty.closest('form');
    var priceBox=(form&&form.querySelector('.product__price'))||document.querySelector('.product__price');
    if(!priceBox) return;
    var label=(form||document).querySelector('label.product-option-quantity-label');
    var wrap=document.createElement('span'); wrap.className='dw-qty-inline';
    if(label) wrap.appendChild(label);
    wrap.appendChild(qty);
    priceBox.classList.add('dw-price-qty-row');
    priceBox.appendChild(wrap);
  }
  function init(){ relocate(); setTimeout(relocate,400); setTimeout(relocate,1200); }
  if(document.readyState!=='loading') init(); else document.addEventListener('DOMContentLoaded',init);
})();
</script>
<!-- /DW qty-inline -->
{% endif %}

{% if template contains 'product' %}
{% unless product.handle contains 'dig-' %}
<!-- DW: price-buy v1 — add-to-cart by price; request pill + PDF row; collapse sample selector (2026-07-06) -->
<style>
  .product__price.dw-has-add{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
  /* unify SKU / price / Quantity to one size (16px) */
  .product-sku-label{font-size:16px!important}
  .product__price .product-price-minimum.money,.product__price .money{font-size:16px!important}
  /* tighten the price row so the qty row sits close WITHOUT a negative margin (no overlap) */
  .product__price{min-height:0!important}
  .product__price .product-price{margin:0!important;line-height:1.2!important}
  /* more space between SKU and price (theme's .product__price margin is locked; use higher specificity) */
  .product__price.dw-price-qty-row{margin-top:12px!important}
  /* quantity + add-to-cart on one line below the price */
  .dw-qty-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}
  /* match "QUANTITY:" to the SKU/PRICE label style (grey, uppercase, 500); label wraps text in <strong> */
  .dw-qty-row .product-option-quantity-label,.dw-qty-row .product-option-quantity-label strong{color:rgb(136,136,136)!important;font-weight:500!important;text-transform:uppercase!important;letter-spacing:0.96px!important;font-size:16px!important}
  .dw-qty-row .product-option-quantity-label{margin:0!important}
  .dw-qty-row .mm_quantity,.dw-qty-row .mm_quantity *{font-weight:400!important}
  .dw-qty-row .mm_quantity input.qty,.dw-qty-row .mm_quantity input[name="quantity"]{font-weight:700!important}
  /* add-to-cart pill to the right of the stepper, SAME size as Request Sample */
  .dw-qty-row .cowlendar-add-to-cart{width:auto!important;margin:0!important;flex:0 0 auto!important;height:auto!important;min-height:0!important;border-radius:999px!important;font-size:12px!important;font-weight:500!important;padding:10px 30px!important}
  /* hide add-to-cart until the overlay places it in the qty row (kills the load-flicker);
     the JS fail-safe reveals it regardless after 15s so it can never stay hidden */
  input.add-to-cart.cowlendar-add-to-cart{visibility:hidden}
  input.add-to-cart.cowlendar-add-to-cart.dw-add-ready{visibility:visible}
  .dw-price-buy-row2{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px}
  .dw-price-buy-row2 .dl-sample-btn{flex:0 0 auto!important;width:auto!important;margin:0!important;padding-left:30px!important;padding-right:30px!important}
  .dw-price-buy-row2 .spec-sheet-controls{margin:0!important;transform:none!important;flex:0 0 auto!important;width:auto!important;max-width:168px!important}
  /* Download PDF -> black pill hugging the words (theme forces a wide box; cap it) */
  .dw-price-buy-row2 .spec-sheet-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;max-width:168px!important;min-width:0!important;padding:10px 18px!important;background:#000!important;color:#fff!important;border-color:#000!important}
  .dw-price-buy-row2 .spec-sheet-btn:hover{background:#1a1a1a!important}
  /* single-roll pricing note + dimensions (bolt / min-2 products only) */
  .dw-sr-note{font-size:12px!important;color:rgb(136,136,136)!important;letter-spacing:.02em;margin-left:6px}
  .dw-sr-dims{font-size:12px!important;color:rgb(90,90,90)!important;margin-left:18px;white-space:nowrap}
  .dw-2roll-note{font-size:13px!important;font-weight:600;color:rgb(60,66,70)!important;margin-top:6px;letter-spacing:.01em}
</style>
<script>
(function () {
  if (window.__dwPriceBuyLoaded) return;
  window.__dwPriceBuyLoaded = true;
  function collapseSelector(form) {
    var select = form.querySelector('select.single-option-selector');
    if (!select) return false;
    var opts = Array.prototype.slice.call(select.options);
    var samples = opts.filter(function (o) { return /sample/i.test(o.value); });
    if (!(opts.length <= 2 && samples.length >= 1)) return false;
    var sellable = opts.filter(function (o) { return !/sample/i.test(o.value); })[0];
    if (sellable && select.value !== sellable.value) {
      select.value = sellable.value;
      try { select.dispatchEvent(new Event('change', { bubbles: true })); }
      catch (e) { var ev = document.createEvent('HTMLEvents'); ev.initEvent('change', true, false); select.dispatchEvent(ev); }
    }
    var pills = form.querySelector('.dw-size-pills');
    if (pills && pills.parentNode) pills.parentNode.removeChild(pills);
    return true;
  }
  // On bolt / min-2-single-roll products only: mark the price "/ single roll",
  // show the single-roll dimensions, and split Length into D/R + S/R.
  function srEnhance() {
    var qi = document.querySelector('.mm_quantity input.qty, .mm_quantity input[name="quantity"]');
    if (!qi) return;
    var isBolt = parseInt(qi.getAttribute('min'), 10) === 2 || parseInt(qi.getAttribute('step'), 10) === 2;
    if (!isBolt) return;
    // Steve 2026-07-09: min/step==2 ALONE mislabels per-yard FABRICS that carry a
    // 2-unit factor (UFAC=2 leaked onto ~144 Kravet-family multipurpose/upholstery
    // goods). Roll language must key off the actual UNIT, not the quantity floor:
    // only enhance when the sellable variant is genuinely sold by the roll/bolt.
    var unitText = '';
    var uSel = document.querySelector('form[action*="/cart/add"] select.single-option-selector');
    if (uSel) Array.prototype.forEach.call(uSel.options, function (o) {
      if (!/sample/i.test(o.value)) unitText += ' ' + o.value;
    });
    if (!/\b(roll|bolt)\b/i.test(unitText)) return;
    // read the VISIBLE SPECIFICATIONS (.dw-specs -> .dw-spec-row -> .dw-spec-label/.dw-spec-value)
    var specs = document.querySelector('.dw-specs');
    function specVal(re) {
      var out = null;
      if (specs) Array.prototype.forEach.call(specs.querySelectorAll('.dw-spec-row'), function (rw) {
        var l = ((rw.querySelector('.dw-spec-label') || {}).textContent || '').trim();
        if (re.test(l)) out = ((rw.querySelector('.dw-spec-value') || {}).textContent || '').trim();
      });
      return out;
    }
    // single-roll length + dimensions (D/R length / 2, since 1 bolt = 2 single rolls)
    var srLen = specVal(/^Length S\/R$/i);
    if (!srLen) {
      var dr = specVal(/^Length(?:\s*D\/R)?$/i);
      if (dr) { var srHalf = dr.replace(/[\d.]+/g, function (x) { return (Math.round((parseFloat(x) / 2) * 1000) / 1000) + ''; }); srLen = /\d/.test(srHalf) ? srHalf : null; }
    }
    var wVal = specVal(/^Width$/i);
    var srDims = (wVal && srLen) ? (wVal.split(/\s*x\s*/i)[0].trim() + ' x ' + srLen) : null;
    // rewrite the visible specs once: Length -> Length D/R, add Single Roll + Length S/R rows above it
    if (specs && !specs.dataset.dwSr) {
      var lengthRow = null;
      Array.prototype.forEach.call(specs.querySelectorAll('.dw-spec-row'), function (rw) {
        if (/^Length$/i.test(((rw.querySelector('.dw-spec-label') || {}).textContent || '').trim())) lengthRow = rw;
      });
      if (lengthRow) {
        specs.dataset.dwSr = '1';
        lengthRow.querySelector('.dw-spec-label').textContent = 'Length D/R';
        if (srDims) {
          var srRow = document.createElement('div'); srRow.className = 'dw-spec-row';
          srRow.innerHTML = '<span class="dw-spec-label">Length S/R</span><span class="dw-spec-value">' + srLen + '</span>';
          lengthRow.parentNode.insertBefore(srRow, lengthRow);
          var dimRow = document.createElement('div'); dimRow.className = 'dw-spec-row';
          dimRow.innerHTML = '<span class="dw-spec-label">Single Roll</span><span class="dw-spec-value">' + srDims + '</span>';
          lengthRow.parentNode.insertBefore(dimRow, srRow);
        }
      }
    }
    // price note + dims
    var money = document.querySelector('.product__price .product-price-minimum.money');
    if (money && !document.querySelector('.dw-sr-note')) { var note = document.createElement('span'); note.className = 'dw-sr-note'; note.textContent = '/ single roll'; money.after(note); }
    var price = document.querySelector('.product__price');
    if (srDims && price && !price.querySelector('.dw-sr-dims')) { var d = document.createElement('span'); d.className = 'dw-sr-dims'; d.textContent = 'Single roll: ' + srDims; price.appendChild(d); }
    // Steve 2026-07-08: every 2-roll-minimum product states the increment rule plainly in the buy box.
    if (price && !price.querySelector('.dw-2roll-note')) { var n2 = document.createElement('div'); n2.className = 'dw-2roll-note'; n2.textContent = 'Sold in 2 roll increments only'; price.appendChild(n2); }
  }

  // Clean the KEYWORDS list (display-only): drop namespaced tags, spec/operational
  // tags, leading-"and" artifacts, and case duplicates. Tags stay intact for search.
  function kwFilter() {
    var box = document.querySelector('.keywords-desktop');
    if (!box || box.dataset.dwKw) return;
    var links = Array.prototype.slice.call(box.querySelectorAll('a'));
    if (!links.length) return;
    box.dataset.dwKw = '1';
    var seen = {};
    var DROP = /(:|fire\s*rat|astm|class\s*"?a"?|suitable\s+for|coated\s+paper|traffic|light\s+duty|heavy\s+duty|residential\s+use|background\s+color|non[-\s]?woven|scrubbab|removable|paste\s+the|washab)/i;
    links.forEach(function (a) {
      var t = (a.textContent || '').trim();
      var key = t.toLowerCase().replace(/^and\s+/, '').trim();
      var drop = t === '' || DROP.test(t) || /^and\s+/i.test(t) || seen[key];
      if (drop) {
        var nxt = a.nextSibling;
        if (nxt && nxt.nodeType === 3 && /^[\s,]+$/.test(nxt.nodeValue)) nxt.parentNode.removeChild(nxt);
        else { var prev = a.previousSibling; if (prev && prev.nodeType === 3 && /^[\s,]+$/.test(prev.nodeValue)) prev.parentNode.removeChild(prev); }
        a.parentNode.removeChild(a);
      } else { seen[key] = 1; }
    });
  }

  function build() {
    var form = document.querySelector('.product__form') || document.querySelector('form[action*="/cart/add"]');
    if (!form) return false;
    var price = document.querySelector('.product__price');
    if (!price) return false;
    var req = form.querySelector('.dl-sample-btn');
    var pdf = document.querySelector('.spec-sheet-controls');
    var row2 = document.querySelector('.dw-price-buy-row2');
    if (!row2 && req) {
      row2 = document.createElement('div');
      row2.className = 'dw-price-buy-row2';
      price.parentNode.insertBefore(row2, price.nextSibling);
    }
    if (row2) {
      if (req && req.parentNode !== row2) row2.appendChild(req);
      if (pdf && pdf.parentNode !== row2) row2.appendChild(pdf);
    }
    // quantity + add-to-cart on their own line, between the price and row2.
    var qty = document.querySelector('.mm_quantity');
    var qlabel = document.querySelector('.product-option-quantity-label');
    var qrow = document.querySelector('.dw-qty-row');
    if (qty && !qrow) {
      qrow = document.createElement('div');
      qrow.className = 'dw-qty-row';
      price.parentNode.insertBefore(qrow, price.nextSibling);
    }
    if (qrow) {
      if (qlabel && qlabel.parentNode !== qrow) qrow.appendChild(qlabel);
      if (qty && qty.parentNode !== qrow) qrow.appendChild(qty);
      var add = document.querySelector('input.add-to-cart.cowlendar-add-to-cart, .cowlendar-add-to-cart');
      if (add && add.offsetParent !== null && add.parentNode !== qrow) qrow.appendChild(add);
    }
    var collapsed = collapseSelector(form);
    if (collapsed) {
      Array.prototype.forEach.call(document.querySelectorAll('.dw-size-pill'), function (b) {
        if (b.parentNode) b.parentNode.removeChild(b);
      });
    }
    return !!(row2 && row2.querySelector('.dl-sample-btn'));
  }
  function placeAndReveal() {
    build();
    srEnhance();
    kwFilter();
    var placed = document.querySelector('.dw-qty-row .cowlendar-add-to-cart');
    if (placed) placed.classList.add('dw-add-ready');
  }
  function init() {
    placeAndReveal();
    // cowlendar injects the add-to-cart late; keep trying to place it for ~20s
    var tries = 0, iv = setInterval(function () { placeAndReveal(); if (++tries > 100) clearInterval(iv); }, 200);
    try {
      var mo = new MutationObserver(function () { placeAndReveal(); });
      mo.observe(document.body, { childList: true, subtree: true });
      setTimeout(function () { mo.disconnect(); }, 20000);
    } catch (e) {}
    // fail-safe: never leave the add-to-cart hidden, even if placement never happens
    setTimeout(function () { var a = document.querySelector('.cowlendar-add-to-cart'); if (a) a.classList.add('dw-add-ready'); }, 15000);
  }
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init();
  window.addEventListener('load', function () { setTimeout(placeAndReveal, 800); });
})();
</script>
<!-- /DW price-buy -->
{% endunless %}
{% endif %}

</head>

<body
  class="
    template-{{ template.name }}
    template-suffix-{{ template.suffix }}

    {% if customer %}
      customer-logged-in
    {% endif %}
  "
>

  {%- comment -%}
    ── China Region Block (added 2026-02-27) ──
    Blocks visitors from CN country code with a full-screen overlay.
  {%- endcomment -%}
  {%- if localization.country.iso_code == 'CN' -%}
    <div id="region-block" style="position:fixed;inset:0;z-index:999999;background:#ffffff;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:40px;font-family:-apple-system,BlinkMacSystemFont,sans-serif;">
      <h1 style="font-size:24px;color:#333;margin-bottom:16px;">This store is not available in your region</h1>
      <p style="font-size:16px;color:#666;max-width:500px;">We apologize for the inconvenience, but this store does not currently serve customers in your region.</p>
    </div>
    <style>body{overflow:hidden !important;}</style>
  {%- endif -%}

  {% sections 'header-group' %}

  <div style="--background-color: {{ settings.background-color }}">
    {%
      render 'age-gate',
      id: 'page',
      sections: content_for_layout,
    %}
  </div>

  {% include 'quickshop' %}

  {% comment %}Inject icon-star-symbol begin{% endcomment %}
  <svg
    class="icon-star-reference"
    aria-hidden="true"
    focusable="false"
    role="presentation"
    xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="3 3 17 17" fill="none"
  >
    <symbol id="icon-star">
      <rect class="icon-star-background" width="20" height="20" fill="currentColor"/>
      <path d="M10 3L12.163 7.60778L17 8.35121L13.5 11.9359L14.326 17L10 14.6078L5.674 17L6.5 11.9359L3 8.35121L7.837 7.60778L10 3Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
    </symbol>
    <clipPath id="icon-star-clip">
      <path d="M10 3L12.163 7.60778L17 8.35121L13.5 11.9359L14.326 17L10 14.6078L5.674 17L6.5 11.9359L3 8.35121L7.837 7.60778L10 3Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    </clipPath>
  </svg>
  {% comment %}Inject icon-star-symbol end{% endcomment %}

  <div class="main-content">
    {% render "dw-boost-overrides" %}
{{ content_for_layout }}
  </div>

  <div class="site-overlay" data-site-overlay></div>

  {% sections 'footer-group' %}

  <!-- Scripts -->
  <!-- Third Party JS Libraries -->
  <script src="{{ 'modernizr-2.8.2.min.js' | asset_url  }}" defer></script>

  {% if template contains 'cart' %}
    <script src="{{ '/services/javascripts/countries.js' }}" defer></script>
    <script src="{{ 'shopify_common.js' | shopify_asset_url }}" defer></script>
  {% endif %}

  {% if template contains 'customers' %}
    <script src="{{ 'shopify_common.js' | shopify_asset_url }}" defer></script>
    <script src="{{ 'customer_area.js' | shopify_asset_url }}" defer></script>
  {% endif %}

  <script src="{{ 'grid.js' | asset_url }}" defer></script>

  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-article begin{% endcomment %}
  {% comment %}
    Article structured data
    https://developers.google.com/search/docs/data-types/articles
  {% endcomment %}
  
  {% if template contains 'article' %}
    {%- capture article_description  -%}
      {%- if article.excerpt != blank -%}
        {{ article.excerpt | strip_html }}
      {%- else -%}
        {{ article.content | truncatewords: 100 | strip_html }}
      {%- endif -%}
    {%- endcapture -%}
  
    <script type="application/ld+json">
      {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "mainEntityOfPage": {
          "@type": "WebPage",
          "@id": "{{ shop.url }}{{ article.url }}"
        },
        "headline": {{ article.title | json }},
        {% if article.image %}
          "image": {
            "@type": "ImageObject",
            "url": {{ article.image | img_url: '800x800' | prepend: 'https:' | json }},
            "height": 800,
            "width": 800
          },
        {% endif %}
        "datePublished": {{ article.published_at | date: '%Y-%m-%dT%H:%M:%S%z' | json}},
        "dateModified": {{ article.published_at | date: '%Y-%m-%dT%H:%M:%S%z' | json}},
        "author": {
          "@type": "Person",
          "name": {{ article.author | json }}
        },
        "publisher": {
          "@type": "Organization",
          "name": {{ shop.name | json }},
          "logo": {
            "@type": "ImageObject",
            "url": {{ article.user.image | img_url: '200x200' | prepend: 'https:' | json }}
          }
        },
        "description": {{ article_description | json }}
      }
    </script>
  {% endif %}
  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-article end{% endcomment %}

  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-breadcrumbs begin{% endcomment %}
  {% comment %}
    Breadcrumbs
    https://developers.google.com/search/docs/data-types/breadcrumbs
  {% endcomment %}
  
  {%- if current_tags -%}
    {%- assign tag_names = current_tags | join: ', ' %}
    {% comment %}Converting an array to a handle converts it to a string{% endcomment %}
    {%- capture tag_handles -%}
      {%- for tag in current_tags -%}
        {{- tag | handle | append: '|' -}}
      {%- endfor -%}
    {%- endcapture -%}
  {%- endif -%}
  
  {% if collection.url == blank %}
    {% assign collection_url = '/collections/all' %}
  {% else %}
    {% assign collection_url = collection.url %}
  {% endif %}
  
  {% if template.name == 'product'
      or template.name == 'list-collections'
      or template.name == 'collection'
      or template.name == 'blog'
      or template.name == 'article'
      or template.name == 'search'
      or template.name == 'cart'
      or template.name == 'page'
  %}
  
    <script type="application/ld+json">
      {
        "@context": "http://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement": [
        {% case template.name %}
          {% when 'product' %}
            {% if product.collections.size >= 1 %}
              {
                "@type": "ListItem",
                "position": 1,
                "item": {
                  "@id": "{{ shop.url }}/collections",
                  "name": {{ 'structured_data.breadcrumbs.collections' | t | json }}
                }
              },
              {
                "@type": "ListItem",
                "position": 2,
                "item": {
                  "@id": "{{ shop.url }}/collections/{{ product.collections.first.handle }}",
                  "name": {{ product.collections.first.title | json }}
                }
              },
            {% else %}
              {
                "@type": "ListItem",
                "position": 1,
                "item": {
                  "@id": "{{ shop.url }}/products",
                  "name": {{ 'structured_data.breadcrumbs.products' | t | json }}
                }
              },
            {% endif %}
            {
              "@type": "ListItem",
              "position": {% if product.collections.size >= 1 %}3{% else %}2{% endif %},
              "item": {
                "@id": "{{ shop.url }}{{ product.url | within: collection }}",
                "name": {{ product.title | json }}
              }
            }
          {% when 'list-collections' %}
            {
              "@type": "ListItem",
              "position": 1,
              "item": {
                "@id": "{{ shop.url }}/collections",
                "name": {{ 'structured_data.breadcrumbs.collections' | t | json }}
              }
            }
            {% if current_page != 1 %}
              ,
              {
                "@type": "ListItem",
                "position": 2,
                "item": {
                  "@id": "{{ shop.url }}/collections",
                  "name": {{ 'structured_data.breadcrumbs.page' | t: page: current_page | json }}
                }
              }
            {% endif %}
          {% when 'collection' %}
            {
              "@type": "ListItem",
              "position": 1,
              "item": {
                "@id": "{{ shop.url }}/collections",
                "name": {{ 'structured_data.breadcrumbs.collections' | t | json }}
              }
            },
            {
              "@type": "ListItem",
              "position": 2,
              "item": {
                "@id": "{{ shop.url }}{{ collection_url }}",
                "name": {{ collection.title | json }}
              }
            }
            {% if current_tags %}
              ,
              {
                "@type": "ListItem",
                "position": 3,
                "item": {
                  "@id": "{{ shop.url }}{{ collection_url }}/{{- tag_handles | split: '|' | join: '+' -}}",
                  "name": {{ 'structured_data.breadcrumbs.tags_html' | t: tags: tag_names | json }}
                }
              }
            {% endif %}
            {% if current_page != 1 %}
              {% if current_tags %}
                {% assign position = 4 %}
              {% else %}
                {% assign position = 3 %}
              {% endif %}
              ,
              {
                "@type": "ListItem",
                "position": {{ position }},
                "item": {
                  "@id": "{{ shop.url }}/collections?page={{ current_page }}",
                  "name": {{ 'structured_data.breadcrumbs.page' | t: page: current_page | json }}
                }
              }
            {% endif %}
          {% when 'blog' or 'article' %}
            {
              "@type": "ListItem",
              "position": 1,
              "item": {
                "@id": "{{ shop.url }}{{ blog.url }}",
                "name": {{ blog.title | json }}
              }
            }
            {% if template.name == 'article' %}
              ,
              {
                "@type": "ListItem",
                "position": 2,
                "item": {
                  "@id": "{{ shop.url }}{{ article.url }}",
                  "name": {{ article.title | json }}
                }
              }
            {% elsif current_tags %}
              ,
              {
                "@type": "ListItem",
                "position": 2,
                "item": {
                  "@id": "{{ shop.url }}{{ blog.url }}/tagged/{{- tag_handles | split: '|' | join: '+' -}}",
                  "name": {{ 'structured_data.breadcrumbs.tags_html' | t: tags: tag_names | json }}
                }
              }
            {% endif %}
            {% if current_page != 1 %}
              {% if current_tags %}
                {% assign position = 3 %}
                {%- capture url -%}
                  {{ shop.url }}{{ blog.url }}/tagged/{{ tag_handles | split: '|' | join: '+' }}?page={{ current_page }}
                {%- endcapture -%}
              {% else %}
                {% assign position = 2 %}
                  {%- capture url -%}
                  {{ shop.url }}{{ blog.url }}?page={{ current_page }}
                {%- endcapture -%}
              {% endif %}
              ,
              {
                "@type": "ListItem",
                "position": {{ position }},
                "item": {
                  "@id": "{{ url }}",
                  "name": {{ 'structured_data.breadcrumbs.page' | t: page: current_page | json }}
                }
              }
            {% endif %}
          {% when 'search' %}
            {
              "@type": "ListItem",
              "position": 1,
              "item": {
                "@id": "{{ shop.url }}/search",
                "name": {{ 'structured_data.breadcrumbs.search' | t | json }}
              }
            }
            {% if search.performed %}
            ,
              {
                "@type": "ListItem",
                "position": 2,
                "item": {
                  "@id": "{{ shop.url }}/search?q={{ search.terms }}",
                  "name": {{ search.terms | json }}
                }
              }
              {% if current_page != 1 %}
              ,
                {
                  "@type": "ListItem",
                  "position": 3,
                  "item": {
                    "@id": "{{ shop.url }}/search?page={{ current_page }}&q={{ search.terms }}",
                    "name": {{ 'structured_data.breadcrumbs.page' | t: page: current_page | json }}
                  }
                }
              {% endif %}
            {% endif %}
          {% when 'cart' %}
            {
              "@type": "ListItem",
              "position": 1,
              "item": {
                "@id": "{{ shop.url }}/cart",
                "name": {{ 'structured_data.breadcrumbs.cart' | t | json }}
              }
            }
          {% when 'page' %}
            {
              "@type": "ListItem",
              "position": 1,
              "item": {
                "@id": "{{ page.url }}",
                "name": {{ page.title | json }}
              }
            }
          {% else %}
          {% endcase %}
        ]
      }
    </script>
  {% endif %}
  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-breadcrumbs end{% endcomment %}

  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-product begin{% endcomment %}
  {% comment %}
    Product structured data
    https://developers.google.com/search/docs/data-types/products
  {% endcomment %}
  
  {% if template contains 'product' %}
    {% assign selected_variant = product.selected_or_first_available_variant | default: product.variants.first %}
    {% assign product_image = selected_variant.featured_image | default: product.featured_image %}
    {%- capture product_name -%}
      {{ product.title }}
      {%- if selected_variant.title != 'Default Title' and selected_variant.option1 == 'Default Title' -%}
        - {{ selected_variant.title }}
      {%- endif -%}
    {%- endcapture -%}
  
    {%- assign now = 'now' | date: '%Y-%m-%d' | split: '-' -%}
    {% capture year_from_now %}{{ now[0] | plus: 1 }}-{{ now[1] }}-{{ now[2] | at_most: 28 }}{% endcapture %}
  
    <script type="application/ld+json">
    {
      "@context": "http://schema.org/",
      "@type": "Product",
      "name": {{ product_name | strip_newlines | json }},
      "image": {{ product_image | img_url: '1024x1024' | prepend: 'https:' | json }},
      {% if product.description != blank %}
        "description": {{ product.description | json }},
      {% endif %}
      {% if product.vendor %}
        "brand": {
          "@type": "Thing",
          "name": {{ product.vendor | json }}
        },
      {% endif %}
      {% if selected_variant.sku != blank %}
        "sku": {{ selected_variant.sku | json }},
      {% endif %}
      {% if selected_variant.barcode != blank %}
        "mpn": {{ selected_variant.barcode | json }},
      {% endif %}
      "offers": {
        "@type": "Offer",
        "priceCurrency": {{ cart.currency.iso_code | json }},
        "price": {{ selected_variant.price | divided_by: 100.0 | json }},
        "availability": "http://schema.org/{% if selected_variant.available %}InStock{% else %}OutOfStock{% endif %}",
        "url": "{{ shop.url }}{{ selected_variant.url }}",
        "seller": {
          "@type": "Organization",
          "name": {{ shop.name | json }}
        },
        "priceValidUntil": {{ year_from_now | json }}
      }
    }
    </script>
  {% endif %}
  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-product end{% endcomment %}

  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-website begin{% endcomment %}
  {% comment %}
    Store information
    https://developers.google.com/search/docs/data-types/sitename
  {% endcomment %}
  
  <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "name": "{{ shop.name }}",
      "url": "{{ shop.url }}"
    }
  </script>
  {% comment %}Inject @pixelunion/shopify-structured-data/structured-data-website end{% endcomment %}

  <form id="checkout_form" action="{{ routes.cart_url }}" method="POST" style="display: none;"></form>

  <script>
    (function () {
      function handleFirstTab(e) {
        if (e.keyCode === 9) { // the "I am a keyboard user" key
          document.body.classList.add('user-is-tabbing');
          window.removeEventListener('keydown', handleFirstTab);
        }
      }
      window.addEventListener('keydown', handleFirstTab);
    })();
  </script>
  <script>(function(n, v) {/* eslint-disable-next-line max-len */if (window.Shopify && window.Shopify.theme && navigator && navigator.sendBeacon && window.Shopify.designMode) {if (sessionStorage.getItem('oots_beacon')) return;navigator.sendBeacon('https://app.outofthesandbox.com/beacon', new URLSearchParams({shop_domain: window.Shopify.shop.toLowerCase(),shop_id: '{{ shop.id }}',shop_email: '{{ shop.email }}',theme_name: n.toLowerCase(),theme_version: v.toLowerCase(),theme_store_id: window.Shopify.theme.theme_store_id,theme_id: window.Shopify.theme.id,theme_role: window.Shopify.theme.role,}));sessionStorage.setItem('oots_beacon', '');}}('grid','7.1.0'))</script>

<!--Start of Zendesk Chat Script-->
<script async>
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute("charset","utf-8");
$.src="https://v2.zopim.com/?RH5Yjru86SIJRwOxfiMAf2DTCgdROhhf";z.t=+new Date;$.
type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");
</script>
<!--End of Zendesk Chat Script-->
<!-- Statcounter code for DW - Started 3/5/19
http://DesignerWallcoverings.com on Shopify -->
<script type="text/javascript">
var sc_project=11961678; 
var sc_invisible=1; 
var sc_security="9d9a53bd"; 
var sc_https=1; 
</script>
<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js"
async></script>
<noscript><div class="statcounter"><a title="web statistics"
href="https://statcounter.com/" target="_blank"><img
class="statcounter"
src="https://c.statcounter.com/11961678/0/9d9a53bd/1/"
alt="web statistics"></a></div></noscript>
<!-- End of Statcounter Code -->

{% render 'hide-browse-hidden' %}

<!-- DW: price restore band-aid removed 2026-06-11 — root cause (blank saw_variant_price) fixed in product-form-content.liquid; no price-hiding CSS exists. -->
{%- comment -%} DW Shop-by-Color wheel {%- endcomment -%}
<script>window.DW_CW_DATA="{{ 'dw-color-wheel-data.json' | asset_url }}";</script>
<script src="{{ 'dw-color-wheel.js' | asset_url }}" defer></script>
{%- comment -%} DW Phillip-Jeffries browse hide (stopgap) {%- endcomment -%}
<script src="{{ 'dw-pj-hide.js' | asset_url }}" defer></script>
{%- comment -%} DW card hover label: Pattern, Color + Vendor on hover (2026-06-22) {%- endcomment -%}
<script src="{{ 'dw-card-hover.js' | asset_url }}" defer></script>

<!-- DW min-qty start -->
{% if template contains 'product' %}
<script>
(function () {
  function minFromText(s) {
    if (/sample/i.test(s)) return 1;                 // a sample is always a single unit
    var m = String(s || '').match(/(\d+)\s*yd\s*min/i);
    return m ? parseInt(m[1], 10) : null;
  }
  function qtyInput() {
    return document.querySelector('.mm_quantity .input-text.qty, .mm_quantity input.qty, .input-text.qty');
  }
  // the Size selector = the single-option-selector whose selected label encodes a "yd min"
  function sizeText() {
    var sels = document.querySelectorAll('select.single-option-selector, select[name^="options"]');
    for (var i = 0; i < sels.length; i++) {
      var s = sels[i];
      if (s.selectedIndex < 0 || !s.options[s.selectedIndex]) continue;
      var t = s.options[s.selectedIndex].textContent;
      if (/yd\s*min|wallcovering|sold\s*per\s*yard|sample/i.test(t)) return t;
    }
    return '';
  }
  function currentMin() { return minFromText(sizeText()) || 1; }

  function clampUp(qi) {
    if (qi && qi.getAttribute && qi.getAttribute('data-order-min')) return; // yield: custom.js data-order-* stepper owns MOQ qty
    var min = parseInt(qi.getAttribute('min'), 10) || 1;
    var v = parseInt(qi.value, 10);
    if (isNaN(v) || v < min) { if (String(qi.value) !== String(min)) qi.value = min; }
  }
  function applyMin(forceValue) {
    var qi = qtyInput();
    if (!qi) return;
    if (qi.getAttribute('data-order-min')) return; // yield: custom.js data-order-* stepper owns MOQ qty
    var min = currentMin();
    if (String(qi.getAttribute('min')) !== String(min)) qi.setAttribute('min', min);
    if (qi.getAttribute('step') !== '1') qi.setAttribute('step', 1);  // floor only; +1 increments above it
    var cur = parseInt(qi.value, 10);
    if (forceValue || isNaN(cur) || cur < min) {
      if (String(qi.value) !== String(min)) { qi.value = min; qi.dispatchEvent(new Event('change', { bubbles: true })); }
    } else { clampUp(qi); }
  }

  function wire() {
    var qi = qtyInput();
    if (qi && !qi.__minClamp) {
      qi.__minClamp = true;
      ['input', 'change', 'blur', 'keyup'].forEach(function (ev) { qi.addEventListener(ev, function () { clampUp(qi); }); });
    }
    // re-clamp after the ± buttons act
    document.querySelectorAll('.mm_quantity .minus, .mm_quantity .plus').forEach(function (b) {
      if (b.__minClamp) return; b.__minClamp = true;
      b.addEventListener('click', function () { setTimeout(function () { clampUp(qtyInput() || {}); }, 20); });
    });
    // variant pickers -> jump to the new floor
    document.querySelectorAll('select.single-option-selector, select[name^="options"], input[type="radio"][name*="ption"]').forEach(function (el) {
      if (el.__minWired) return; el.__minWired = true;
      el.addEventListener('change', function () { setTimeout(function () { applyMin(true); }, 40); });
    });
    applyMin(true);
  }

  function start() {
    wire();
    // the theme resets qty to 1 at ~1000ms — re-apply after that so the floor wins
    [1100, 1600, 2500].forEach(function (t) { setTimeout(function () { applyMin(true); }, t); });
    // the theme REBUILDS the qty widget on variant change (resetting min to 1); a light
    // recurring re-assert keeps the floor correct without disrupting values at/above it
    setInterval(function () { wire(); applyMin(false); }, 400);
  }
  if (document.readyState !== 'loading') start();
  else document.addEventListener('DOMContentLoaded', start);
  // re-wire if the form re-renders (debounced; keeps min synced, never forces value)
  var d;
  new MutationObserver(function () { clearTimeout(d); d = setTimeout(function () { wire(); applyMin(false); }, 150); })
    .observe(document.documentElement, { subtree: true, childList: true });
})();
</script>
{% endif %}
<!-- DW min-qty end -->
{% unless customer %}{% render 'dw-signin-modal' %}{% endunless %}
</body>
</html>