{"side_cart":"<div id=\"shopify-section-side_cart\" class=\"shopify-section type_Side_Cart\"><script class=\"cartFlagX\"></script><div id=\"side-cart\" class=\"ease-animation scheme scheme-1 slide-in-modal inner-scroll\" role=\"dialog\" aria-modal=\"true\" \n  data-tier1-threshold=\"9800\"\n  data-tier2-threshold=\"14997\"\n  data-tier3-threshold=\"25000\"\n  data-pillowcase-handle=\"\"\n  data-robe-handle=\"\">\n  \n  <div class=\"content flex direction-column\">\n    <div class=\"head scheme scheme-1 \">\n      <div class=\"title\">Your Cart</div>\n      <button class=\"close\" aria-label=\"Close Side Cart\">\n        <svg aria-hidden=\"true\"  role=\"presentation\" class=\"icon icon-close\" viewBox=\"0 0 32 32\"><path d=\"M4.2,4.2,27.8,27.8m-23.6,0L27.8,4.2\"/></svg>\n      </button>\n    </div>\n    <div class=\"wrap flex-1\" data-dynamic-content=\"sidecart\"><div class=\"empty text-center\">\n          <div class=\"title\">\n            <br/>\n            Your cart is empty.\n          </div>\n          <a href=\"/collections/all-products-1\" class=\"btn\">Start Shopping</a>\n        </div><script src=\"//fluff.co/cdn/shop/t/155/assets/component_carousel.js?v=97973129351265672521767614562\" defer=\"defer\"></script></div>\n\n\n\n    <div class=\"foot scheme scheme-1 scheme-border-top\" style=\"display: none;\">\n\n\n    <!-- Discount Code Bar --><div data-dynamic-content=\"sidecart-foot\"><div class=\"subtotals justify-content-center\">\n          <div class=\"subtotal\">\n            \n            <span>Subtotal: \n              <span>(0)</span>\n              \n                items\n              \n          </span> \n            <div class=\"prices-wrapper\">\n              \n              <strong><span style=\"display:none\" class=\"tdf-cart-total-flag\"></span>$0.00</strong>\n            </div>\n          </div></div>\n              \n\n              \n</div>\n      \n      <div class=\"buttons-wrapper text-center\">\n\n        <button type=\"button\" name=\"checkout\" class=\"btn btn-checkout one-whole\" onclick=\"$s.checkout(this);\">\n          Check out\n        </button><div class=\"additional-checkout-buttons\">\n            <div class=\"dynamic-checkout__content\" id=\"dynamic-checkout-cart\" data-shopify=\"dynamic-checkout-cart\"> <shopify-accelerated-checkout-cart wallet-configs=\"[{&quot;supports_subs&quot;:true,&quot;supports_def_opts&quot;:false,&quot;name&quot;:&quot;shop_pay&quot;,&quot;wallet_params&quot;:{&quot;shopId&quot;:43450171553,&quot;merchantName&quot;:&quot;FluffCo | Hotel Comfort&quot;,&quot;personalized&quot;:true}},{&quot;supports_subs&quot;:false,&quot;supports_def_opts&quot;:false,&quot;name&quot;:&quot;amazon_pay&quot;,&quot;wallet_params&quot;:{&quot;checkoutLanguage&quot;:&quot;en_US&quot;,&quot;ledgerCurrency&quot;:&quot;USD&quot;,&quot;placement&quot;:&quot;Cart&quot;,&quot;sandbox&quot;:false,&quot;merchantId&quot;:&quot;A1QL0J4Y75438T&quot;,&quot;productType&quot;:&quot;PayAndShip&quot;,&quot;design&quot;:&quot;C0002&quot;}},{&quot;supports_subs&quot;:true,&quot;supports_def_opts&quot;:false,&quot;name&quot;:&quot;paypal&quot;,&quot;wallet_params&quot;:{&quot;shopId&quot;:43450171553,&quot;countryCode&quot;:&quot;US&quot;,&quot;merchantName&quot;:&quot;FluffCo | Hotel Comfort&quot;,&quot;phoneRequired&quot;:true,&quot;companyRequired&quot;:false,&quot;shippingType&quot;:&quot;shipping&quot;,&quot;shopifyPaymentsEnabled&quot;:true,&quot;hasManagedSellingPlanState&quot;:false,&quot;requiresBillingAgreement&quot;:true,&quot;merchantId&quot;:&quot;UD5GVYK7FDVTA&quot;,&quot;sdkUrl&quot;:&quot;https://www.paypal.com/sdk/js?components=buttons\\u0026commit=false\\u0026currency=USD\\u0026locale=en_US\\u0026client-id=AbasDhzlU0HbpiStJiN1KRJ_cNJJ7xYBip7JJoMO0GQpLi8ePNgdbLXkC7_KMeyTg8tnAKW4WKrh9qmf\\u0026merchant-id=UD5GVYK7FDVTA\\u0026intent=tokenize\\u0026vault=true&quot;}}]\" access-token=\"2b1ba834a560a5e5949f5d67232ead77\" buyer-country=\"US\" buyer-locale=\"en\" buyer-currency=\"USD\" shop-id=\"43450171553\" cart-id=\"fbf93ca465920f4c2292a31762733650\" enabled-flags=\"[&quot;ce346acf&quot;]\" > <div class=\"wallet-button-wrapper\"> <ul class='wallet-cart-grid wallet-cart-grid--skeleton' role=\"list\" data-shopify-buttoncontainer=\"true\"> <li data-testid='grid-cell' class='wallet-cart-button-container'><div class='wallet-cart-button wallet-cart-button__skeleton' role='button' disabled aria-hidden='true'>&nbsp</div></li><li data-testid='grid-cell' class='wallet-cart-button-container'><div class='wallet-cart-button wallet-cart-button__skeleton' role='button' disabled aria-hidden='true'>&nbsp</div></li><li data-testid='grid-cell' class='wallet-cart-button-container'><div class='wallet-cart-button wallet-cart-button__skeleton' role='button' disabled aria-hidden='true'>&nbsp</div></li> </ul> </div> </shopify-accelerated-checkout-cart> <small id=\"shopify-buyer-consent\" class=\"hidden\" aria-hidden=\"true\" data-consent-type=\"subscription\"> One or more of the items in your cart is a deferred, subscription, or recurring purchase. By continuing, I agree to the <span id=\"shopify-subscription-policy-button\">cancellation policy</span> and authorize you to charge my payment method at the prices, frequency and dates listed on this page until my order is fulfilled or I cancel, if permitted. </small> </div>\n          </div>\n         \n         \n      </div>\n    </div>\n  </div>\n</div>\n\n<script src=\"//fluff.co/cdn/shop/t/155/assets/side_cart_edited.js?v=183376167594851759121767625267\" defer=\"defer\"></script>\n\n<!-- Swiper and Discount Bar Scripts -->\n<script>\n// Global swiper instance\nlet textSwiper = null;\n\nfunction initializeSwiper() {\n  const textSliderElement = document.querySelector('.swiper_cart');\n  console.log('Initializing swiper, element found:', !!textSliderElement, 'Swiper available:', typeof Swiper !== 'undefined');\n  \n  if (textSliderElement && typeof Swiper !== 'undefined') {\n    // Check if swiper already exists and is working\n    if (textSwiper && textSwiper.initialized) {\n      console.log('Swiper already initialized, skipping');\n      return;\n    }\n    \n    // Destroy existing swiper if it exists\n    if (textSwiper) {\n      textSwiper.destroy(true, true);\n      textSwiper = null;\n    }\n    \n    try {\n      textSwiper = new Swiper('.swiper_cart', {\n        slidesPerView: 1,\n        loop: true,\n        autoplay: {\n          delay: 4000,\n          disableOnInteraction: false,\n        },\n        effect: 'slide',\n        speed: 600,\n        breakpoints: {\n          1: {\n            slidesPerView: 1,\n            spaceBetween: 0\n          },\n          500: {\n            slidesPerView: 1,\n            spaceBetween: 0\n          },\n          1000: {\n            slidesPerView: 1,\n          },\n          2000: {\n            slidesPerView: 1,\n          }\n        },\n        spaceBetween: 0,\n      });\n      console.log('Swiper initialized successfully');\n    } catch (error) {\n      console.error('Error initializing swiper:', error);\n    }\n  } else {\n    console.log('Swiper initialization skipped - element or Swiper not found');\n  }\n}\n\nfunction loadSwiperAndInitialize() {\n  // Swiper is already loaded globally in the theme\n  if (typeof Swiper !== 'undefined') {\n    initializeSwiper();\n  } else {\n    // Wait for Swiper to be available\n    setTimeout(loadSwiperAndInitialize, 100);\n  }\n}\n\n// Initialize swiper immediately when this script runs (after cart content is loaded)\nsetTimeout(function() {\n  console.log('Auto-initializing swiper after script load');\n  const textSliderElement = document.querySelector('.swiper_cart');\n  if (textSliderElement) {\n    console.log('Found swiper element, initializing');\n    loadSwiperAndInitialize();\n  } else {\n    console.log('Swiper element not found, will retry');\n  }\n}, 50);\n\n// Initialize on DOM ready\ndocument.addEventListener('DOMContentLoaded', function() {\n  console.log('DOM ready, checking for swiper element');\n  const textSliderElement = document.querySelector('.swiper_cart');\n  if (textSliderElement) {\n    console.log('Found swiper element on DOM ready');\n    loadSwiperAndInitialize();\n  }\n});\n\n// DO NOT re-initialize swiper on cart:updated to prevent flicker\n// Swiper will be re-initialized automatically when side cart content is fully replaced via updateSideCart()\nconsole.log('Swiper initialization setup complete - will NOT re-init on cart updates to prevent flicker');\n\n  // Discount Code Functionality\n  const discountBar = document.querySelector('[data-discount-bar]');\n  if (discountBar) {\n    const input = discountBar.querySelector('.discount-code-input');\n    const button = discountBar.querySelector('[data-apply-discount]');\n    const message = discountBar.querySelector('[data-discount-message]');\n\n    button.addEventListener('click', applyDiscountCode);\n    input.addEventListener('keypress', function(e) {\n      if (e.key === 'Enter') {\n        applyDiscountCode();\n      }\n    });\n\n    async function applyDiscountCode() {\n      const code = input.value.trim();\n      \n      if (!code) {\n        showMessage('Please enter a discount code', 'error');\n        return;\n      }\n\n      button.disabled = true;\n      showMessage('Applying discount...', 'loading');\n\n      try {\n        // Apply discount code using Shopify's discount redirect\n        const formData = new FormData();\n        formData.append('discount', code);\n        \n        const response = await fetch('/discount/' + encodeURIComponent(code) + '?redirect=/cart', {\n          method: 'GET',\n        });\n\n        if (response.ok || response.redirected) {\n          showMessage('Discount applied successfully!', 'success');\n          \n          // Refresh the cart to show updated prices\n          setTimeout(() => {\n            if (window.SideCart && window.SideCart.refreshCart) {\n              window.SideCart.refreshCart();\n            } else {\n              // Reload the cart section via AJAX\n              fetch('/cart?section_id=side_cart')\n                .then(res => res.text())\n                .then(html => {\n                  const parser = new DOMParser();\n                  const newDoc = parser.parseFromString(html, 'text/html');\n                  const newContent = newDoc.querySelector('[data-dynamic-content=\"sidecart\"]');\n                  const newFoot = newDoc.querySelector('[data-dynamic-content=\"sidecart-foot\"]');\n                  \n                  if (newContent) {\n                    document.querySelector('[data-dynamic-content=\"sidecart\"]').innerHTML = newContent.innerHTML;\n                  }\n                  if (newFoot) {\n                    document.querySelector('[data-dynamic-content=\"sidecart-foot\"]').innerHTML = newFoot.innerHTML;\n                  }\n                });\n            }\n          }, 500);\n          \n          input.value = '';\n        } else {\n          showMessage('Invalid discount code', 'error');\n        }\n      } catch (error) {\n        showMessage('Error applying discount. Please try again.', 'error');\n        console.error('Discount error:', error);\n      } finally {\n        button.disabled = false;\n      }\n    }\n\n    function showMessage(text, type) {\n      message.textContent = text;\n      message.className = 'discount-message ' + type;\n      \n      if (type !== 'loading') {\n        setTimeout(() => {\n          message.textContent = '';\n          message.className = 'discount-message';\n        }, 5000);\n      }\n    }\n  }\n});\n</script>\n\n\n\n\n</div>"}