{
  "version": 3,
  "sources": ["/cdn/shop/t/53/assets/auction-card-info.js?bco_cache_bust=15"],
  "sourcesContent": ["/**\n * Auction Utilities \u2014 Sorting & Filters\n * Provides \"Ending Soonest\" sort and \"My Bids\" filter for\n * the Webkul Shopify Product Auction plugin.\n *\n * Webkul handles all auction data, bidding, timers, and\n * real-time updates natively. This script only adds the\n * sorting and filtering features that Webkul doesn't provide.\n */\n// console.log('[Auction] Loading Sorting & Filter Utilities');\n\n// \u2500\u2500 v90: Lightweight PDP Enhancements (no DOM restructuring) \u2500\u2500\n// Applies glassmorphism style overrides and stepper +/- buttons to Webkul's\n// native widget WITHOUT moving, hiding, or wrapping any elements.\n(function pdpLightEnhance() {\n  if (!window.location.pathname.includes('/products/')) return;\n\n  var _enhanced = false;\n\n  function applyGlassmorphism() {\n    // Override Webkul's inline styles on the info card\n    var infoPanels = document.querySelectorAll('#wk-auction .pa-bdr, #wk-auction .pa-form-bg, #wk-auction div[class*=\"pa-bdr\"]');\n    infoPanels.forEach(function(panel) {\n      if (panel._bcoGlass) return;\n      panel._bcoGlass = true;\n      panel.style.setProperty('background', 'rgba(255, 255, 255, 0.03)', 'important');\n      panel.style.setProperty('backdrop-filter', 'blur(12px)', 'important');\n      panel.style.setProperty('-webkit-backdrop-filter', 'blur(12px)', 'important');\n      panel.style.setProperty('border', '1px solid rgba(255, 255, 255, 0.07)', 'important');\n      panel.style.setProperty('border-radius', '16px', 'important');\n      panel.style.setProperty('padding', '20px', 'important');\n      panel.style.setProperty('margin-top', '12px', 'important');\n      panel.style.setProperty('box-shadow', 'inset 0 1px 0 rgba(255,255,255,0.04), 0 4px 20px rgba(0,0,0,0.2)', 'important');\n      panel.style.setProperty('color', '#ffffff', 'important');\n    });\n\n    // Override all text colors inside #wk-auction to white/light\n    var wkAuction = document.getElementById('wk-auction');\n    if (!wkAuction) return;\n    // Override Webkul's dark text\n    var allText = wkAuction.querySelectorAll('span, strong, td, div, p, label, h4, h5, h6');\n    allText.forEach(function(el) {\n      var computed = window.getComputedStyle(el);\n      var color = computed.color;\n      // If text is dark (black/grey), make it white\n      if (color && (color.indexOf('rgb(0') === 0 || color.indexOf('rgb(51') === 0 || color.indexOf('rgb(34') === 0 || color.indexOf('rgb(85') === 0 || color.indexOf('rgb(33') === 0 || color.indexOf('rgb(102') === 0)) {\n        el.style.setProperty('color', 'rgba(255, 255, 255, 0.85)', 'important');\n      }\n    });\n\n    // Style the timer area\n    var tables = wkAuction.querySelectorAll('table');\n    tables.forEach(function(table) {\n      if (table._bcoGlass) return;\n      table._bcoGlass = true;\n      table.style.setProperty('background', 'rgba(39, 168, 224, 0.08)', 'important');\n      table.style.setProperty('border', '1px solid rgba(39, 168, 224, 0.2)', 'important');\n      table.style.setProperty('border-radius', '100px', 'important');\n      table.style.setProperty('padding', '8px 20px', 'important');\n      table.style.setProperty('margin', '8px auto', 'important');\n      table.style.setProperty('box-shadow', '0 0 20px rgba(39,168,224,0.12), inset 0 1px 0 rgba(255,255,255,0.05)', 'important');\n      table.style.setProperty('border-collapse', 'separate', 'important');\n    });\n\n    // Timer digit values - glowing cyan\n    var timerDigits = wkAuction.querySelectorAll('table td span.font-16, table td .pa-text-color');\n    timerDigits.forEach(function(d) {\n      d.style.setProperty('color', '#27a8e0', 'important');\n      d.style.setProperty('font-weight', '800', 'important');\n      d.style.setProperty('text-shadow', '0 0 18px rgba(39,168,224,0.5)', 'important');\n    });\n\n    // Style Place Bid button\n    var bidBtns = wkAuction.querySelectorAll('.wk_submit_bid, #pa_place_bid, #pa_place_bid_link, button[type=\"submit\"]');\n    bidBtns.forEach(function(btn) {\n      if (btn._bcoGlass) return;\n      btn._bcoGlass = true;\n      btn.style.setProperty('background', 'linear-gradient(180deg, rgba(28,28,35,0.9) 0%, rgba(5,5,8,0.98) 100%)', 'important');\n      btn.style.setProperty('backdrop-filter', 'blur(15px)', 'important');\n      btn.style.setProperty('border', '1px solid rgba(255,255,255,0.12)', 'important');\n      btn.style.setProperty('border-left', '4px solid #00f2ff', 'important');\n      btn.style.setProperty('border-right', '4px solid #27a8e0', 'important');\n      btn.style.setProperty('border-radius', '14px', 'important');\n      btn.style.setProperty('color', '#ffffff', 'important');\n      btn.style.setProperty('font-weight', '800', 'important');\n      btn.style.setProperty('text-transform', 'uppercase', 'important');\n      btn.style.setProperty('letter-spacing', '0.15em', 'important');\n      btn.style.setProperty('height', '56px', 'important');\n      btn.style.setProperty('width', '100%', 'important');\n      btn.style.setProperty('cursor', 'pointer', 'important');\n      btn.style.setProperty('font-size', '15px', 'important');\n      btn.style.setProperty('margin-top', '16px', 'important');\n      btn.style.setProperty('box-shadow', '0 8px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08)', 'important');\n    });\n\n    // Style bid input\n    var bidInputs = wkAuction.querySelectorAll('#bid_amount, #wk_bid_amount, input[name=\"bid_amount\"]');\n    bidInputs.forEach(function(inp) {\n      inp.style.setProperty('background', 'transparent', 'important');\n      inp.style.setProperty('border', '1px solid rgba(255,255,255,0.1)', 'important');\n      inp.style.setProperty('border-radius', '14px', 'important');\n      inp.style.setProperty('color', '#ffffff', 'important');\n      inp.style.setProperty('font-size', '22px', 'important');\n      inp.style.setProperty('font-weight', '700', 'important');\n      inp.style.setProperty('text-align', 'center', 'important');\n      inp.style.setProperty('padding', '12px', 'important');\n      inp.style.setProperty('height', '52px', 'important');\n    });\n  }\n\n  function addStepperButtons() {\n    var bidInput = document.querySelector('#wk-auction #bid_amount, #wk-auction #wk_bid_amount');\n    if (!bidInput || bidInput._bcoStepper) return;\n    bidInput._bcoStepper = true;\n\n    // Find the native input's container row\n    var inputRow = bidInput.parentNode;\n    if (!inputRow) return;\n\n    // Create standalone stepper row ABOVE the native input (don't touch native DOM)\n    var stepper = document.createElement('div');\n    stepper.className = 'bco-pdp-stepper-v90';\n    stepper.style.cssText = 'display:flex;align-items:center;justify-content:center;width:100%;height:60px;margin-bottom:12px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.1);border-radius:30px;overflow:hidden;';\n\n    var btnStyle = 'display:flex;align-items:center;justify-content:center;width:60px;height:60px;flex-shrink:0;font-size:28px;font-weight:700;background:transparent;border:none;color:white;cursor:pointer;transition:background 0.2s;';\n\n    // Minus button\n    var minus = document.createElement('button');\n    minus.type = 'button';\n    minus.textContent = '\u2212';\n    minus.style.cssText = btnStyle;\n    minus.addEventListener('mouseover', function() { minus.style.background = 'rgba(255,255,255,0.08)'; });\n    minus.addEventListener('mouseout', function() { minus.style.background = 'transparent'; });\n    minus.addEventListener('click', function() {\n      var val = parseInt(bidInput.value) || 0;\n      var min = parseInt(bidInput.getAttribute('min')) || 1;\n      if (val > min) {\n        bidInput.value = val - 1;\n        display.textContent = '$ ' + bidInput.value;\n        bidInput.dispatchEvent(new Event('change', { bubbles: true }));\n      }\n    });\n\n    // Display\n    var display = document.createElement('div');\n    display.style.cssText = 'flex:1;text-align:center;font-size:24px;font-weight:700;color:white;letter-spacing:1px;';\n    display.textContent = '$ ' + (bidInput.value || '0');\n\n    // Plus button\n    var plus = document.createElement('button');\n    plus.type = 'button';\n    plus.textContent = '+';\n    plus.style.cssText = btnStyle;\n    plus.addEventListener('mouseover', function() { plus.style.background = 'rgba(255,255,255,0.08)'; });\n    plus.addEventListener('mouseout', function() { plus.style.background = 'transparent'; });\n    plus.addEventListener('click', function() {\n      var val = parseInt(bidInput.value) || 0;\n      bidInput.value = val + 1;\n      display.textContent = '$ ' + bidInput.value;\n      bidInput.dispatchEvent(new Event('change', { bubbles: true }));\n    });\n\n    stepper.appendChild(minus);\n    stepper.appendChild(display);\n    stepper.appendChild(plus);\n\n    // Insert stepper ABOVE the native input row (don't move anything)\n    inputRow.parentNode.insertBefore(stepper, inputRow);\n\n    // Hide native input visually (keep in DOM for Webkul)\n    bidInput.style.setProperty('height', '0', 'important');\n    bidInput.style.setProperty('padding', '0', 'important');\n    bidInput.style.setProperty('margin', '0', 'important');\n    bidInput.style.setProperty('border', 'none', 'important');\n    bidInput.style.setProperty('overflow', 'hidden', 'important');\n    bidInput.style.setProperty('opacity', '0', 'important');\n    bidInput.style.setProperty('position', 'absolute', 'important');\n\n    // Sync display when input changes externally\n    var syncDisplay = setInterval(function() {\n      if (bidInput && display) {\n        var v = bidInput.value || '0';\n        if (display.textContent !== '$ ' + v) display.textContent = '$ ' + v;\n      }\n    }, 1000);\n  }\n\n  function ensurePlaceBidVisible() {\n    var wk = document.getElementById('wk-auction');\n    if (!wk) return;\n\n    // Try broad selectors to find ANY Place Bid button\n    var btn = wk.querySelector('.wk_submit_bid') ||\n              wk.querySelector('#pa_place_bid') ||\n              wk.querySelector('#pa_place_bid_link') ||\n              wk.querySelector('button[type=\"submit\"]') ||\n              wk.querySelector('input[type=\"submit\"]') ||\n              wk.querySelector('a.wk_submit_bid') ||\n              wk.querySelector('button[name=\"submit\"]') ||\n              wk.querySelector('.btn-place-bid') ||\n              wk.querySelector('[onclick*=\"place_bid\"], [onclick*=\"placeBid\"], [onclick*=\"submit_bid\"]');\n\n    // Also search by text content if not found\n    if (!btn) {\n      var allBtns = wk.querySelectorAll('button, input[type=\"submit\"], a.btn, .btn');\n      for (var i = 0; i < allBtns.length; i++) {\n        var txt = (allBtns[i].textContent || allBtns[i].value || '').toLowerCase();\n        if (txt.indexOf('place') !== -1 && txt.indexOf('bid') !== -1) {\n          btn = allBtns[i];\n          break;\n        }\n      }\n    }\n\n    if (btn) {\n      // Force visible\n      btn.style.setProperty('display', 'flex', 'important');\n      btn.style.setProperty('visibility', 'visible', 'important');\n      btn.style.setProperty('opacity', '1', 'important');\n      btn.style.setProperty('height', '56px', 'important');\n      btn.style.setProperty('position', 'relative', 'important');\n      btn.style.setProperty('width', '100%', 'important');\n      return;\n    }\n\n    // If no button found, create a fallback\n    if (wk.querySelector('.bco-place-bid-v90')) return; // Already created\n\n    var bidInput = wk.querySelector('#bid_amount, #wk_bid_amount');\n    var form = wk.querySelector('form');\n\n    var newBtn = document.createElement('button');\n    newBtn.type = 'button';\n    newBtn.className = 'bco-place-bid-v90';\n    newBtn.textContent = 'PLACE BID';\n    newBtn.style.cssText = 'display:flex;align-items:center;justify-content:center;width:100%;height:56px;margin-top:16px;background:linear-gradient(180deg,rgba(28,28,35,0.9) 0%,rgba(5,5,8,0.98) 100%);backdrop-filter:blur(15px);border:1px solid rgba(255,255,255,0.12);border-left:4px solid #00f2ff;border-right:4px solid #27a8e0;border-radius:14px;color:#ffffff;font-weight:800;text-transform:uppercase;letter-spacing:0.15em;font-size:15px;cursor:pointer;box-shadow:0 8px 25px rgba(0,0,0,0.4),inset 0 1px 0 rgba(255,255,255,0.08);transition:all 0.35s cubic-bezier(0.175,0.885,0.32,1.275);';\n\n    newBtn.addEventListener('mouseover', function() {\n      newBtn.style.transform = 'translateY(-3px) scale(1.02)';\n      newBtn.style.boxShadow = '0 12px 35px rgba(0,0,0,0.5), -4px 0 20px rgba(237,41,123,0.25), 4px 0 20px rgba(39,168,224,0.25)';\n    });\n    newBtn.addEventListener('mouseout', function() {\n      newBtn.style.transform = '';\n      newBtn.style.boxShadow = '0 8px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08)';\n    });\n\n    newBtn.addEventListener('click', function() {\n      if (form) {\n        // Submit Webkul's native form\n        form.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));\n        // Also try clicking any hidden submit buttons\n        var hiddenSubmit = form.querySelector('button[type=\"submit\"], input[type=\"submit\"], .wk_submit_bid');\n        if (hiddenSubmit) hiddenSubmit.click();\n      }\n    });\n\n    // Insert after the stepper or after the input row\n    var stepper = wk.querySelector('.bco-pdp-stepper-v90');\n    var insertAfter = stepper || (bidInput && bidInput.parentNode);\n    if (insertAfter && insertAfter.parentNode) {\n      insertAfter.parentNode.insertBefore(newBtn, insertAfter.nextSibling);\n    } else {\n      wk.appendChild(newBtn);\n    }\n    console.log('[BCO v90] Fallback Place Bid button created');\n  }\n\n  // Run periodically to catch Webkul re-renders\n  function enhance() {\n    applyGlassmorphism();\n    addStepperButtons();\n    ensurePlaceBidVisible();\n    if (!_enhanced) {\n      _enhanced = true;\n      console.log('[BCO v90] PDP light enhancements applied (glassmorphism + stepper)');\n    }\n  }\n\n  // Retry until widget loads, then keep checking for re-renders\n  var _attempts = 0;\n  var _poll = setInterval(function() {\n    _attempts++;\n    var wk = document.getElementById('wk-auction');\n    if (wk && wk.children.length > 0) {\n      enhance();\n      // After initial enhance, check every 3s for re-renders (after bid)\n      clearInterval(_poll);\n      setInterval(function() {\n        applyGlassmorphism();\n        ensurePlaceBidVisible();\n        // Re-add stepper if Webkul re-rendered the input\n        var inp = document.querySelector('#wk-auction #bid_amount, #wk-auction #wk_bid_amount');\n        if (inp && !inp._bcoStepper) addStepperButtons();\n      }, 3000);\n    }\n    if (_attempts > 60) clearInterval(_poll); // Give up after 30s\n  }, 500);\n})();\n\n\n(function () {\n  'use strict';\n\n  // --- BCO Preventative UX Lock ---\n  // Reserves a minimum height to guarantee the page never collapses\n  // during Webkul's native asynchronous grid resets.\n  var bcoStyle = document.createElement('style');\n  bcoStyle.innerHTML = `\n    #products_on_auction, .wk_products_row {\n      min-height: 100vh !important;\n    }\n  `;\n  document.head.appendChild(bcoStyle);\n\n  // v84: Debug flag \u2014 set to true to enable verbose console logging.\n  // In production, leave false to reduce console noise and minor CPU overhead.\n  var _BCO_DEBUG = false;\n  // v10 PERF: Detect mobile once for use throughout the script\n  var _isMobile = (window.innerWidth <= 768);\n  function _log() { if (_BCO_DEBUG && console.log) console.log.apply(console, arguments); }\n  function _warn() { if (console.warn) console.warn.apply(console, arguments); }\n  function _err() { if (console.error) console.error.apply(console, arguments); }\n  if (_BCO_DEBUG) console.log('[BCO] GLOBAL SIGNAL: auction-card-info.js is executing');\n  window.bcoExecutionSignal = true;\n\n  // v95: Card image sizing (iPhone memory fix).\n  // Webkul's auction grid loads each product photo at full size (1200x800).\n  // With 48 cards that's ~180MB of decoded images, which makes iOS Safari\n  // unload the tab in the background and reload it when the user returns.\n  // Shopify's CDN resizes on the fly via a `width` param, so we request a\n  // width matched to the card's on-screen size (capped at 2x pixel density).\n  var BCO_IMG_WIDTHS = [300, 450, 600, 900];\n  function bcoTargetImgWidth(img) {\n    var host = (img && img.closest && img.closest('.wkgrid')) || img;\n    var cssW = (host && host.getBoundingClientRect().width) || window.innerWidth || 600;\n    var need = cssW * Math.min(window.devicePixelRatio || 1, 2);\n    for (var i = 0; i < BCO_IMG_WIDTHS.length; i++) {\n      if (BCO_IMG_WIDTHS[i] >= need) return BCO_IMG_WIDTHS[i];\n    }\n    return 0; // 0 = card is wider than 900px worth of pixels: keep the original\n  }\n  function bcoSizedImageUrl(url, width) {\n    if (!url || typeof url !== 'string' || !width) return url;\n    if (url.indexOf('cdn.shopify.com') === -1 && url.indexOf('/cdn/shop/') === -1) return url;\n    if (/[?&]width=\\d+/.test(url)) return url;\n    return url + (url.indexOf('?') === -1 ? '?' : '&') + 'width=' + width;\n  }\n  function bcoShrinkGridImage(img) {\n    if (!img || img.getAttribute('data-bco-sized')) return;\n    img.setAttribute('data-bco-sized', '1');\n    var src = img.getAttribute('src');\n    var sized = bcoSizedImageUrl(src, bcoTargetImgWidth(img));\n    if (sized && sized !== src) img.setAttribute('src', sized);\n  }\n\n  // v11: Inject My Bids loading CSS \u2014 collapses grid and shows spinner during fetch\n  (function injectMyBidsLoadingCSS() {\n    var style = document.createElement('style');\n    style.textContent = [\n      'html.bco-filtering-my-bids-loading #products_on_auction .wkgrid,',\n      'html.bco-filtering-my-bids-loading #products_on_auction .wk_products_row,',\n      'html.bco-filtering-my-bids-loading #products_on_auction ul {',\n      '  min-height: 200px !important;',\n      '  max-height: 250px !important;',\n      '  overflow: hidden !important;',\n      '  opacity: 0.3 !important;',\n      '  transition: opacity 0.3s ease !important;',\n      '}',\n      '.bco-my-bids-spinner {',\n      '  display: flex; flex-direction: column; align-items: center; gap: 16px;',\n      '  padding: 30px 20px;',\n      '}',\n      '.bco-skeleton-text {',\n      '  display: flex; align-items: center; gap: 12px;',\n      '  font-size: 15px; color: rgba(255,255,255,0.7);',\n      '  font-family: inherit; letter-spacing: 0.04em;',\n      '}',\n      '.bco-skeleton-text::before {',\n      '  content: \"\"; display: inline-block; width: 22px; height: 22px;',\n      '  border: 2.5px solid rgba(79,209,197,0.3); border-top-color: #4fd1c5;',\n      '  border-radius: 50%; animation: bco-spin 0.8s linear infinite;',\n      '}',\n      '.bco-skeleton-grid {',\n      '  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;',\n      '  width: 100%; max-width: 900px;',\n      '}',\n      '@media (max-width: 768px) { .bco-skeleton-grid { grid-template-columns: 1fr 1fr; } }',\n      '@media (max-width: 480px) { .bco-skeleton-grid { grid-template-columns: 1fr; } }',\n      '.bco-skeleton-card {',\n      '  background: rgba(255,255,255,0.05); border-radius: 12px; padding: 12px;',\n      '  overflow: hidden;',\n      '}',\n      '.bco-skeleton-img {',\n      '  width: 100%; aspect-ratio: 1; border-radius: 8px; margin-bottom: 12px;',\n      '  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);',\n      '  background-size: 200% 100%; animation: bco-shimmer 1.5s ease-in-out infinite;',\n      '}',\n      '.bco-skeleton-line {',\n      '  height: 14px; border-radius: 6px; margin-bottom: 8px;',\n      '  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);',\n      '  background-size: 200% 100%; animation: bco-shimmer 1.5s ease-in-out infinite;',\n      '}',\n      '.bco-skeleton-line.w80 { width: 80%; }',\n      '.bco-skeleton-line.w60 { width: 60%; }',\n      '.bco-skeleton-line.w40 { width: 40%; }',\n      '@keyframes bco-spin { to { transform: rotate(360deg); } }',\n      '@keyframes bco-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }'\n    ].join('\\n');\n    document.head.appendChild(style);\n  })();\n\n  // \u2500\u2500 Announcement Bar Height Sync \u2500\u2500\n  // Measures the announcement bar and sets a CSS variable so the fixed\n  // timer topbar and body padding can offset below it dynamically.\n  // Also forcefully repositions the Webkul timer below the announcement bar\n  // because Webkul's own JS resets top:0 on .hc_cd.at_top.\n  (function syncAnnouncementBarHeight() {\n    function measure() {\n      var bar = document.querySelector('.announcement-bar');\n      var h = bar ? bar.offsetHeight : 0;\n      document.documentElement.style.setProperty('--announcement-bar-height', h + 'px');\n\n      // Forcefully push the Webkul timer below the announcement bar\n      var timer = document.querySelector('.hc_cd.at_top');\n      if (timer) {\n        timer.style.setProperty('top', h + 'px', 'important');\n      }\n    }\n    measure();\n    // Re-measure on load (fonts/images may shift height)\n    window.addEventListener('load', measure);\n    // Re-measure on resize (text may wrap differently)\n    window.addEventListener('resize', measure);\n    // Use ResizeObserver if available for dynamic changes\n    if (typeof ResizeObserver !== 'undefined') {\n      var barEl = document.querySelector('.announcement-bar');\n      if (barEl) {\n        new ResizeObserver(measure).observe(barEl);\n      }\n    }\n    // MutationObserver on the timer: Webkul's JS resets top:0 periodically.\n    // We fight back by re-applying our offset whenever the style changes.\n    function watchTimer() {\n      var timer = document.querySelector('.hc_cd.at_top');\n      if (!timer || timer.hasAttribute('data-bco-top-observer')) return;\n      timer.setAttribute('data-bco-top-observer', 'true');\n      var _settingTop = false; // Reentrancy guard\n      var obs = new MutationObserver(function() {\n        if (_settingTop) return;\n        var bar = document.querySelector('.announcement-bar');\n        var h = bar ? bar.offsetHeight : 0;\n        if (parseInt(timer.style.top) !== h) {\n          _settingTop = true;\n          timer.style.setProperty('top', h + 'px', 'important');\n          _settingTop = false;\n        }\n      });\n      obs.observe(timer, { attributes: true, attributeFilter: ['style'] });\n    }\n    watchTimer();\n    // Re-measure and watch periodically for the first 10 seconds\n    // (Webkul's timer may load late and reset positions)\n    var checks = 0;\n    // v10 PERF: Reduce announcement bar re-measure frequency on mobile\n    var _barInterval = _isMobile ? 1000 : 500;\n    var _barMaxChecks = _isMobile ? 10 : 20;\n    var interval = setInterval(function() {\n      measure();\n      watchTimer();\n      if (++checks >= _barMaxChecks) clearInterval(interval);\n    }, _barInterval);\n  })();\n\n  // \u2500\u2500 Per-card user-editing guard \u2500\u2500\n  // Prevents auto-refresh / bid sync from overwriting the bid input\n  // while the user is actively typing or using +/- stepper buttons.\n  var _userEditing = new WeakMap();\n  var _postBidCooldown = {}; // key = productId, value = timestamp of last bid\n  var _fetchingAllBids = false;\n\n  function safeBidWrite(productId, callback, currentVal, newVal) {\n    const now = Date.now();\n    const isCooldown = productId && _postBidCooldown[productId] && (now - _postBidCooldown[productId] < 20000);\n\n    // Global Monotonic Guard: never allow a bid to decrease after initial load\n    if (currentVal !== undefined && newVal !== undefined) {\n      var cv = parseFloat(currentVal) || 0;\n      var nv = parseFloat(newVal) || 0;\n      if (nv < cv) {\n        console.log('[BCO LiveSync] Monotonic block (decrease) for ' + productId + ': ' + nv + ' < ' + cv);\n        return;\n      }\n    }\n\n    if (isCooldown) {\n      // During cooldown, only monotonic updates (nv >= cv) are already handled above.\n      // If we got here and isCooldown is true, it means nv >= cv or values were missing.\n      // But we block even higher updates if they are from stale sources during cooldown?\n      // No, user requested: \"Always allow server-authoritative higher bids to update immediately.\"\n      // So if nv >= cv, we allow even during cooldown.\n      callback();\n    } else {\n      callback();\n    }\n  }\n\n  function safeWriteCurrentBid(cardEl, serverBid, minBid) {\n    const currentBidEl = cardEl.querySelector('.auction-card-info__current-bid');\n    if (!currentBidEl) return;\n\n    var sVal = parseFloat(serverBid) || 0;\n    var mVal = parseFloat(minBid) || 0;\n    // Display the actual current bid, NOT max(current, nextMin).\n    // Only fall back to minBid when there are no bids yet (sVal=0).\n    var finalBid = sVal > 0 ? sVal : mVal;\n\n    const newText = 'USD ' + Math.floor(finalBid);\n    if (currentBidEl.textContent !== newText) {\n      currentBidEl.textContent = newText;\n      console.log('[BCO BidFlow] safeWriteCurrentBid applied: ' + newText + ' for ' + cardEl.getAttribute('data-product-id'));\n    }\n    cardEl.setAttribute('data-current-bid', String(finalBid));\n  }\n\n  function safeInitialBid(cardEl, serverBid, minBid, step, bidCount) {\n    const currentBidEl = cardEl.querySelector('.auction-card-info__current-bid');\n    const bidInputEl = cardEl.querySelector('.auction-card-info__input');\n\n    if (!currentBidEl || !bidInputEl) return;\n\n    var sVal = parseFloat(serverBid) || 0;\n    var mVal = parseFloat(minBid) || 0;\n    var stVal = parseFloat(step) || 2; // Default fallback step\n    var bCount = parseInt(bidCount) || 0;\n\n    // Display the actual current bid, NOT the next minimum.\n    // Only fall back to minBid when there are no bids (sVal=0).\n    const currentDisplayVal = sVal > 0 ? sVal : mVal;\n    const newText = 'USD ' + Math.floor(currentDisplayVal);\n    if (currentBidEl.textContent !== newText) {\n      currentBidEl.textContent = newText;\n    }\n    // FIX: Store the actual server bid, not the display bid, so monotonic checks work\n    cardEl.setAttribute('data-current-bid', String(sVal));\n\n    // v86 FIX: For 0-bid auctions, the next minimum bid IS the starting price\n    // (mVal), NOT starting price + step. Webkul returns current_bid=startPrice\n    // and min_bid=startPrice for 0-bid products, so step=0 and the || 2 fallback\n    // was producing wrong values. Using bidCount=0 to detect first-bid scenario\n    // matches PDP behavior exactly.\n    const nextBid = bCount > 0 ? (currentDisplayVal + stVal) : mVal;\n\n    var proxyMaxRaw = bidInputEl.dataset.userProxyMax;\n    var proxyMax = proxyMaxRaw ? parseFloat(proxyMaxRaw) : null;\n    var statusEl = cardEl.querySelector('.auction-card-info__status');\n    var isWinning = statusEl && statusEl.classList.contains('is-winning');\n    var shouldPreserveProxy = isWinning && proxyMax !== null && proxyMax >= Math.ceil(nextBid);\n\n    if (!isUserEditing(bidInputEl)) {\n      if (shouldPreserveProxy) {\n        bidInputEl.value = proxyMax.toFixed(0);\n      } else {\n        bidInputEl.value = Math.ceil(nextBid).toString();\n        if (proxyMaxRaw) delete bidInputEl.dataset.userProxyMax; // clear stale proxy\n      }\n      bidInputEl.min = Math.ceil(nextBid).toString();\n    } else {\n      bidInputEl.min = Math.ceil(nextBid).toString();\n    }\n    cardEl.setAttribute('data-min-bid', String(nextBid));\n\n    console.log('[BCO BidFlow] safeInitialBid applied', currentBidEl.textContent, bidInputEl.value);\n  }\n\n  function replaceStepperSpanWithInput(card) {\n    const span = card.querySelector('.auction-card-info__stepper-value');\n    if (!span) return;\n    const currentVal = parseInt(span.textContent, 10) || 0;\n\n    const input = document.createElement('input');\n    input.type = 'number';\n    input.className = 'auction-card-info__input';\n    input.value = currentVal;\n    input.min = parseInt(card.dataset.minBid, 10) || 1;\n    input.step = 1;\n    input.setAttribute('inputmode', 'decimal');\n\n    // Attach WeakMap editing guard\n    if (!input.hasAttribute('data-bco-editing-guard')) {\n      input.setAttribute('data-bco-editing-guard', 'true');\n      input.addEventListener('focus', function () { markEditing(input); });\n      input.addEventListener('input', function () { markEditing(input); });\n      input.addEventListener('blur', function () {\n        setTimeout(function () {\n          if (input !== document.activeElement) clearEditing(input);\n        }, 500);\n      });\n    }\n\n    span.parentNode.replaceChild(input, span);\n\n    // Refresh DOM cache for this card\n    _domCache.delete(card);\n  }\n\n  function markEditing(inputEl) {\n    var state = _userEditing.get(inputEl) || {};\n    if (state.timer) clearTimeout(state.timer);\n    state.editing = true;\n    state.timer = setTimeout(function () {\n      state.editing = false;\n      _userEditing.set(inputEl, state);\n    }, 30000); // resume sync after 30s idle (gives users more time between stepper clicks)\n    _userEditing.set(inputEl, state);\n  }\n\n  function clearEditing(inputEl) {\n    var state = _userEditing.get(inputEl);\n    if (state) {\n      if (state.timer) clearTimeout(state.timer);\n      state.editing = false;\n      _userEditing.set(inputEl, state);\n    }\n  }\n\n  function isUserEditing(inputEl) {\n    if (!inputEl) return false;\n    var state = _userEditing.get(inputEl);\n    return !!(state && state.editing);\n  }\n\n  // \u2500\u2500\u2500 ROUND 22: LAYOUT RESTORE (Missing ID & Grid Fix) \u2500\u2500\u2500\n  function restoreAuctionLayout() {\n    // 1. Detect the broken grid container (wkcontainer or wk_products_row)\n    var container = document.querySelector('.wkcontainer, .wk_products_row');\n    // Only apply the ID once we know Webkul has actually injected its widgets inside of it\n    if (container && document.querySelector('.wk-category-auction') && !document.getElementById('products_on_auction')) {\n      // Ensure the container has the required ID for the CSS rules to fire\n      container.id = 'products_on_auction';\n      container.classList.add('auction-card-info-parent', 'auction-layout-restored');\n    }\n\n    // 2. Ensure each product card has the scoping class\n    var cards = document.querySelectorAll('.wkgrid, .product-card:not(.product-card--is-auction)');\n    cards.forEach(function (card) {\n      if (card.querySelector('.auction-card-info')) {\n        card.classList.add('product-card--is-auction');\n      }\n    });\n  }\n  // Run immediately and after a short delay for dynamic loading\n  restoreAuctionLayout();\n  setTimeout(restoreAuctionLayout, 1500);\n\n  // \u2500\u2500\u2500 ROUND 21: HOMEPAGE SLIDER TIMER SYNC + ROBUST INITIALIZATION \u2500\u2500\u2500\n  // (Legacy aquaVaultSync loop excised in V78. Now fully handled by isolated syncTimers block)\n\n  // \u2500\u2500\u2500 DOM Selector Cache \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  // Cache resolved DOM elements per card to avoid querySelector in loops.\n  // Populated once during setupBidWidgets, reused in poll/socket/refresh paths.\n  var _domCache = new WeakMap();\n  function getCardDom(card) {\n    var cached = _domCache.get(card);\n    if (cached) return cached;\n    cached = {\n      bidEl: card.querySelector('.auction-card-info__current-bid'),\n      countEl: card.querySelector('.auction-card-info__bid-count'),\n      statusEl: card.querySelector('.auction-card-info__status'),\n      inputEl: card.querySelector('.auction-card-info__input'),\n      timeEl: card.querySelector('.auction-card-info__time-left')\n    };\n    _domCache.set(card, cached);\n    return cached;\n  }\n\n  // \u2500\u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n  /**\n   * Read the remaining time from a Webkul .pa-timer element\n   * inside a product grid item. Returns a number of seconds\n   * remaining, or Infinity if no timer is found.\n   */\n  function getTimerSeconds(gridItem) {\n    const timer = gridItem.querySelector('.pa-timer');\n    if (!timer) return Infinity;\n\n    const digits = timer.querySelectorAll('.pa-theme-color');\n    if (digits.length < 4) return Infinity;\n\n    const d = parseInt(digits[0]?.textContent) || 0;\n    const h = parseInt(digits[1]?.textContent) || 0;\n    const m = parseInt(digits[2]?.textContent) || 0;\n    const s = parseInt(digits[3]?.textContent) || 0;\n\n    const total = d * 86400 + h * 3600 + m * 60 + s;\n    return total <= 0 ? Infinity : total;\n  }\n\n  /**\n   * Check if the current visitor is logged in (Shopify meta tags).\n   */\n  function isCustomerLoggedIn() {\n    try {\n      // v105 SECURITY: ONLY trust Shopify's meta tag. Webkul's cust-id attribute\n      // and localStorage can persist after logout, allowing guests to bypass.\n      const meta = document.querySelector('meta[name=\"logged-in-customer-id\"]');\n      if (meta && meta.content && meta.content.trim() !== '' && meta.content.trim() !== '0') return true;\n      return false;\n    } catch (e) { return false; }\n  }\n\n  /**\n   * Shared validator: returns true if the string looks like a bid amount\n   * rather than a real username. Used everywhere we extract or display a\n   * bidder name to prevent values like \"USD 3 (You)\" from leaking through.\n   */\n  function isLikelyBidAmount(str) {\n    if (!str) return true; // empty/null is not a valid name\n    var s = str.trim();\n    if (!s) return true;\n    return /^USD\\s/i.test(s) || /^\\$/.test(s) || /^\\d/.test(s) || s.includes('{') || s.includes('}');\n  }\n\n  /**\n   * formatBidderName \u2013 UI-level \"You\" override.\n   * Compares the bidder name against:\n   *   1. _currentUserWebkulName (detected from Webkul winning responses)\n   *   2. Shopify logged-in customer name (meta tag fallback)\n   * If either match (case-insensitive), returns \"You\".\n   */\n  function formatBidderName(name) {\n    if (!name || !name.trim()) return name;\n    var n = name.trim().toLowerCase();\n    // 1. Compare against Webkul bidder name (primary \u2014 auto-detected from winning responses)\n    if (_currentUserWebkulName && n === _currentUserWebkulName.toLowerCase()) {\n      return 'You';\n    }\n    // 2. Compare against Shopify customer display name (fallback)\n    var custMeta = document.querySelector('meta[name=\"logged-in-customer-name\"]');\n    if (custMeta && custMeta.content.trim() && n === custMeta.content.trim().toLowerCase()) {\n      return 'You';\n    }\n    return name;\n  }\n\n  // \u2500\u2500\u2500 Sorting \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n  function sortProductsByEndingSoon() {\n    // 1. Tag original positions if not already done\n    if (!window._bcoOriginalSortTagged) {\n      document.querySelectorAll('#products_on_auction .wkgrid, #products_on_auction .product-card').forEach((item, index) => {\n        item.setAttribute('data-original-position', String(index));\n      });\n      window._bcoOriginalSortTagged = true;\n    }\n\n    // 2. Collect all individual item wrappers\n    const items = Array.from(document.querySelectorAll('#products_on_auction .wkgrid, #products_on_auction .product-card'));\n    if (items.length === 0) return;\n\n    // 3. Store their original parent slots to preserve Webkul's row groupings\n    const slots = items.map(item => item.parentNode);\n\n    // 4. Sort items\n    items.sort((a, b) => getTimerSeconds(a) - getTimerSeconds(b));\n\n    // 5. Put them back into the sequential slots\n    for (let i = 0; i < items.length; i++) {\n      slots[i].appendChild(items[i]);\n    }\n    console.log('[BCO Sort] Sorted ' + items.length + ' items by Ending Soon');\n  }\n\n  function resetProductSort() {\n    const items = Array.from(document.querySelectorAll('#products_on_auction .wkgrid, #products_on_auction .product-card'));\n    if (items.length === 0) return;\n\n    const slots = items.map(item => item.parentNode);\n\n    items.sort((a, b) => {\n      const posA = parseInt(a.getAttribute('data-original-position')) || 0;\n      const posB = parseInt(b.getAttribute('data-original-position')) || 0;\n      return posA - posB;\n    });\n\n    for (let i = 0; i < items.length; i++) {\n      slots[i].appendChild(items[i]);\n    }\n    console.log('[BCO Sort] Reset sort to original positions');\n  }\n\n  window.sortProductsByEndingSoon = sortProductsByEndingSoon;\n  window.resetProductSort = resetProductSort;\n\n  // \u2500\u2500\u2500 My Bids Filter \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n  function filterMyBids() {\n    document.documentElement.classList.add('bco-filtering-my-bids');\n    \n    // v87: Immortal Grid Healer. Webkul natively destroys the entire grid 3 seconds \n    // after page load, extinguishing our initial filter passes. We must attach an \n    // immortal Observer to the parent container so when Webkul spawns the new products,\n    // v91 FIX: Webkul's grid structure frequently breaks MutationObserver bindings due to deep DOM replacements.\n    // We enforce an absolute polling interval to guarantee the filter persists across all native state resets.\n    if (!window._bcoImmortalObserver) {\n      const gridTarget = document.querySelector('#products_on_auction') || document.body;\n      window._bcoImmortalObserver = new MutationObserver(function() {\n        if (document.documentElement.classList.contains('bco-filtering-my-bids')) {\n          const liveCards = document.querySelectorAll('.auction-card-info:not(.bco-visibility-processed):not(#bco-auction-blueprint .auction-card-info)');\n          if (liveCards.length > 0) {\n            filterMyBids();\n          }\n        }\n      });\n      window._bcoImmortalObserver.observe(gridTarget, { childList: true, subtree: true });\n      console.log('[BCO] Immortal Grid Healer (Observer) active');\n    }\n\n    const cards = document.querySelectorAll('.auction-card-info, .wk-category-auction');\n    if (!cards.length) return 0;\n\n    let foundBids = 0;\n    // v9 FIX: Deduplicate by product ID \u2014 same product can appear from both\n    // the initial Webkul render AND cross-page injection. Only show the first.\n    var _renderedPids = new Set();\n\n    cards.forEach(card => {\n      if (card.closest('#bco-auction-blueprint') || card.classList.contains('bco-visibility-processed')) return;\n      card.classList.add('bco-visibility-processed');\n\n      const statusEl = card.querySelector('.auction-card-info__status');\n      const hasBid = statusEl && (\n        statusEl.classList.contains('is-winning') ||\n        statusEl.classList.contains('is-outbid')\n      );\n\n      let wrapper = card.closest('.wkcol-md-3, .wkcol-md-4, .wkcol-md-6, .grid__item, li, .product-card, .slider-item, .card-wrapper, .product-grid-item, .card, .wk_products_row > div');\n      \n      if (!wrapper) {\n        let p = card;\n        while (p.parentElement) {\n          const pid = p.parentElement.id || '';\n          const pcls = p.parentElement.className || '';\n          const clsStr = typeof pcls === 'string' ? pcls : (pcls.baseVal || '');\n          if (pid.includes('products_on_auction') || clsStr.includes('grid') || clsStr.includes('row')) {\n            break;\n          }\n          if (p.parentElement.tagName === 'BODY') break;\n          p = p.parentElement;\n        }\n        wrapper = p;\n      }\n      \n      const targetEl = wrapper || card;\n\n      const auctionId = card.getAttribute('data-auction-id');\n      const prodId = card.getAttribute('data-auction-product-id') || card.getAttribute('data-product-id') || card.getAttribute('data-prod') || (card.closest('[data-prod]') ? card.closest('[data-prod]').getAttribute('data-prod') : null);\n      const parentWrapper = card.closest('[data-fetched-auction-id]') || targetEl;\n      const fetchedAuctionId = parentWrapper ? parentWrapper.getAttribute('data-fetched-auction-id') : null;\n\n      // v10 PERF: Also check handle-based participation (avoids per-handle /products/{h}.js fetches)\n      var cardHandle = '';\n      var cardLink = (targetEl.querySelector || card.querySelector).call(targetEl.querySelector ? targetEl : card, 'a[href*=\"/products/\"]');\n      if (cardLink) {\n        var hm = (cardLink.getAttribute('href') || '').match(/\\/products\\/([^?#\\/]+)/);\n        if (hm) cardHandle = hm[1];\n      }\n      if (!cardHandle) cardHandle = targetEl.getAttribute('data-handle') || '';\n\n      const isTrackedBid = (auctionId && _hasParticipated[auctionId]) ||\n                           (fetchedAuctionId && _hasParticipated[fetchedAuctionId]) ||\n                           (prodId && _participationByProductId[prodId]) ||\n                           (cardHandle && _participationByHandle[cardHandle]) ||\n                           (prodId && _minBidFromApi[prodId] && (_minBidFromApi[prodId].isWinning || _minBidFromApi[prodId].hasParticipated));\n\n      if (hasBid || isTrackedBid) {\n        // v9 FIX: Deduplicate \u2014 if we already rendered this product ID, hide the duplicate\n        if (prodId && _renderedPids.has(prodId)) {\n          try { targetEl.style.setProperty('display', 'none', 'important'); } catch(e) {}\n          return; // skip counting\n        }\n        if (prodId) _renderedPids.add(prodId);\n        targetEl.style.setProperty('display', '', 'important');\n        foundBids++;\n      } else {\n        try { targetEl.style.setProperty('display', 'none', 'important'); } catch(e) {}\n      }\n    });\n\n    // Hide pagination when filtering\n    document.querySelectorAll('.pagination').forEach(p => {\n      p.style.setProperty('display', 'none', 'important');\n    });\n\n    return foundBids;\n  }\n\n  function resetMyBidsFilter() {\n    const cards = document.querySelectorAll('.auction-card-info');\n    cards.forEach(card => {\n      const wrapper = card.closest('.slider-item, .grid__item, .product-card, li');\n      const targetEl = wrapper || card;\n      targetEl.style.setProperty('display', '', 'important');\n    });\n\n    // Restore pagination\n    document.querySelectorAll('.pagination').forEach(p => {\n      p.style.setProperty('display', '', 'important');\n    });\n  }\n  \n  // \u2500\u2500\u2500 Cross-Page Fetch for My Bids (v87 reconstruction) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  function fetchMyBidsFromAllPages() {\n    if (_fetchingAllBids) return;\n    _fetchingAllBids = true;\n\n    // Find the master container where cards live\n    // V92 FIX: Never anchor on the blueprint element as it lives outside the grid matrix layout.\n    let masterContainer = document.querySelector('.auction-card-info:not([id=\"bco-auction-blueprint\"])')?.closest('.wkgrid, ul, .grid, .collection-matrix, #products_on_auction, .wk_products_row');\n    if (!masterContainer) {\n      masterContainer = document.querySelector('#products_on_auction, .wk_products_row_auction, .wk_products_row');\n    }\n\n    if (!masterContainer) {\n      console.warn('[BCO Sync] My Bids: Could not find master container');\n      _fetchingAllBids = false;\n      document.documentElement.classList.remove('bco-filtering-my-bids-active');\n      document.documentElement.classList.remove('bco-filtering-my-bids-loading');\n      var oldSpinner = document.querySelector('.bco-my-bids-spinner');\n      if (oldSpinner) oldSpinner.remove();\n      return;\n    }\n\n    // v14: Show skeleton card placeholders above grid (instead of simple text)\n    document.documentElement.classList.add('bco-filtering-my-bids-loading');\n    var spinner = document.querySelector('.bco-my-bids-spinner');\n    if (!spinner) {\n      spinner = document.createElement('div');\n      spinner.className = 'bco-my-bids-spinner';\n      spinner.innerHTML = '<div class=\"bco-skeleton-text\">Loading your bids\u2026</div>' +\n        '<div class=\"bco-skeleton-grid\">' +\n        '<div class=\"bco-skeleton-card\"><div class=\"bco-skeleton-img\"></div><div class=\"bco-skeleton-line w80\"></div><div class=\"bco-skeleton-line w60\"></div><div class=\"bco-skeleton-line w40\"></div></div>' +\n        '<div class=\"bco-skeleton-card\"><div class=\"bco-skeleton-img\"></div><div class=\"bco-skeleton-line w80\"></div><div class=\"bco-skeleton-line w60\"></div><div class=\"bco-skeleton-line w40\"></div></div>' +\n        '<div class=\"bco-skeleton-card\"><div class=\"bco-skeleton-img\"></div><div class=\"bco-skeleton-line w80\"></div><div class=\"bco-skeleton-line w60\"></div><div class=\"bco-skeleton-line w40\"></div></div>' +\n        '</div>';\n      masterContainer.parentNode.insertBefore(spinner, masterContainer);\n    }\n\n    let pageNum = 1;\n    let currentPageMatch = window.location.search.match(/page=(\\d+)/);\n    let currentPageNum = currentPageMatch ? parseInt(currentPageMatch[1], 10) : 1;\n    const seenProductIds = new Set();\n    \n    // Seed seen IDs from the current page's populated products\n    document.querySelectorAll('.auction-card-info, .wk-category-auction, [data-prod]').forEach(card => {\n      var prodId = card.getAttribute('data-auction-product-id') || card.getAttribute('data-product-id') || card.getAttribute('data-prod');\n      if (prodId) seenProductIds.add(prodId);\n    });\n\n    console.log('[BCO Sync] Starting cross-page fetch for My Bids...');\n\n    // v8 FIX: STEP 0 - Fetch authoritative participation data from Webkul\n    // getCustomerBiddingDetails API BEFORE the cross-page fetch. This seeds\n    // _participationByProductId so filterMyBids shows ALL participated products.\n    var custId = resolveCurrentCustId();\n    var participationSeeded = false;\n\n    function seedParticipationFromApi() {\n      return new Promise(function(resolve) {\n        if (!custId || custId === '0') {\n          console.log('[BCO Sync] No customer ID, skipping participation API');\n          resolve();\n          return;\n        }\n\n        var apiUrl = '/tools/products-on-auction?callback=getCustomerBiddingDetails&new=1&customer=' + custId + '&t=1&f=1';\n        console.log('[BCO Sync] Fetching participation data from Webkul API...');\n\n        fetch(apiUrl)\n          .then(function(resp) { return resp.text(); })\n          .then(function(html) {\n            var doc = new DOMParser().parseFromString(html, 'text/html');\n            var productLinks = doc.querySelectorAll('a[href*=\"/products/\"]');\n            var handles = new Set();\n\n            productLinks.forEach(function(link) {\n              var href = link.getAttribute('href') || '';\n              var match = href.match(/\\/products\\/([^?#\\/]+)/);\n              if (match && match[1] && match[1] !== 'undefined') {\n                handles.add(match[1]);\n              }\n            });\n\n            console.log('[BCO Sync] Webkul API returned ' + handles.size + ' participated products: ' + Array.from(handles).join(', '));\n\n            // v10 PERF: Store handles directly instead of fetching /products/{handle}.js\n            // for each one. filterMyBids now matches by handle via _participationByHandle.\n            // This eliminates N network requests (one per participated product).\n            handles.forEach(function(h) {\n              _participationByHandle[h] = true;\n            });\n            participationSeeded = handles.size > 0;\n            console.log('[BCO Sync] Seeded ' + handles.size + ' handles from participation API (zero extra fetches)');\n            resolve();\n          })\n          .catch(function(err) {\n            console.warn('[BCO Sync] Participation API fetch failed:', err);\n            resolve();\n          });\n      });\n    }\n\n    // Seed participation data first, then start cross-page fetch\n    seedParticipationFromApi().then(function() {\n      fetchNextPage();\n    });\n    \n    // V102 Safety Timeout: Ensure the loading overlay clears even if fetches hang\n    // v7 FIX: Increased from 8s to 15s to accommodate cross-page fetch + poll cycle\n    var safeTimeout = setTimeout(function() {\n      document.documentElement.classList.remove('bco-filtering-my-bids-active');\n      if (typeof filterMyBids === 'function') filterMyBids();\n    }, 15000);\n\n    // v8 OPTIMIZATION: Process a single page of collection HTML and extract product data\n    function processPageHtml(html, masterContainer, seenProductIds) {\n      var doc = new DOMParser().parseFromString(html, 'text/html');\n      var widgets = Array.from(doc.querySelectorAll('.auction-card-info, .wk-category-auction'));\n      var addedAny = false;\n\n      widgets.forEach(function(widgetEl) {\n        var el = widgetEl.closest('.wkcol-md-3, .wkcol-md-4, .wkcol-md-6, .grid__item, li, .product-card, .slider-item, .card-wrapper, .product-grid-item, .card, .wk_products_row > div');\n        if (!el || el.tagName === 'BODY' || el.classList.contains('grid') || el.classList.contains('row')) {\n          var prev = widgetEl.previousElementSibling;\n          while (prev && !prev.classList.contains('grid__item') && !prev.classList.contains('product-card') && !prev.classList.contains('wkcol-md-3')) { prev = prev.previousElementSibling; }\n          el = prev || widgetEl;\n        }\n\n        var prodId = widgetEl.getAttribute('data-prod') || widgetEl.getAttribute('data-auction-product-id');\n        if (!prodId) prodId = (el.getAttribute('data-prod') || (el.querySelector('[data-prod]') || {}).getAttribute?.('data-prod')) || '';\n\n        var handle = '';\n        var productLink = el.querySelector('a[href*=\"/products/\"]');\n        if (productLink) {\n          var hrefVal = productLink.getAttribute('href') || '';\n          var hMatch = hrefVal.match(/\\/products\\/([^?#\\/]+)/);\n          if (hMatch) handle = hMatch[1];\n        }\n\n        // v8 FIX: Extract image src more aggressively \u2014 try src, data-src, data-srcset, srcset\n        var imgSrc = '';\n        var imgEl = el.querySelector('img');\n        if (imgEl) {\n          imgSrc = imgEl.getAttribute('src') || '';\n          if (!imgSrc || imgSrc.includes('no-image') || imgSrc.includes('data:image') || imgSrc.includes('{width}')) {\n            imgSrc = imgEl.getAttribute('data-src') || imgEl.getAttribute('data-srcset')?.split(' ')[0] || imgEl.getAttribute('srcset')?.split(' ')[0] || imgSrc || '';\n          }\n        }\n        // v8 FIX: Replace Shopify's {width} placeholder with actual width (500px for card images)\n        if (imgSrc && imgSrc.includes('{width}')) {\n          imgSrc = imgSrc.replace('{width}', '500');\n        }\n\n        if (prodId && !seenProductIds.has(prodId)) {\n          seenProductIds.add(prodId);\n\n          var wrapper = document.createElement('div');\n          wrapper.className = 'wkgrid wkcol-md-4 bco-injected-page-item';\n          wrapper.style.display = 'none';\n          wrapper.setAttribute('data-prod', prodId);\n          if (handle) wrapper.setAttribute('data-handle', handle);\n\n          if (handle) {\n            var linkEl = document.createElement('a');\n            linkEl.href = '/products/' + handle;\n            linkEl.style.display = 'none';\n            wrapper.appendChild(linkEl);\n          }\n\n          if (imgSrc) {\n            var imgLink = document.createElement('a');\n            imgLink.href = handle ? '/products/' + handle : '#';\n            var img = document.createElement('img');\n            img.src = imgSrc;\n            img.alt = handle ? handle.replace(/-/g, ' ') : 'Product';\n            img.loading = 'lazy';\n            imgLink.appendChild(img);\n            var imgCol = document.createElement('div');\n            imgCol.className = 'wkcol-md-3';\n            imgCol.appendChild(imgLink);\n            wrapper.appendChild(imgCol);\n          }\n\n          var wkWidget = document.createElement('div');\n          wkWidget.className = 'wk-category-auction';\n          wkWidget.setAttribute('data-prod', prodId);\n          wrapper.appendChild(wkWidget);\n\n          // v103: Append to fragment instead of masterContainer to prevent scroll jumps\n          fragment.appendChild(wrapper);\n          addedAny = true;\n        }\n      });\n\n      return { addedAny: addedAny, widgetCount: widgets.length };\n    }\n\n    function fetchNextPage() {\n      // v14 PROGRESSIVE: Fetch pages sequentially and render results as each arrives.\n      // This is faster than the old Promise.all approach because page 1 results appear\n      // immediately instead of waiting for all 5 pages to download.\n      var basePath = window.location.pathname;\n      if (basePath.includes('/pages/products-on-auction')) {\n        basePath = '/collections/auction';\n      }\n\n      var maxPages = 5;\n      var currentFetchPage = 1;\n      var totalAdded = 0;\n      var firstResultShown = false;\n      var fragment = document.createDocumentFragment();\n\n      function fetchPage(pageNum) {\n        if (pageNum > maxPages) {\n          // All pages processed \u2014 Batch append and run final cleanup\n          if (fragment.children.length > 0) {\n            masterContainer.appendChild(fragment);\n            console.log('[BCO Sync] Batch appended ' + fragment.children.length + ' cards');\n          }\n          finishFetch();\n          return;\n        }\n\n        console.log('[BCO Sync] Fetching page ' + pageNum + '/' + maxPages + '...');\n        fetch(basePath + '?page=' + pageNum)\n          .then(function(r) { return r.text(); })\n          .then(function(html) {\n            if (!html || html.length < 100) {\n              console.log('[BCO Sync] Page ' + pageNum + ' empty, stopping.');\n              finishFetch();\n              return;\n            }\n\n            // Re-scan DOM to avoid duplicates (Webkul may have rendered cards async)\n            document.querySelectorAll('.auction-card-info, .wk-category-auction, [data-prod]').forEach(function(el) {\n              var pid = el.getAttribute('data-auction-product-id') || el.getAttribute('data-product-id') || el.getAttribute('data-prod');\n              if (pid) seenProductIds.add(pid);\n            });\n\n            var pageResult = processPageHtml(html, masterContainer, seenProductIds);\n\n            if (pageResult.addedAny) {\n              totalAdded++;\n\n              // PROGRESSIVE: Initialize and show the new cards immediately\n              if (typeof setupAppGridInjection === 'function') {\n                setupAppGridInjection();\n              }\n\n              // Run filter immediately so new cards show/hide based on participation\n              setTimeout(function() {\n                document.querySelectorAll('.auction-card-info.bco-visibility-processed').forEach(function(c) {\n                  c.classList.remove('bco-visibility-processed');\n                });\n                if (typeof filterMyBids === 'function') filterMyBids();\n\n                // Hide skeleton after first results appear\n                if (!firstResultShown) {\n                  firstResultShown = true;\n                  var skel = document.querySelector('.bco-my-bids-spinner');\n                  if (skel) {\n                    skel.style.opacity = '0';\n                    skel.style.transition = 'opacity 0.3s';\n                    setTimeout(function() { skel.remove(); }, 300);\n                  }\n                }\n              }, 300);\n            }\n\n            if (!pageResult.widgetCount) {\n              console.log('[BCO Sync] Page ' + pageNum + ' had no widgets, stopping.');\n              finishFetch();\n              return;\n            }\n\n            // Fetch next page (small delay for breathing room)\n            setTimeout(function() { fetchPage(pageNum + 1); }, 100);\n          })\n          .catch(function(err) {\n            console.warn('[BCO Sync] Page ' + pageNum + ' fetch failed:', err);\n            setTimeout(function() { fetchPage(pageNum + 1); }, 100);\n          });\n      }\n\n      fetchPage(1);\n    }\n\n    function finishFetch() {\n      console.log('[BCO Sync] Cross-page fetch complete. Final initialization...');\n\n      // Remove loading state and skeleton\n      document.documentElement.classList.remove('bco-filtering-my-bids-loading');\n      var loadSpinner = document.querySelector('.bco-my-bids-spinner');\n      if (loadSpinner) loadSpinner.remove();\n      \n      // Final pass: ensure setupAppGridInjection ran on all injected items\n      if (typeof setupAppGridInjection === 'function') {\n        setupAppGridInjection();\n      }\n      \n      // Run authoritative poll + final filter after a short delay\n      setTimeout(function() {\n        console.log('[BCO Sync] Running final poll...');\n        \n        // Force a fresh poll to populate all card data\n        if (typeof window._bcoBiddingformPoll === 'function') {\n          window._bcoBiddingformPoll(null, true);\n        }\n        \n        // Wait for poll to complete, then apply final filter\n        var waitOurs = setInterval(function() {\n          if (!window._bfPolling) {\n            clearInterval(waitOurs);\n            console.log('[BCO Sync] Final poll complete. Applying filter...');\n            \n            // Strip processed stamps and apply filter\n            document.querySelectorAll('.auction-card-info.bco-visibility-processed').forEach(function(c) {\n              c.classList.remove('bco-visibility-processed');\n            });\n            \n            if (typeof filterMyBids === 'function') filterMyBids();\n            if (window._bcoSafeTimeout) clearTimeout(window._bcoSafeTimeout);\n            document.documentElement.classList.remove('bco-filtering-my-bids-active');\n            \n            // Retry loop to catch cards that get re-stamped by the immortal interval\n            var retryCount = 0;\n            var retryTimer = setInterval(function() {\n              retryCount++;\n              if (retryCount > 3 || !document.documentElement.classList.contains('bco-filtering-my-bids')) {\n                clearInterval(retryTimer);\n                return;\n              }\n              document.querySelectorAll('.auction-card-info.bco-visibility-processed').forEach(function(c) {\n                c.classList.remove('bco-visibility-processed');\n              });\n              if (typeof filterMyBids === 'function') filterMyBids();\n              console.log('[BCO Sync] My Bids retry pass #' + retryCount);\n            }, 2000);\n          }\n        }, 300);\n      }, 500); // Reduced from 1500ms \u2014 cards are already initialized progressively\n    }\n\n  }\n\n\n  // Tracks if the user has bid on an auction.\n  // Driven entirely by server DOM state and Socket updates.\n  var _hasParticipated = {}; // auctionId -> boolean\n  var _participationByProductId = {}; // productId -> boolean\n  var _participationByHandle = {}; // v10 PERF: handle -> boolean (avoids extra fetches)\n  // Always load participation data from localStorage immediately (needed for instant filter on page load)\n  try {\n    _hasParticipated = JSON.parse(localStorage.getItem('wk_part_auc') || '{}');\n    _participationByProductId = JSON.parse(localStorage.getItem('wk_part_pid') || '{}');\n  } catch(e) {}\n\n  // Deferred guest-cleanup: once DOM is ready, check if user is logged in.\n  // If NOT logged in, clear stale participation data from previous session.\n  // Deferred because meta[name=\"logged-in-customer-id\"] may not be in DOM during\n  // synchronous script execution (script in <head> runs before meta tag).\n  (document.readyState === 'loading'\n    ? document.addEventListener('DOMContentLoaded', _bcoClearGuestData)\n    : _bcoClearGuestData()\n  );\n  function _bcoClearGuestData() {\n    var metaEl = document.querySelector('meta[name=\"logged-in-customer-id\"]');\n    var metaCust = metaEl && metaEl.content ? metaEl.content.trim() : '';\n    var wkCustEl = document.querySelector('[cust-id]');\n    var guestCust = wkCustEl ? (wkCustEl.getAttribute('cust-id') || '') : '';\n    var isGuest = (!metaCust || metaCust === '0') && (!guestCust || guestCust === '0');\n    if (isGuest) {\n      _hasParticipated = {};\n      _participationByProductId = {};\n      try { localStorage.removeItem('wk_part_auc'); } catch(e) {}\n      try { localStorage.removeItem('wk_part_pid'); } catch(e) {}\n      console.log('[BCO] Guest session: cleared stale participation data');\n    }\n  }\n  \n  setInterval(function() {\n    try {\n      localStorage.setItem('wk_part_auc', JSON.stringify(_hasParticipated));\n      localStorage.setItem('wk_part_pid', JSON.stringify(_participationByProductId));\n    } catch(e) {}\n  }, 1500);\n\n  // No cross-tab localStorage sync (Pure Server-Driven)\n\n  function refreshCardDisplaySilently(card, data) {\n    // GUARD: If we don't have a valid bid or count, don't overwrite existing UI state.\n    // This prevents \"0.00\" appearing during initial sync before data is ready.\n    if (!data || (!parseFloat(data.bid) && !data.count && data.count !== 0)) {\n      return;\n    }\n\n    var dom = getCardDom(card);\n    var silentPid = card.getAttribute('data-product-id');\n    var bidVal = parseFloat(data.bid) || 0;\n\n    // Post-bid cooldown: skip display writes \u2014 let doBiddingformPoll be authoritative\n    var curBidRaw = card.getAttribute('data-current-bid') || '0';\n    safeBidWrite(silentPid, function () {\n      var minBidForSafe = parseFloat(card.getAttribute('data-min-bid')) || 0;\n      var stepValue = 2; // Default for VSOT data\n\n      // VSOT events only fire when a bid is placed, so bidCount >= 1\n      var vsotBidCount = parseInt(data.count) || 1;\n      safeInitialBid(card, bidVal, minBidForSafe, stepValue, vsotBidCount);\n\n      if (bidVal > 0 && dom.bidEl) {\n        // Mark as protected if non-zero\n        dom.bidEl.setAttribute('data-protected-val', String(bidVal));\n      }\n    }, curBidRaw, bidVal);\n\n    const auctionId = card.getAttribute('data-auction-id');\n    const productId = card.getAttribute('data-product-id');\n    const curBidRaw2 = card.getAttribute('data-current-bid') || '0';\n\n    // Update bid count\n    if (dom.countEl) {\n      var count = parseInt(data.count) || 0;\n      const newCountText = count + (count === 1 ? ' bid' : ' bids');\n      // Post-bid cooldown: guard bid count too\n      safeBidWrite(silentPid, function () {\n        if (dom.countEl.textContent !== newCountText) {\n          dom.countEl.textContent = newCountText;\n        }\n      }, curBidRaw2, bidVal);\n    }\n\n    // Protect from \"0\" reversal if we already have a better value\n    var existingBidVal = parseFloat(card.getAttribute('data-current-bid')) || 0;\n\n    if (bidVal === 0 && existingBidVal > 0 && (parseInt(data.count) || 0) > 0) {\n      console.log('[BCO Sync] Protecting bid ' + existingBidVal + ' for ' + auctionId);\n      bidVal = existingBidVal;\n      data.bid = String(existingBidVal);\n    }\n\n    // Only update data-current-bid and display if NOT in cooldown\n    safeBidWrite(productId, function () {\n      card.setAttribute('data-current-bid', String(data.bid));\n\n      const nextMin = applyBiddingRules(data.bid, auctionId, productId);\n      if (dom.inputEl) {\n        const nextMinVal = Math.ceil(nextMin).toString();\n        if (!isUserEditing(dom.inputEl) && dom.inputEl.value !== nextMinVal) {\n          dom.inputEl.value = nextMinVal;\n          dom.inputEl.min = nextMinVal;\n        }\n      }\n      card.setAttribute('data-min-bid', String(nextMin));\n      _lastBidUpdate[auctionId] = { bid: data.bid, ts: data.ts || Date.now() };\n    }, curBidRaw2, bidVal);\n\n    // During cooldown, still update .min attribute for validation\n    const nextMin = applyBiddingRules(data.bid, auctionId, productId);\n    if (dom.inputEl) {\n      dom.inputEl.min = Math.ceil(nextMin).toString();\n    }\n\n    // Also sync the PDP widget if we're on a product page\n    syncPdpWidgetFromVsot();\n\n    // \u2500\u2500 Aggressive Protection: Lock the value if it's good \u2500\u2500\n    // Skip during post-bid cooldown \u2014 don't lock a potentially wrong value\n    if (dom.bidEl && bidVal > 0) {\n      safeBidWrite(productId, function () {\n        const lockedVal = 'USD ' + Math.floor(bidVal);\n        dom.bidEl.setAttribute('data-locked-val', lockedVal);\n        if (!dom.bidEl.getAttribute('data-observer-ready')) {\n          var observer = new MutationObserver(function (mutations) {\n            mutations.forEach(function (mutation) {\n              var locked = dom.bidEl.getAttribute('data-locked-val');\n              // Also check cooldown \u2014 don't fight the API poll\n              var cbRaw = card.getAttribute('data-current-bid') || '0';\n              safeBidWrite(productId, function () {\n                if (locked && dom.bidEl.textContent !== locked && (dom.bidEl.textContent.includes('USD 0') || dom.bidEl.textContent.trim().length < 5)) {\n                  console.log('[BCO Sync] Mutation Guard: Restoring ' + locked);\n                  dom.bidEl.textContent = locked;\n                }\n              }, cbRaw, bidVal);\n            });\n          });\n          observer.observe(dom.bidEl, { characterData: true, childList: true, subtree: true });\n          dom.bidEl.setAttribute('data-observer-ready', 'true');\n        }\n      }, curBidRaw2, bidVal);\n    }\n  }\n\n\n  // \u2500\u2500 PDP State Cache \u2500\u2500\n  // Stores the last state passed to renderPdpState so we can replay it\n  // once Webkul asynchronously populates the #wk-auction container.\n  var _lastPdpState = null;\n\n  // v81: Authoritative min-bid value for PDP. Set by doBiddingformPoll\n  // (server-computed). Used to lock the bid input against Webkul's native\n  // JS which sometimes writes a different value (e.g. 18 vs 19).\n  var _pdpAuthoritativeMin = null; // {value: number, pid: string, ts: number}\n\n  /**\n   * \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n   * renderPdpState \u2014 v78-PDP SINGLE RENDER FUNCTION\n   *\n   * The ONE function that writes ALL PDP auction state to the DOM.\n   * Nothing else may write price, count, status, input, or buttons on PDP.\n   *\n   * v78: Added _lastPdpState cache + MutationObserver replay to fix the\n   * current-bid display regression. #wk-auction is empty on page load\n   * (Webkul fills it async), so the first renderPdpState call finds no\n   * .font-16.pa-text-color element. The observer detects when Webkul\n   * populates the widget and replays the last cached state.\n   *\n   * @param {Object} state\n   *   state.currentBid   {number}   Current highest bid\n   *   state.bidCount      {number}   Total number of bids\n   *   state.minBid        {number}   Minimum next bid (ceil'd)\n   *   state.isWinning     {boolean}  true if logged-in user is highest\n   *   state.hasParticipated {boolean} true if logged-in user has bid\n   *   state.productId     {string}   Product ID for scope check\n   * \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n   */\n  function renderPdpState(state) {\n    // v90: DISABLED \u2014 Let Webkul's native widget render untouched.\n    // Our DOM writes conflict with Webkul's re-render cycle after their update.\n    // CSS in auction-card-info.css handles all glassmorphism styling.\n    return;\n\n    var pdpPid = pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id');\n    // v88: Remove loading placeholder (injected by pdpFastPath) once data arrives\n    var loadingPh = pdpWidget.querySelector('.bco-pdp-loading');\n    if (loadingPh) loadingPh.remove();\n    console.log('[BCO PDP] renderPdpState: product=' + (state.productId || '?') + ' main=' + (pdpPid || '?') + ' bidCount=' + state.bidCount);\n    if (state.productId && String(state.productId) !== String(pdpPid)) return;\n\n    var currentCustId = resolveCurrentCustId();\n    var auctionId = getAuctionId(pdpWidget);\n    var bannerContainer = pdpWidget.querySelector('.wk_auction_info_detail') || pdpWidget;\n\n    // \u2500\u2500 1. Price \u2500\u2500\n    // v79: Write current bid value into a dedicated element.\n    // Webkul's modern PDP layout has a flex row with 2 labels\n    // (\"Current Bid\", \"Starting Bid\") but only 1 value element.\n    // We inject our own value element next to the \"Current Bid\" label.\n    if (state.currentBid !== undefined) {\n      var priceWritten = false;\n      var newPriceText = 'USD ' + Math.floor(state.currentBid);\n\n      // \u2500\u2500 FIRST: Try Webkul's native #current_bid element \u2500\u2500\n      // This prevents \"Current Bid\" showing twice (our injected element + Webkul's native one).\n      var nativeBidEl = document.getElementById('current_bid') || pdpWidget.querySelector('.wk-current-bid');\n      if (nativeBidEl) {\n        if (nativeBidEl.textContent.trim() !== newPriceText) nativeBidEl.textContent = newPriceText;\n        priceWritten = true;\n      }\n\n      // \u2500\u2500 Remove any previously-injected duplicate element \u2500\u2500\n      var oldBcoBidVal = pdpWidget.querySelector('#bco-pdp-current-bid-value');\n      if (oldBcoBidVal && priceWritten) {\n        oldBcoBidVal.remove();\n        console.log('[BCO PDP] Removed duplicate #bco-pdp-current-bid-value (native element is being used)');\n      }\n\n      // \u2500\u2500 SECONDARY: Use our injected element only if native is missing \u2500\u2500\n      if (!priceWritten) {\n        var bcoBidVal = pdpWidget.querySelector('#bco-pdp-current-bid-value');\n        if (bcoBidVal) {\n          if (bcoBidVal.textContent.trim() !== newPriceText) bcoBidVal.textContent = newPriceText;\n          priceWritten = true;\n        }\n      }\n\n      // If our element doesn't exist yet AND native is missing, find the \"Current Bid\" label and inject beside it\n      if (!priceWritten) {\n        // Find the label element that says \"Current Bid\" (not inside \"Bidding ends on\")\n        var currentBidLabel = null;\n        pdpWidget.querySelectorAll('.font-16, .pa-label-color, div').forEach(function (el) {\n          if (currentBidLabel) return;\n          var txt = (el.textContent || '').trim();\n          if (txt === 'Current Bid' || txt === 'Current bid' || txt === 'CURRENT BID') {\n            // Verify this isn't inside the \"Bidding ends on\" row\n            var parent = el.parentElement;\n            if (parent && (parent.textContent || '').includes('Bidding ends on')) return;\n            currentBidLabel = el;\n          }\n        });\n\n        if (currentBidLabel) {\n          console.log('[BCO PDP] Found \"Current Bid\" label \u2014 injecting bid value element (native element missing)');\n          // Create the current bid value element with matching Webkul styles\n          var bidValueEl = document.createElement('div');\n          bidValueEl.id = 'bco-pdp-current-bid-value';\n          bidValueEl.className = 'font-neue font-26 font-w-700 pa-text-color';\n          bidValueEl.textContent = newPriceText;\n          // Insert right after the \"Current Bid\" label\n          currentBidLabel.parentNode.insertBefore(bidValueEl, currentBidLabel.nextSibling);\n\n          // Restructure the container to show labels and values cleanly:\n          // Current Bid: USD 70 | Starting Bid: USD 1\n          var flexParent = currentBidLabel.closest('.display-flex-row') || currentBidLabel.parentElement;\n          if (flexParent) {\n            flexParent.style.cssText = 'display:flex;flex-wrap:wrap;align-items:baseline;gap:8px 24px;';\n          }\n          priceWritten = true;\n        }\n      }\n\n      // \u2500\u2500 FALLBACK: Legacy selectors for older Webkul layouts \u2500\u2500\n      if (!priceWritten) {\n        var priceEl = document.getElementById('current_bid') || pdpWidget.querySelector('.wk-current-bid');\n        if (!priceEl) {\n          // Find font-neue/font-26 value NOT in \"Bidding ends on\" area\n          pdpWidget.querySelectorAll('.pa-text-color').forEach(function (el) {\n            if (priceEl) return;\n            var parentText = el.parentElement ? (el.parentElement.textContent || '') : '';\n            if (parentText.includes('Bidding ends on') || parentText.includes('Bid End Date')) return;\n            if (el.classList.contains('pa-label-color')) return;\n            priceEl = el;\n          });\n        }\n        if (priceEl) {\n          if (priceEl.textContent.trim() !== newPriceText) priceEl.textContent = newPriceText;\n          priceWritten = true;\n        }\n      }\n\n      // \u2500\u2500 LAST RESORT: Webkul hasn't rendered yet \u2014 install observer \u2500\u2500\n      if (!priceWritten && !pdpWidget.hasAttribute('data-bco-pdp-observer')) {\n        pdpWidget.setAttribute('data-bco-pdp-observer', 'true');\n        console.log('[BCO PDP] #wk-auction empty \u2014 installing MutationObserver to replay state after Webkul render');\n        var pdpWidgetObserver = new MutationObserver(function (mutations, obs) {\n          var hasContent = pdpWidget.children.length > 2;\n          if (hasContent && _lastPdpState) {\n            obs.disconnect();\n            console.log('[BCO PDP] Webkul content detected \u2014 replaying renderPdpState');\n            setTimeout(function () {\n              renderPdpState(_lastPdpState);\n              setTimeout(applyPdpBidderName, 500);\n            }, 200);\n          }\n        });\n        pdpWidgetObserver.observe(pdpWidget, { childList: true, subtree: true });\n        setTimeout(function () { pdpWidgetObserver.disconnect(); }, 30000);\n      }\n\n      console.log('[BCO PDP] price write result:', priceWritten ? newPriceText : 'NOT WRITTEN');\n      var hiddenInput = document.getElementById('current_bid_hidden');\n      if (hiddenInput) hiddenInput.value = state.currentBid;\n      var valInput = document.getElementById('current_bid_val');\n      if (valInput) valInput.value = state.currentBid;\n    }\n\n    // \u2500\u2500 2. Bid count \u2500\u2500\n    // v74: Render even if 0\n    if (state.bidCount !== undefined) {\n      var countEl = document.getElementById('show_bids') ||\n        pdpWidget.querySelector('.wk-bid-count') ||\n        pdpWidget.querySelector('.no_of_bids_div .font-16');\n      if (countEl) {\n        const newCountText = state.bidCount + ' Bid(s)';\n        if (countEl.textContent !== newCountText) {\n          countEl.textContent = newCountText;\n        }\n      }\n    }\n    // 4. Hide redundant \"Bid End Date\" row if it exists\n    pdpWidget.querySelectorAll('.margin-top-15, .pa-bdr').forEach(function (row) {\n      // v77: GUARD \u2014 never hide the main widget or containers holding key fields\n      if (row.id === 'wk-auction' || row.classList.contains('pad-15')) return;\n\n      var text = row.textContent || '';\n      // If it contains \"Time Left\" or \"Current Bid\", it's a layout container we must never hide\n      if (text.includes('Time Left:') || text.includes('Current Bid:')) return;\n\n      if (text.includes('Bid End Date') || /^[0-9]{1,2}-[A-Za-z]{3}-[0-9]{4}/.test(text.trim())) {\n        // v76: Use class for more robust hiding against CSS !important overrides\n        row.classList.add('bco-hidden-row');\n        row.style.display = 'none';\n      }\n    });\n\n    // v74: Render even if 0\n    if (state.minBid !== undefined) {\n      var ceilMin = Math.ceil(state.minBid);\n      console.log('[BCO PDP] Setting bid input to:', ceilMin, 'from state.minBid');\n      // v75: If bidCount is 0, ensure we use the start price/min bid as the input value\n      if (state.bidCount === 0 && state.minBid) {\n        ceilMin = Math.ceil(state.minBid);\n      }\n\n      var bidInput = pdpWidget.querySelector('#wk_bid_amount, #bid_amount, input[name=\"bid_amount\"]');\n      if (bidInput) {\n        if (!bidInput.getAttribute('name')) bidInput.setAttribute('name', 'bid_amount');\n        // Ensure the input is always editable (Webkul or our guard may have disabled it)\n        bidInput.disabled = false;\n        bidInput.removeAttribute('readonly');\n        bidInput.style.opacity = '';\n        // Attach editing listeners once so the WeakMap guard works on PDP\n        if (!bidInput.hasAttribute('data-bco-editing-guard')) {\n          bidInput.setAttribute('data-bco-editing-guard', 'true');\n          bidInput.addEventListener('focus', function () { markEditing(bidInput); });\n          bidInput.addEventListener('input', function () { markEditing(bidInput); });\n          bidInput.addEventListener('blur', function () {\n            setTimeout(function () {\n              if (bidInput !== document.activeElement) clearEditing(bidInput);\n            }, 500);\n          });\n        }\n        // MutationObserver: Webkul's JS re-applies disabled/readonly after render.\n        // This observer fights back and removes them immediately.\n        if (!bidInput.hasAttribute('data-bco-editable-observer')) {\n          bidInput.setAttribute('data-bco-editable-observer', 'true');\n          var editableObserver = new MutationObserver(function (mutations) {\n            for (var i = 0; i < mutations.length; i++) {\n              var attr = mutations[i].attributeName;\n              if (attr === 'disabled' || attr === 'readonly') {\n                if (bidInput.disabled) bidInput.disabled = false;\n                if (bidInput.hasAttribute('readonly')) bidInput.removeAttribute('readonly');\n                bidInput.style.opacity = '';\n                bidInput.style.pointerEvents = '';\n              }\n            }\n          });\n          editableObserver.observe(bidInput, { attributes: true, attributeFilter: ['disabled', 'readonly'] });\n        }\n        // v75: Use setTimeout to ensure we overwrite Webkul's initialization\n        // v80: Skip input value writes during post-bid cooldown to prevent flipping.\n        // v81: Lock the authoritative value and install a guard against Webkul overwrites.\n        var pdpInputCooldown = state.productId && _postBidCooldown[state.productId] &&\n          (Date.now() - _postBidCooldown[state.productId] < 8000);\n\n        // v81: If the server-authoritative min is available and HIGHER\n        // than this caller's locally-computed minBid, use the server value.\n        // This prevents socket/bulk-API paths (rate=1 \u2192 18) from overriding\n        // the biddingform-authoritative value (rate=2 \u2192 19).\n        if (_pdpAuthoritativeMin && _pdpAuthoritativeMin.pid === String(state.productId)) {\n          if (ceilMin < _pdpAuthoritativeMin.value) {\n            console.log('[BCO PDP] Overriding local minBid ' + ceilMin + ' with server-authoritative ' + _pdpAuthoritativeMin.value);\n            ceilMin = _pdpAuthoritativeMin.value;\n          }\n        }\n\n        setTimeout(function () {\n          if (!isUserEditing(bidInput)) {\n            // Always update the min constraint\n            bidInput.min = ceilMin.toString();\n            // Only overwrite the displayed value if NOT in post-bid cooldown\n            if (!pdpInputCooldown) {\n              bidInput.value = ceilMin.toString();\n              // Trigger change to update any listeners\n              bidInput.dispatchEvent(new Event('change', { bubbles: true }));\n              console.log('[BCO PDP] Applied bid input value after delay:', bidInput.value, 'id=', state.productId);\n            } else {\n              console.log('[BCO PDP] Skipped input value write during post-bid cooldown, id=', state.productId);\n            }\n          }\n        }, 300);\n\n        // v81: Lock guard \u2014 Webkul's native JS writes to #bid_amount on its own\n        // JSONP callback cycle. This observer detects those writes and re-asserts\n        // our authoritative value to prevent visible flipping (e.g. 18\u219419).\n        if (!bidInput.hasAttribute('data-bco-value-lock')) {\n          bidInput.setAttribute('data-bco-value-lock', 'true');\n          // Listen for programmatic value changes via 'change' event\n          bidInput.addEventListener('change', function () {\n            if (isUserEditing(bidInput)) return;\n            if (!_pdpAuthoritativeMin) return;\n            var authVal = _pdpAuthoritativeMin.value;\n            var curVal = parseInt(bidInput.value, 10);\n            if (curVal !== authVal && !isNaN(authVal)) {\n              console.log('[BCO PDP] Value-lock: Webkul wrote ' + curVal + ', re-asserting ' + authVal);\n              bidInput.value = authVal.toString();\n              bidInput.min = authVal.toString();\n              // Also sync stepper if present\n              var stepperInput = document.querySelector('#bco-pdp-stepper .auction-card-info__input');\n              if (stepperInput && !isUserEditing(stepperInput)) {\n                stepperInput.value = authVal.toString();\n                stepperInput.min = authVal.toString();\n              }\n            }\n          });\n          // Also poll periodically for first 15s to catch Webkul's async writes\n          // that may not trigger 'change' events\n          var lockPollCount = 0;\n          var lockPollTimer = setInterval(function () {\n            lockPollCount++;\n            if (lockPollCount > 30 || !_pdpAuthoritativeMin) { clearInterval(lockPollTimer); return; }\n            if (isUserEditing(bidInput)) return;\n            var authVal = _pdpAuthoritativeMin.value;\n            var curVal = parseInt(bidInput.value, 10);\n            if (curVal !== authVal && !isNaN(authVal)) {\n              console.log('[BCO PDP] Value-lock poll: fixing ' + curVal + ' \u2192 ' + authVal);\n              bidInput.value = authVal.toString();\n              bidInput.min = authVal.toString();\n              var stepperInput = document.querySelector('#bco-pdp-stepper .auction-card-info__input');\n              if (stepperInput && !isUserEditing(stepperInput)) {\n                stepperInput.value = authVal.toString();\n                stepperInput.min = authVal.toString();\n              }\n            }\n          }, 500);\n        }\n      }\n    } else if (state.currentBid !== undefined && state.currentBid > 0) {\n      // v75: Fallback \u2014 if minBid wasn't passed but we have currentBid (start price)\n      var fallbackMin = Math.ceil(state.currentBid);\n      console.log('[BCO PDP] Setting bid input to:', fallbackMin, 'from fallback state.currentBid');\n      var bidInput = pdpWidget.querySelector('#wk_bid_amount, #bid_amount, input[name=\"bid_amount\"]');\n      if (bidInput && !bidInput.value) {\n        bidInput.value = fallbackMin.toString();\n        bidInput.min = fallbackMin.toString();\n        bidInput.dispatchEvent(new Event('change', { bubbles: true }));\n      }\n    }\n\n    // \u2500\u2500 4. Status banner \u2500\u2500\n    // v74: STRICT AUTHORITY \u2014 Only update if isWinning is boolean (not undefined)\n    if (typeof state.isWinning === 'boolean' && currentCustId && currentCustId !== '0') {\n\n      // First: strip ALL Webkul hidden markers \u2014 they cause confusion\n      pdpWidget.querySelectorAll('.customer_highest_bidder, .customer_participated').forEach(function (m) {\n        m.remove();\n      });\n\n      // v87: PDP STATUS GUARD \u2014 Prevent stale API/poll from clearing winning banner during post-bid cooldown\n      const pdpStatusCooldown = state.productId && _postBidCooldown[state.productId] && \n                               (Date.now() - _postBidCooldown[state.productId] < 20000);\n      const currentlyWinningOnPdp = !!document.getElementById('bco-pdp-winning-banner');\n\n      // Remove both banners unconditionally AFTER checking them \u2014 we'll re-create the correct one\n      var oldWin = document.getElementById('bco-pdp-winning-banner');\n      if (oldWin) oldWin.remove();\n      var oldOut = document.getElementById('bco-pdp-outbid-banner');\n      if (oldOut) oldOut.remove();\n\n      if (state.isWinning || (pdpStatusCooldown && currentlyWinningOnPdp)) {\n        // \u2500\u2500 Winning \u2500\u2500\n        if (pdpStatusCooldown && currentlyWinningOnPdp && !state.isWinning) {\n           console.log('[BCO PDP StatusGuard] Maintaining WINNING banner during cooldown');\n        }\n        var winBanner = document.createElement('div');\n        winBanner.id = 'bco-pdp-winning-banner';\n        winBanner.style.cssText = 'background:#dcfce7;color:#166534;padding:12px;margin-bottom:15px;border-radius:6px;font-weight:bold;text-align:center;border:1px solid #bbf7d0;z-index:9;position:relative;';\n        winBanner.textContent = '\uD83C\uDFC6 You are the highest bidder!';\n        bannerContainer.prepend(winBanner);\n\n        _hasParticipated[auctionId] = true;\n      } else if (state.hasParticipated || _hasParticipated[auctionId] || oldWin) {\n        // \u2500\u2500 Outbid \u2500\u2500 (detected via API, tracker, or previous winning banner)\n        _hasParticipated[auctionId] = true;\n\n        var outBanner = document.createElement('div');\n        outBanner.id = 'bco-pdp-outbid-banner';\n        outBanner.style.cssText = 'background:#fee2e2;color:#991b1b;padding:12px;margin-bottom:15px;border-radius:6px;font-weight:bold;text-align:center;border:1px solid #fecaca;z-index:9;position:relative;';\n        outBanner.textContent = '\u26A0\uFE0F You have been outbid!';\n        bannerContainer.prepend(outBanner);\n      }\n\n      // \u2500\u2500 5. Button state (SYNC with status) \u2500\u2500\n      var btns = document.querySelectorAll('.wk_submit_bid, #pa_place_bid_link, .pa-category-btn, #pa_place_bid');\n      btns.forEach(function (btn) {\n        if (state.isWinning) {\n          // Proxy bidding: do NOT disable \u2014 user may increase proxy max\n          // btn.disabled = true;\n        } else {\n          // v74: Explicitly re-enable if NOT winning\n          btn.disabled = false;\n          btn.style.opacity = '';\n          btn.style.pointerEvents = '';\n          btn.style.cursor = '';\n        }\n      });\n    }\n\n    // \u2500\u2500 5b. Highest Bidder Name on PDP \u2500\u2500\n    // Prefer the passed-in name, but ALWAYS fall back to the API cache or native DOM\n    // so the name doesn't go missing if one code path missed it.\n    // All sources are validated through isLikelyBidAmount to reject \"USD 3 (You)\" etc.\n    var resolvedPdpName = '';\n    if (state.highestBidderName && !isLikelyBidAmount(state.highestBidderName)) {\n      resolvedPdpName = state.highestBidderName;\n    }\n    if (!resolvedPdpName) {\n      // Fallback 1: API cache\n      if (state.productId && _minBidFromApi[state.productId] && _minBidFromApi[state.productId].highestBidderName) {\n        var cachedPdpName = _minBidFromApi[state.productId].highestBidderName;\n        if (!isLikelyBidAmount(cachedPdpName)) {\n          resolvedPdpName = cachedPdpName;\n        }\n      }\n    }\n    if (!resolvedPdpName) {\n      // Fallback 2: Webkul's native DOM element (renders asynchronously)\n      var nativePdpNameEl = pdpWidget.querySelector('.highest_bidder_name, [class*=\"highest_bidder\"] span');\n      if (nativePdpNameEl && nativePdpNameEl.textContent.trim()) {\n        var nativePdpNameVal = nativePdpNameEl.textContent.trim();\n        if (!isLikelyBidAmount(nativePdpNameVal)) {\n          resolvedPdpName = nativePdpNameVal;\n        }\n      }\n    }\n    // v11 FIX: Don't show bidder name when there are 0 bids.\n    // Webkul/API cache can hold stale names from resolved proxy bids.\n    var pdpBidCount = parseInt(state.bidCount) || 0;\n    if (pdpBidCount === 0) resolvedPdpName = '';\n    if (resolvedPdpName) {\n      var pdpBidderRow = pdpWidget.querySelector('.bco-pdp-bidder-row');\n      if (!pdpBidderRow) {\n        pdpBidderRow = document.createElement('div');\n        pdpBidderRow.className = 'bco-pdp-bidder-row margin-top-15';\n        pdpBidderRow.style.cssText = 'display:flex;align-items:center;gap:6px;font-size:13px;width:100%;flex-wrap:wrap;overflow:hidden;max-width:100%;box-sizing:border-box;';\n        var label = document.createElement('span');\n        label.className = 'bco-pdp-bidder-label';\n        label.textContent = 'HIGHEST BIDDER:';\n        label.style.cssText = 'font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:rgba(255,255,255,0.6);white-space:nowrap;';\n        var nameSpan = document.createElement('span');\n        nameSpan.className = 'bco-pdp-bidder-name';\n        nameSpan.style.cssText = 'font-size:13px;font-weight:600;color:#4fd1c5;word-break:break-word;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 130px);';\n        pdpBidderRow.appendChild(label);\n        pdpBidderRow.appendChild(nameSpan);\n        // Placement priority: near Current Bid area \u2192 bid count \u2192 before bid form \u2192 append\n        var rpInserted = false;\n        var rpCbLabel = null;\n        pdpWidget.querySelectorAll('.font-16, .pa-label-color, div').forEach(function (el) {\n          if (rpCbLabel) return;\n          var txt = (el.textContent || '').trim();\n          if (txt === 'Current Bid' || txt === 'Current bid' || txt === 'CURRENT BID') {\n            var parent = el.parentElement;\n            if (parent && (parent.textContent || '').includes('Bidding ends on')) return;\n            rpCbLabel = el;\n          }\n        });\n        if (rpCbLabel) {\n          var rpFlexRow = rpCbLabel.closest('.display-flex-row') || rpCbLabel.parentElement;\n          if (rpFlexRow && rpFlexRow.parentNode) {\n            rpFlexRow.parentNode.insertBefore(pdpBidderRow, rpFlexRow.nextSibling);\n            rpInserted = true;\n          }\n        }\n        if (!rpInserted) {\n          var countRow = null;\n          pdpWidget.querySelectorAll('.margin-top-15, .margin-btm-15, .pa-bdr').forEach(function (row) {\n            if ((row.textContent || '').includes('Bid(s)') || (row.textContent || '').includes('No of Bids')) countRow = row;\n          });\n          if (countRow && countRow.parentNode) {\n            countRow.parentNode.insertBefore(pdpBidderRow, countRow.nextSibling);\n            rpInserted = true;\n          }\n        }\n        if (!rpInserted) {\n          var rpBidForm = pdpWidget.querySelector('#wk_bid_amount, #bid_amount, .wk_submit_bid, #pa_place_bid_link, #pa_place_bid');\n          if (rpBidForm) {\n            var rpBidFormContainer = rpBidForm.closest('.margin-top-15, .pa-bdr, div');\n            if (rpBidFormContainer && rpBidFormContainer.parentNode) {\n              rpBidFormContainer.parentNode.insertBefore(pdpBidderRow, rpBidFormContainer);\n              rpInserted = true;\n            }\n          }\n        }\n        if (!rpInserted) bannerContainer.appendChild(pdpBidderRow);\n      }\n      var pdpNameEl = pdpBidderRow.querySelector('.bco-pdp-bidder-name');\n      \n      var writePdpName = true;\n      const isPdpInCooldown = state.productId && _postBidCooldown[state.productId] && (Date.now() - _postBidCooldown[state.productId] < 20000);\n      const isPdpWinningNow = state.isWinning || !!document.getElementById('bco-pdp-winning-banner');\n      \n      // If we are in cooldown AND winning, force the display to 'You' if the API is lagging\n      if (isPdpInCooldown && isPdpWinningNow && (!resolvedPdpName || (resolvedPdpName !== 'You' && resolvedPdpName !== '(You)'))) {\n          resolvedPdpName = 'You';\n          console.log('[BCO StatusGuard] Forcing PDP bidder name to You during cooldown for ' + state.productId);\n      }\n      \n      if (writePdpName && pdpNameEl) {\n        var _fmtPdp = formatBidderName(resolvedPdpName);\n        if (pdpNameEl.textContent !== _fmtPdp) pdpNameEl.textContent = _fmtPdp;\n      }\n    }\n\n    console.log('[BCO] renderPdpState: bid=$' + (state.currentBid || '?') +\n      ' count=' + (state.bidCount || '?') +\n      ' winning=' + state.isWinning +\n      ' min=' + (state.minBid || '?'));\n  }\n\n  // Expose globally so WebSocket and biddingformPoll can call it\n  window.renderPdpState = renderPdpState;\n\n  /**\n   * applyPdpBidderName \u2014 Standalone PDP name applier.\n   * Called on timers to catch async Webkul renders. Reads from:\n   *   1. _minBidFromApi cache (populated by biddingform API poll)\n   *   2. Native .highest_bidder_name DOM element inserted by Webkul\n   * Safe to call repeatedly \u2014 idempotent if name hasn't changed.\n   */\n  function applyPdpBidderName() {\n    var pdpWidget = document.querySelector('#wk-auction');\n    if (!pdpWidget) return;\n\n    var pid = pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id');\n    var name = '';\n\n    // Source 1: authoritative API cache (from biddingform poll)\n    if (pid && _minBidFromApi[pid] && _minBidFromApi[pid].highestBidderName) {\n      var cachedName = _minBidFromApi[pid].highestBidderName;\n      if (!isLikelyBidAmount(cachedName)) {\n        name = cachedName;\n        console.log('[BCO PDP] applyPdpBidderName: from API cache:', name);\n      } else {\n        console.log('[BCO PDP] applyPdpBidderName: rejected cached name (looks like bid amount):', cachedName);\n        // Clear the bad cache entry so it doesn't persist\n        _minBidFromApi[pid].highestBidderName = '';\n      }\n    }\n\n    // Source 2: Webkul's native DOM element (async render)\n    if (!name) {\n      var nativeEl = pdpWidget.querySelector('.highest_bidder_name, [class*=\"highest_bidder\"] span');\n      if (nativeEl && nativeEl.textContent.trim()) {\n        var nativeName = nativeEl.textContent.trim();\n        if (!isLikelyBidAmount(nativeName)) {\n          name = nativeName;\n          console.log('[BCO PDP] applyPdpBidderName: from native DOM:', name);\n          // Cache it so other paths can use it\n          if (pid) {\n            if (_minBidFromApi[pid]) _minBidFromApi[pid].highestBidderName = name;\n            else _minBidFromApi[pid] = { highestBidderName: name };\n          }\n        } else {\n          console.log('[BCO PDP] applyPdpBidderName: rejected native DOM name (looks like bid amount):', nativeName);\n        }\n      }\n    }\n\n    if (!name) {\n      // Source 3: last resort \u2014 fetch from Webkul bulk API\n      fetchPdpBidderNameFromPage();\n      return;\n    }\n\n    // Inject or update the bidder row\n    var bannerContainer = pdpWidget.querySelector('.wk_auction_info_detail') || pdpWidget;\n    var row = pdpWidget.querySelector('.bco-pdp-bidder-row');\n    if (!row) {\n      row = document.createElement('div');\n      row.className = 'bco-pdp-bidder-row margin-top-15';\n      row.style.cssText = 'display:flex;align-items:center;gap:6px;font-size:13px;width:100%;flex-wrap:wrap;overflow:hidden;max-width:100%;box-sizing:border-box;';\n      var lbl = document.createElement('span');\n      lbl.className = 'bco-pdp-bidder-label';\n      lbl.textContent = 'HIGHEST BIDDER:';\n      lbl.style.cssText = 'font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:rgba(255,255,255,0.6);white-space:nowrap;';\n      var sp = document.createElement('span');\n      sp.className = 'bco-pdp-bidder-name';\n      sp.style.cssText = 'font-size:13px;font-weight:600;color:#4fd1c5;word-break:break-word;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 130px);';\n      row.appendChild(lbl);\n      row.appendChild(sp);\n\n      // \u2500\u2500 Placement Priority: insert NEAR the Current Bid / bid count area \u2500\u2500\n      // so the bidder name is visible without scrolling past the Place Bid button.\n      var inserted = false;\n\n      // 1. After \"Current Bid\" value row\n      var currentBidLabel = null;\n      pdpWidget.querySelectorAll('.font-16, .pa-label-color, div').forEach(function (el) {\n        if (currentBidLabel) return;\n        var txt = (el.textContent || '').trim();\n        if (txt === 'Current Bid' || txt === 'Current bid' || txt === 'CURRENT BID') {\n          var parent = el.parentElement;\n          if (parent && (parent.textContent || '').includes('Bidding ends on')) return;\n          currentBidLabel = el;\n        }\n      });\n      if (currentBidLabel) {\n        // Insert after the Current Bid label's parent flex row\n        var flexRow = currentBidLabel.closest('.display-flex-row') || currentBidLabel.parentElement;\n        if (flexRow && flexRow.parentNode) {\n          flexRow.parentNode.insertBefore(row, flexRow.nextSibling);\n          inserted = true;\n        }\n      }\n\n      // 2. After bid count row\n      if (!inserted) {\n        var countRow = null;\n        pdpWidget.querySelectorAll('.margin-top-15, .margin-btm-15, .pa-bdr').forEach(function (r) {\n          if ((r.textContent || '').includes('Bid(s)') || (r.textContent || '').includes('No of Bids')) countRow = r;\n        });\n        if (countRow && countRow.parentNode) {\n          countRow.parentNode.insertBefore(row, countRow.nextSibling);\n          inserted = true;\n        }\n      }\n\n      // 3. After display-flex-row containing 'Bid(s)'\n      if (!inserted) {\n        pdpWidget.querySelectorAll('.display-flex-row').forEach(function (r) {\n          if (!inserted && (r.textContent || '').includes('Bid(s)')) {\n            r.parentNode.insertBefore(row, r.nextSibling);\n            inserted = true;\n          }\n        });\n      }\n\n      // 4. Before the bid form / place bid button as last resort\n      if (!inserted) {\n        var bidForm = pdpWidget.querySelector('#wk_bid_amount, #bid_amount, .wk_submit_bid, #pa_place_bid_link, #pa_place_bid');\n        if (bidForm) {\n          var bidFormContainer = bidForm.closest('.margin-top-15, .pa-bdr, div');\n          if (bidFormContainer && bidFormContainer.parentNode) {\n            bidFormContainer.parentNode.insertBefore(row, bidFormContainer);\n            inserted = true;\n          }\n        }\n      }\n\n      if (!inserted) bannerContainer.appendChild(row);\n    }\n    var sp = row.querySelector('.bco-pdp-bidder-name');\n    if (sp) { var _fmtN = formatBidderName(name); if (sp.textContent !== _fmtN) sp.textContent = _fmtN; }\n  }\n\n  // \u2500\u2500 Source 3: Multi-product bulk API fallback (runs once if Sources 1 & 2 fail) \u2500\u2500\n  // Webkul's bulk API only returns .highest_bidder_name when MULTIPLE products are\n  // requested together (not for single-product calls). On PDP there's only one product,\n  // so we first fetch the auction grid page to discover all product IDs, then make the\n  // bulk API call with ALL of them. The bidder name for the PDP product is then extracted.\n  var _pdpNameFetchDone = false;\n  function fetchPdpBidderNameFromPage() {\n    if (_pdpNameFetchDone) return;\n    var pdpWidget = document.querySelector('#wk-auction');\n    if (!pdpWidget) return;\n    // Only run if we still don't have the name\n    if (pdpWidget.querySelector('.bco-pdp-bidder-name') && pdpWidget.querySelector('.bco-pdp-bidder-name').textContent.trim()) return;\n\n    var pid = pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id');\n    if (!pid) return;\n\n    // Also skip if _minBidFromApi already has the name (doPoll beat us to it)\n    if (_minBidFromApi[pid] && _minBidFromApi[pid].highestBidderName) {\n      console.log('[BCO PDP] Source 3: name already in cache, applying:', _minBidFromApi[pid].highestBidderName);\n      applyPdpBidderName();\n      return;\n    }\n\n    _pdpNameFetchDone = true;\n    // v7 FIX: Reset the one-shot guard after 10s so retries can occur\n    // if Source 3 fetch returned empty (Webkul may not have hydrated yet)\n    setTimeout(function () {\n      if (!pdpWidget.querySelector('.bco-pdp-bidder-name') || !pdpWidget.querySelector('.bco-pdp-bidder-name').textContent.trim()) {\n        _pdpNameFetchDone = false;\n        console.log('[BCO PDP] Source 3: resetting one-shot guard for retry');\n      }\n    }, 10000);\n\n    // Resolve spcObj: try global, then window.spcObj, then mine from DOM scripts\n    var _spc = (typeof spcObj !== 'undefined' && spcObj && spcObj.api_url) ? spcObj : null;\n    if (!_spc && window.spcObj && window.spcObj.api_url) _spc = window.spcObj;\n    if (!_spc) {\n      var scripts = document.querySelectorAll('script');\n      for (var si = 0; si < scripts.length; si++) {\n        var stxt = scripts[si].textContent || '';\n        var apiMatch = stxt.match(/[\"']api_url[\"']\\s*:\\s*[\"'](https?:\\/\\/[^\"']+)[\"']/);\n        var shopMatch = stxt.match(/[\"']shop_name[\"']\\s*:\\s*[\"']([^\"']+)[\"']/);\n        if (apiMatch && shopMatch) {\n          _spc = { api_url: apiMatch[1], shop_name: shopMatch[1] };\n          try { var gcM = stxt.match(/[\"']general_config[\"']\\s*:\\s*(\\{[^}]+\\})/); if (gcM) _spc.general_config = JSON.parse(gcM[1]); } catch (e2) { }\n          try { var acM = stxt.match(/[\"']auction_config[\"']\\s*:\\s*(\\{[^}]+\\})/); if (acM) _spc.auction_config = JSON.parse(acM[1]); } catch (e3) { }\n          try { var tcM = stxt.match(/[\"']theme_colors[\"']\\s*:\\s*(\\{[^}]+\\})/); if (tcM) _spc.theme_colors = JSON.parse(tcM[1]); } catch (e4) { }\n          try { var wcM = stxt.match(/[\"']widget_config[\"']\\s*:\\s*[\"']([^\"']+)[\"']/); if (wcM) _spc.widget_config = wcM[1]; } catch (e5) { }\n          try { var tdM = stxt.match(/[\"']timediff[\"']\\s*:\\s*(-?\\d+)/); if (tdM) _spc.timediff = parseInt(tdM[1]); } catch (e6) { }\n          break;\n        }\n      }\n    }\n    if (!_spc || !_spc.api_url) {\n      console.log('[BCO PDP] Source 3: spcObj/api_url missing, cannot fetch');\n      return;\n    }\n\n    console.log('[BCO PDP] Source 3: using getProductsOnAuction callback for bidder name');\n\n    // getProductsOnAuction is the ONLY Webkul callback that returns\n    // .highest_bidder_name in its HTML template. It ignores the 'products' param\n    // and returns ALL products (paginated). We match by product handle.\n\n    // Get product handle from URL for matching\n    var pdpHandle = window.location.pathname.replace(/^\\/products\\//, '').replace(/\\/$/, '').toLowerCase();\n    if (!pdpHandle) {\n      console.log('[BCO PDP] Source 3: cannot determine product handle from URL');\n      return;\n    }\n    console.log('[BCO PDP] Source 3: looking for handle:', pdpHandle);\n\n    // Resolve cust_id directly from Webkul DOM elements\n    var src3CustId = '0';\n    var wkCustEl = document.querySelector('#wk-auction[cust-id], .wk-category-auction[cust-id], [cust-id]');\n    if (wkCustEl) src3CustId = wkCustEl.getAttribute('cust-id') || '0';\n    if (src3CustId === '0') src3CustId = resolveCurrentCustId() || '0';\n\n    // Try pages 1-5 to find the product (each page has ~48 products)\n    function tryPage(pageNum) {\n      if (pageNum > 5) {\n        console.log('[BCO PDP] Source 3: product not found in first 5 pages');\n        return;\n      }\n\n      var params = new URLSearchParams();\n      params.append('p', 'wk_ajax_process');\n      params.append('callback', 'getProductsOnAuction');\n      params.append('shop_name', _spc.shop_name);\n      params.append('cust_id', src3CustId);\n      if (pageNum > 1) params.append('page', String(pageNum));\n      if (_spc.timediff !== undefined) params.append('timediff', String(_spc.timediff));\n      var gc3 = '', ac3 = '', tc3 = '';\n      try { gc3 = btoa(JSON.stringify(_spc.general_config || {})); } catch (e) { }\n      try { ac3 = btoa(JSON.stringify(_spc.auction_config || {})); } catch (e) { }\n      try { tc3 = btoa(JSON.stringify(_spc.theme_colors || {})); } catch (e) { }\n      if (gc3) params.append('general_config', encodeURIComponent(gc3));\n      if (ac3) params.append('auction_config', encodeURIComponent(ac3));\n      if (_spc.widget_config) params.append('widget_config', unescape(encodeURIComponent(_spc.widget_config)));\n      if (tc3) params.append('theme_colors', encodeURIComponent(tc3));\n      if (typeof Shopify !== 'undefined' && Shopify.currency) {\n        params.append('active_currency', typeof Shopify.currency === 'object' ? JSON.stringify(Shopify.currency) : String(Shopify.currency));\n      }\n      params.append('_t', String(Date.now()));\n\n      var url = _spc.api_url + 'index.php?' + params.toString();\n      console.log('[BCO PDP] Source 3: trying page', pageNum);\n\n      fetch(url)\n        .then(function (r) { return r.text(); })\n        .then(function (text) {\n          if (!text || text.length < 50) {\n            console.log('[BCO PDP] Source 3: empty response on page', pageNum);\n            return;\n          }\n          // Parse JSONP: getProductsOnAuction(\"...html...\")\n          var start = text.indexOf('(');\n          var end = text.lastIndexOf(')');\n          if (start === -1 || end <= start) return;\n          var inner = text.substring(start + 1, end);\n\n          // Decode the response (usually a JSON-quoted HTML string)\n          var html = inner;\n          try {\n            var parsed = JSON.parse(inner);\n            if (typeof parsed === 'string') html = parsed;\n          } catch (e) {\n            if (inner.charAt(0) === '\"' && inner.charAt(inner.length - 1) === '\"') {\n              try { html = JSON.parse(inner); } catch (e2) { html = inner.substring(1, inner.length - 1); }\n            }\n          }\n\n          if (!html || typeof html !== 'string') return;\n\n          // Unescape\n          html = html.replace(/\\\\n/g, '\\n').replace(/\\\\r/g, '\\r').replace(/\\\\t/g, '\\t').replace(/\\\\\"/g, '\"').replace(/\\\\\\\\/g, '\\\\');\n\n          // v7 FIX: Use exact handle matching to prevent handle collisions\n          // (e.g. 'test-3' was matching 'test-30', 'test-31', etc.)\n          // Check for exact handle: /products/test-3 followed by end-of-string, ?, #, or /\n          var exactHandlePattern = new RegExp('/products/' + pdpHandle.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&') + '(?:[?#/\\'\\\"\\\\s]|$)', 'i');\n          if (!exactHandlePattern.test(html)) {\n            console.log('[BCO PDP] Source 3: exact handle not found on page', pageNum, '\u2014 trying next');\n            tryPage(pageNum + 1);\n            return;\n          }\n\n          console.log('[BCO PDP] Source 3: found handle on page', pageNum);\n\n\n          // Parse the full HTML and find our product's section\n          var parser = new DOMParser();\n          var doc = parser.parseFromString(html, 'text/html');\n\n          // v7 FIX: Use exact handle matching in link selector + multi-level walk\n          var fetchedName = '';\n          var allLinks = doc.querySelectorAll('a[href*=\"/products/\"]');\n          // Filter to only exact handle matches\n          var exactLinks = [];\n          for (var ai = 0; ai < allLinks.length; ai++) {\n            var linkHref = allLinks[ai].getAttribute('href') || '';\n            var linkHandleMatch = linkHref.match(/\\/products\\/([^?#\\/]+)/);\n            if (linkHandleMatch && linkHandleMatch[1].toLowerCase() === pdpHandle.toLowerCase()) {\n              exactLinks.push(allLinks[ai]);\n            }\n          }\n          console.log('[BCO PDP] Source 3: found', exactLinks.length, 'exact link matches for', pdpHandle);\n\n          for (var li = 0; li < exactLinks.length && !fetchedName; li++) {\n            // Walk up through parent elements to find the nearest .highest_bidder_name\n            var searchEl = exactLinks[li].closest('tr, td, div, li') || exactLinks[li].parentElement;\n            for (var walk = 0; walk < 8 && searchEl && !fetchedName; walk++) {\n              var nameEl = searchEl.querySelector('.highest_bidder_name');\n              if (nameEl && nameEl.textContent.trim()) {\n                var candidate = nameEl.textContent.trim();\n                if (!/^USD\\s/i.test(candidate) && !/^\\$/.test(candidate) && !/^\\d/.test(candidate)) {\n                  fetchedName = candidate;\n                }\n              }\n              if (!fetchedName) {\n                // Also try text-based search within this container\n                searchEl.querySelectorAll('div, span, td').forEach(function (el) {\n                  if (!fetchedName && el.textContent && el.textContent.includes('Highest Bidder:')) {\n                    var parts = el.textContent.split('Highest Bidder:');\n                    if (parts[1] && parts[1].trim() && !parts[1].includes('{')) {\n                      var textCandidate = parts[1].replace(/\\n/g, ' ').split(/[\\r\\n]/)[0].trim();\n                      if (textCandidate && !/^USD\\s/i.test(textCandidate) && !/^\\$/.test(textCandidate) && !/^\\d/.test(textCandidate)) {\n                        fetchedName = textCandidate;\n                      }\n                    }\n                  }\n                });\n              }\n              if (!fetchedName) searchEl = searchEl.parentElement;\n            }\n          }\n\n          // Reject non-name strings (final validation)\n          if (!fetchedName || /^USD\\s/i.test(fetchedName) || /^\\$/.test(fetchedName) || /^\\d/.test(fetchedName)) {\n            console.log('[BCO PDP] Source 3: no valid bidder name for handle', pdpHandle, 'on page', pageNum, '\u2014 trying next');\n            tryPage(pageNum + 1);\n            return;\n          }\n          console.log('[BCO PDP] Source 3: \u2713 found bidder name:', fetchedName, 'for', pdpHandle);\n\n          // Cache it\n          if (_minBidFromApi[pid]) _minBidFromApi[pid].highestBidderName = fetchedName;\n          else _minBidFromApi[pid] = { highestBidderName: fetchedName };\n\n          // Now apply it\n          applyPdpBidderName();\n        })\n        .catch(function (err) {\n          console.log('[BCO PDP] Source 3 page', pageNum, 'error:', err.message);\n        });\n    }\n\n    tryPage(1);\n  }\n  window.applyPdpBidderName = applyPdpBidderName;\n\n  function setupMyBidsButton() {\n    const buttons = document.querySelectorAll(\n      '#my-bids-filter-button, .my-bids-trigger'\n    );\n\n    // Check if my-bids filter is active from URL\n    var mbUrlParams = new URLSearchParams(window.location.search);\n    var hasMyBidsFilter = mbUrlParams.get('filter') === 'my-bids';\n\n    buttons.forEach(button => {\n      if (button.hasAttribute('data-mybids-handler-attached')) return;\n      button.setAttribute('data-mybids-handler-attached', 'true');\n\n      // NOTE: Removed isCustomerLoggedIn() guard \u2014 button is already Liquid-gated\n      // with {% if customer %}. The JS guard was hiding the button when Webkul's\n      // widget hadn't loaded yet (no cust-id attribute available).\n\n      // Restore active state from URL\n      if (hasMyBidsFilter) {\n        button.classList.add('is-active');\n      }\n\n      button.addEventListener('click', (e) => {\n        e.preventDefault();\n        e.stopPropagation();\n        e.stopImmediatePropagation();\n        console.log('[BCO MyBids] Button clicked!');\n\n        var params = new URLSearchParams(window.location.search);\n        if (button.classList.contains('is-active')) {\n          // Deactivate: remove filter param\n          params.delete('filter');\n          button.classList.remove('is-active');\n          window.history.pushState({ path: window.location.pathname + '?' + params.toString() }, '', window.location.pathname + '?' + params.toString());\n          resetMyBidsFilter();\n        } else {\n          // Activate: set filter param\n          params.set('filter', 'my-bids');\n          button.classList.add('is-active');\n          window.history.pushState({ path: window.location.pathname + '?' + params.toString() }, '', window.location.pathname + '?' + params.toString());\n          fetchMyBidsFromAllPages();\n        }\n        return false;\n      }, { capture: true });\n    });\n\n    // Backup: document-level delegation in case buttons load after this runs\n    if (!window._bcoMyBidsDelegated) {\n      window._bcoMyBidsDelegated = true;\n      document.addEventListener('click', function (e) {\n        var btn = e.target.closest('#my-bids-filter-button, .my-bids-trigger');\n        if (!btn) return;\n        e.preventDefault();\n        e.stopPropagation();\n        console.log('[BCO MyBids] Delegated click!');\n        var params = new URLSearchParams(window.location.search);\n        if (btn.classList.contains('is-active')) {\n          params.delete('filter');\n          btn.classList.remove('is-active');\n          window.history.pushState({ path: window.location.pathname + '?' + params.toString() }, '', window.location.pathname + '?' + params.toString());\n          resetMyBidsFilter();\n        } else {\n          params.set('filter', 'my-bids');\n          btn.classList.add('is-active');\n          window.history.pushState({ path: window.location.pathname + '?' + params.toString() }, '', window.location.pathname + '?' + params.toString());\n          fetchMyBidsFromAllPages();\n        }\n      }, true);\n    }\n  }\n\n  window.filterMyBids = filterMyBids;\n  window.resetMyBidsFilter = resetMyBidsFilter;\n\n  // \u2500\u2500\u2500 Ending Soon Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n  function setupEndingSoonButton() {\n    const buttons = document.querySelectorAll('#ending-soon-sort-button, #ending-soon-sort-button-mobile, .ending-soon-trigger');\n    if (buttons.length === 0) return;\n\n    const isAuctionCollection =\n      window.location.pathname.includes('/collections/auctions');\n    const urlParams = new URLSearchParams(window.location.search);\n    const hasEndingSoonSort = urlParams.get('sort_by') === 'Auction Ending Soon';\n\n    buttons.forEach(button => {\n      if (!button || button.hasAttribute('data-auction-handler-attached')) return;\n      button.setAttribute('data-auction-handler-attached', 'true');\n\n      if (isAuctionCollection || hasEndingSoonSort) {\n        button.classList.add('is-active');\n      }\n\n      button.addEventListener('click', (e) => {\n        e.preventDefault();\n        e.stopPropagation();\n        e.stopImmediatePropagation();\n\n        // Use URL-based sort (same as Sort dropdown) so the server sorts\n        // across all pages BEFORE pagination.\n        var params = new URLSearchParams(window.location.search);\n        if (button.classList.contains('is-active')) {\n          // Deactivate: remove sort param\n          params.delete('sort_by');\n          button.classList.remove('is-active');\n          window.history.pushState({ path: window.location.pathname + '?' + params.toString() }, '', window.location.pathname + '?' + params.toString());\n          resetProductSort();\n        } else {\n          // Activate: set sort param\n          params.set('sort_by', 'Auction Ending Soon');\n          button.classList.add('is-active');\n          window.history.pushState({ path: window.location.pathname + '?' + params.toString() }, '', window.location.pathname + '?' + params.toString());\n          sortProductsByEndingSoon();\n        }\n        return false;\n      }, { capture: true });\n\n      ['mousedown', 'touchstart'].forEach(eventType => {\n        button.addEventListener(eventType, (e) => {\n          e.stopPropagation();\n        }, { capture: true, passive: true });\n      });\n    });\n  }\n\n  // \u2500\u2500\u2500 Inline Bid Widget \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n  /**\n   * Extract the Webkul auction ID from a .wk-category-auction element.\n   * Webkul stores it in a child div class like \"wk-auction-5162233\".\n   */\n  function getAuctionId(wkWidget) {\n    if (!wkWidget) return null;\n    // explicit attribute check first\n    if (wkWidget.hasAttribute('data-auction-id')) return wkWidget.getAttribute('data-auction-id');\n    if (wkWidget.hasAttribute('auction_id')) return wkWidget.getAttribute('auction_id');\n\n    // Primary: find child element with wk-auction-{ID} class\n    const wkDiv = wkWidget.querySelector('[class*=\"wk-auction-\"]');\n    if (wkDiv) {\n      const match = wkDiv.className.match(/wk-auction-(\\d+)/);\n      if (match) return match[1];\n    }\n    // Product-page fallback: hidden input #auction_id inside the widget\n    const hiddenInput = wkWidget.querySelector('input#auction_id, input[name=\"auction_id\"]');\n    if (hiddenInput && hiddenInput.value) return hiddenInput.value;\n    // Fallback: search innerHTML for class pattern\n    const fallback = wkWidget.innerHTML.match(/wk-auction-(\\d+)/);\n    return fallback ? fallback[1] : null;\n  }\n\n  /**\n   * Hydrate the display fields (current bid, bid count, time left)\n   * by reading Webkul's rendered DOM data.\n   */\n  function hydrateCardDisplay(cardInfo, wkWidget) {\n    const productId = cardInfo.getAttribute('data-auction-product-id');\n    let auctionId = getAuctionId(wkWidget);\n\n    // V76 HOTFIX: If the widget is synthetic or missing the ID, look for the raw Webkul timer element\n    // which arrives asynchronously via AJAX.\n    if (!auctionId) {\n      var parentGrid = cardInfo.closest('.wkgrid, li, .product-card, product-card, .grid__item');\n      if (parentGrid) {\n        var timerEl = parentGrid.querySelector('[id^=\"auction_poa_\"], [id^=\"auction_\"]');\n        if (timerEl) {\n          var idMatch = timerEl.id.match(/auction(?:_poa)?_(\\d+)/);\n          if (idMatch) auctionId = idMatch[1];\n        }\n      }\n    }\n\n    if (auctionId) {\n      cardInfo.setAttribute('data-auction-id', auctionId);\n      console.log('[AquaVault Sync] Hydrating Card: Product=' + productId + ' Auction=' + auctionId);\n    }\n\n    // \u2500\u2500 Current Bid & Bid Count (Read from Webkul) \u2500\u2500\n    const bidValueEl = wkWidget?.querySelector('.wk-current-bid, #current_bid, .font-16.pa-text-color');\n    const bidCountEl = wkWidget?.querySelector('.wk-bid-count, #show_bids, .no_of_bids_div .font-16');\n\n    const displayBid = cardInfo.querySelector('.auction-card-info__current-bid');\n    const displayCount = cardInfo.querySelector('.auction-card-info__bid-count');\n\n    if (bidValueEl && displayBid) {\n      const val = parseBidAmount(bidValueEl.textContent);\n\n      // Get current displayed value for monotonic guard\n      var currentDisplayBid = parseFloat(cardInfo.getAttribute('data-current-bid') || '0');\n      if (!currentDisplayBid && displayBid) {\n        currentDisplayBid = parseFloat(displayBid.textContent.replace(/[^0-9.]/g, '')) || 0;\n      }\n\n      // Guard the hydration write to prevent stale widget data from overriding fresh API data\n      safeBidWrite(productId, function () {\n        displayBid.textContent = 'USD ' + Math.floor(val);\n      }, currentDisplayBid, val);\n    }\n\n    if (bidCountEl && displayCount) {\n      const count = parseInt(bidCountEl.textContent.trim()) || 0;\n      var currentDisplayCount = parseInt(displayCount.textContent) || 0;\n\n      // Monotonic guard for bid count during hydration\n      if (count >= currentDisplayCount) {\n        displayCount.textContent = count + (count === 1 ? ' bid' : ' bids');\n      }\n    }\n\n    // \u2500\u2500 Time Left (Native Webkul Timer Sync) \u2500\u2500\n    // v84 PERF: Per-card MutationObserver REMOVED \u2014 the centralized\n    // syncTimers() loop (1-second interval) already handles all timer\n    // displays for every card. With 48 cards this eliminates 48 observers.\n    // Initial sync: read Webkul timer value once during hydration.\n    const displayTime = cardInfo.querySelector('.auction-card-info__time-left');\n    const gridItem = cardInfo.closest('.grid-product, .product-card, .grid__item');\n    const wkTimer = gridItem?.querySelector('.pa-timer');\n\n    if (wkTimer && displayTime) {\n      const digits = wkTimer.querySelectorAll('.pa-theme-color');\n      if (digits.length >= 4) {\n        displayTime.textContent = digits[0].textContent + 'd ' + digits[1].textContent + 'h ' + digits[2].textContent + 'm ' + digits[3].textContent + 's';\n      }\n    }\n\n    // \u2500\u2500 Hide Webkul Native UI \u2500\u2500\n    if (gridItem) {\n      const selectorsToHide = [\n        '.wk-category-auction',\n        '.pa-timer',\n        '.start_bid_div',\n        '.no_of_bids_div',\n        '.pa-category-btn',\n        '.grid-product__price'\n      ];\n      selectorsToHide.forEach(sel => {\n        const el = gridItem.querySelector(sel);\n        if (el) el.style.display = 'none';\n      });\n    }\n\n    cardInfo.classList.remove('auction-card-info--loading');\n  }\n\n  /**\n   * Parse a currency string like \"USD 1.00\" or \"$5\" into a number.\n   */\n  function parseBidAmount(str) {\n    if (!str) return 0;\n    const cleaned = str.replace(/[^0-9.]/g, '');\n    return parseFloat(cleaned) || 0;\n  }\n\n  /**\n   * Get the minimum next bid for an auction card.\n   * Uses the current bid + increment from Webkul's bidding rules.\n   * Falls back to _defaultBiddingRules if none cached for this auction.\n   */\n  var _biddingRulesCache = {};   // auctionId \u2192 [{bid_from, bid_to, rate}]\n  var _rulesByProductId = {};    // productId \u2192 [{bid_from, bid_to, rate}] (in-memory only)\n  var _minBidFromApi = {};       // productId \u2192 { value: number, ts: number } \u2014 server-computed min bid from biddingform API\n  var _currentUserWebkulName = ''; // Webkul bidder username for the logged-in user (detected from winning API responses)\n\n  // \u2500\u2500 Update coordination \u2500\u2500\n  // Tracks the latest bid update per auction to prevent stale data from\n  // overwriting newer updates across socket/DOM watcher/API poll.\n  var _lastBidUpdate = {};        // auctionId \u2192 { bid: number, ts: number }\n  var _bfLastUpdate = {};          // productId \u2192 timestamp of last doBiddingformPoll write\n  var _bfFirstRunDone = {};        // productId \u2192 true after first authoritative biddingform write (v72)\n  var _suppressDomWatcher = false; // temporarily suppress DOM watcher during API poll writes\n\n  // \u2500\u2500 Default bidding rules \u2014 used ONLY until we fetch the real ones \u2500\u2500\n  // Try to grab from global spcObj if available, otherwise safe fallback.\n  var _defaultBiddingRules = [\n    { bid_from: '0.00', bid_to: '100000.00', rate: '1.00', maximum_rate: '0.00' }\n  ];\n\n  function getGlobalDefaultRules() {\n    if (typeof spcObj !== 'undefined' && spcObj.auction_config && spcObj.auction_config.wb_auction_bidding_rule) {\n      try {\n        // It might be a JSON string or an object\n        var raw = spcObj.auction_config.wb_auction_bidding_rule;\n        return typeof raw === 'string' ? JSON.parse(raw) : raw;\n      } catch (e) { console.error('Error parsing global bidding rules', e); }\n    }\n    return _defaultBiddingRules;\n  }\n\n  /** Apply bidding rules to calculate the next minimum bid. */\n  function applyBiddingRules(currentBid, auctionId, optionalProductId) {\n    // 1. Try product-wide rules FIRST (unifies all auctions for the same product)\n    var rules = (optionalProductId) ? _rulesByProductId[optionalProductId] : null;\n\n    // 2. Fallback to specific cached rules for this auction\n    if (!rules) {\n      rules = _biddingRulesCache[auctionId];\n    }\n\n    // 3. Fallback to global defaults\n    if (!rules) {\n      rules = getGlobalDefaultRules();\n    }\n\n    if (!rules || !Array.isArray(rules)) return currentBid + 1;\n\n    // Find the matching range\n    for (var i = 0; i < rules.length; i++) {\n      var r = rules[i];\n      var from = parseFloat(r.bid_from) || 0;\n      var to = parseFloat(r.bid_to) || Infinity;\n      if (currentBid >= from && currentBid < to) {\n        var rate = parseFloat(r.rate) || 1;\n        return currentBid + rate;\n      }\n    }\n    return currentBid + 1;\n  }\n  window.applyBiddingRules = applyBiddingRules;\n\n  function getMinNextBid(wkWidget, auctionId, cardInfo) {\n    // \u2500\u2500 PRIORITY 1: Server-computed min_bid from biddingform API \u2500\u2500\n    // This is the authoritative value \u2014 same as PDP uses.\n    if (cardInfo) {\n      var productId = cardInfo.getAttribute('data-product-id');\n      if (productId && _minBidFromApi[productId] && !isNaN(_minBidFromApi[productId].value) && _minBidFromApi[productId].value > 0) {\n        return _minBidFromApi[productId].value;\n      }\n    }\n\n    // \u2500\u2500 PRIORITY 2: Biddingform API is sole source of truth \u2500\u2500\n    // v86 FIX: Removed DOM-scrape fallback (.start_bid_div, .wk-current-bid)\n    // which caused Start Bid mismatch between PDP and collection page.\n    // The biddingform poll fires within ~1s of page load and sets the\n    // authoritative value via _minBidFromApi. Until then, return $1\n    // placeholder (matches Liquid template's hardcoded value=\"1\").\n    return 1;\n  }\n\n  /**\n   * If we're on a product page, try to read Webkul's dynamically-injected\n   * #bidding_rules and cache them for this auction.\n   */\n  function seedBiddingRulesFromPage() {\n    var rulesInput = document.querySelector('#bidding_rules');\n    if (!rulesInput || !rulesInput.value) return;\n    var wkWidget = document.querySelector('#wk-auction, .wk-category-auction');\n    var auctionId = getAuctionId(wkWidget);\n    if (!auctionId) {\n      var globalInput = document.querySelector('input#auction_id, input[name=\"auction_id\"]');\n      if (globalInput && globalInput.value) auctionId = globalInput.value;\n    }\n    if (!auctionId) return;\n    try {\n      var rules = JSON.parse(rulesInput.value);\n      _biddingRulesCache[auctionId] = rules;\n    } catch (e) { /* ignore */ }\n  }\n\n  /**\n   * Fetch bidding rules from a product page for use on collection cards.\n   * Webkul injects #bidding_rules only on product pages, so we fetch\n   * the product page HTML and extract the rules from the DOM.\n   * Results are cached per auction ID to avoid redundant fetches.\n   *\n   * @param {string} productUrl - absolute URL to the product page\n   * @param {string} auctionId - the auction ID to cache rules under\n   * @param {function} [onDone] - optional callback(rules) once fetched\n   */\n  var _fetchingRules = {}; // tracks in-progress fetches to avoid duplicates\n  function fetchBiddingRulesForCard(productUrl, auctionId, onDone) {\n    // Already cached \u2014 call back immediately\n    if (_biddingRulesCache[auctionId]) {\n      if (onDone) onDone(_biddingRulesCache[auctionId]);\n      return;\n    }\n    // Already fetching this product \u2014 queue the callback\n    if (_fetchingRules[auctionId]) {\n      if (onDone) {\n        _fetchingRules[auctionId].push(onDone);\n      }\n      return;\n    }\n    // No valid product URL\n    if (!productUrl || productUrl === '#') {\n      if (onDone) onDone(null);\n      return;\n    }\n    // Start fetch\n    console.log('[BCO Debug] Starting fetch for Auction ' + auctionId + ' url=' + productUrl);\n    _fetchingRules[auctionId] = onDone ? [onDone] : [];\n\n    // Helper to process rules from HTML string\n    function parseRulesFromHtml(html, source) {\n      if (!html) return null;\n      var parser = new DOMParser();\n      var doc = parser.parseFromString(html, 'text/html');\n\n      // 1. Try strict JSON input #bidding_rules\n      var rulesInput = doc.querySelector('#bidding_rules');\n      if (rulesInput && rulesInput.value) {\n        try {\n          var rules = JSON.parse(rulesInput.value);\n          if (Array.isArray(rules) && rules.length > 0) {\n            console.log('[BCO Debug] Found valid JSON rules via ' + source + ' for ' + auctionId);\n            return rules;\n          }\n        } catch (e) {\n          console.warn('[BCO Debug] Failed to parse JSON rules from ' + source, e);\n        }\n      }\n\n      // 2. Fallback: Try to find \"Minimum bidding amount allowed\" or \"min_bid_amount\" text\n      // This is a heuristic for when the raw JSON isn't present\n      var minSpan = doc.querySelector('.min_bid_amt') || doc.querySelector('.wk_auc_min_bid') || doc.querySelector('#current_bid');\n      if (minSpan) {\n        var minVal = parseFloat(minSpan.textContent.replace(/[^0-9.]/g, ''));\n        // If we found #current_bid, we need to find the NEXT allowed amount\n        if (minSpan.id === 'current_bid') {\n          var nextEl = doc.querySelector('#bid_amount, .wk-bid-amount, input[name=\"bid_param\"]');\n          if (nextEl) {\n            var nextVal = parseFloat(nextEl.value || nextEl.textContent.replace(/[^0-9.]/g, ''));\n            if (!isNaN(nextVal)) minVal = nextVal;\n            else minVal = minVal + 1; // absolute backup\n          }\n        }\n\n        if (!isNaN(minVal) && minVal > 0) {\n          console.log('[BCO Debug] Scraped min bid ' + minVal + ' via ' + source + ' for ' + auctionId);\n          return [{ bid_from: 0, bid_to: Infinity, rate: 0, _isMinFallback: true, _minVal: minVal }];\n        }\n      }\n      return null;\n    }\n\n    // \u2500\u2500 STRATEGY 1: Fetch Product Page HTML \u2500\u2500\n    fetch(productUrl)\n      .then(function (res) { return res.text(); })\n      .then(function (html) {\n        // \u2500\u2500 CRITICAL: Extract bidding data from raw HTML BEFORE DOMParser strips <script> \u2500\u2500\n        // DOMParser silently discards script content, but the PDP HTML contains crucial\n        // variables like `var min_bid_amount = XX;` and `bidding_rules` JSON in <script> tags.\n\n        // Try 1: Extract bidding_rules JSON from raw HTML (e.g. <input id=\"bidding_rules\" value='[...]'>)\n        var rawRulesMatch = html.match(/id=[\"']bidding_rules[\"'][^>]*value=[\"']([^\"']+)[\"']/i);\n        if (!rawRulesMatch) {\n          // Also try: var bidding_rules = [...]; or bidding_rules_data = [...]\n          rawRulesMatch = html.match(/(?:var\\s+)?bidding_rules(?:_data)?\\s*=\\s*(\\[[^\\]]+\\])/);\n        }\n        if (rawRulesMatch) {\n          try {\n            var rawRules = JSON.parse(rawRulesMatch[1].replace(/&quot;/g, '\"').replace(/&#39;/g, \"'\"));\n            if (Array.isArray(rawRules) && rawRules.length > 0) {\n              console.log('[BCO Debug] Regex-extracted bidding_rules JSON for auction=' + auctionId);\n              _biddingRulesCache[auctionId] = rawRules;\n              finish(rawRules);\n              return;\n            }\n          } catch (e) { /* parse failed, continue */ }\n        }\n\n        // Try 2: Extract var min_bid_amount = XX; from raw HTML\n        var minBidMatch = html.match(/var\\s+min_bid_amount\\s*=\\s*([\\d.]+)/);\n        if (minBidMatch) {\n          var minBidVal = parseFloat(minBidMatch[1]);\n\n          // Also find current bid to derive the increment\n          var currentBidMatch = html.match(/var\\s+current_bid_amount\\s*=\\s*([\\d.]+)/);\n          if (!currentBidMatch) {\n            // Try other patterns from PDP\n            currentBidMatch = html.match(/Current\\s+Bid[^<]*<[^>]*>.*?(\\d+(?:\\.\\d+)?)/);\n          }\n          var currentBid = currentBidMatch ? parseFloat(currentBidMatch[1]) : 0;\n\n          if (!isNaN(minBidVal) && minBidVal > 0) {\n            // Derive increment: min_bid_amount - current_bid\n            var increment = currentBid > 0 ? (minBidVal - currentBid) : 5; // use $5 as safe default\n            if (increment <= 0) increment = 1; // sanity: if current >= min, use $1\n\n            var derivedRules = [{ bid_from: '0.00', bid_to: '100000.00', rate: increment.toFixed(2), maximum_rate: '0.00' }];\n            console.log('[BCO Debug] Derived rules from min_bid_amount=' + minBidVal + ' currentBid=' + currentBid + ' increment=' + increment + ' for auction=' + auctionId);\n            _biddingRulesCache[auctionId] = derivedRules;\n\n            // Also store the absolute min_bid for direct use\n            if (!_minBidAmountCache) window._minBidAmountCache = {};\n            window._minBidAmountCache[auctionId] = minBidVal;\n\n            finish(derivedRules);\n            return;\n          }\n        }\n\n        // Try 3: DOMParser fallback (may not find script content but can find DOM elements)\n        var rules = parseRulesFromHtml(html, 'HTML_SCRAPE');\n\n        // STRICT MODIFICATION:\n        // If the rules are just a weak fallback (scraped text), IGNORE THEM.\n        // We want to force the API fetch if the JSON rules (#bidding_rules) are missing.\n        // This prevents using stale data from the page source.\n        if (rules && !rules[0]._isMinFallback) {\n          _biddingRulesCache[auctionId] = rules;\n          finish(rules);\n        } else {\n          // \u2500\u2500 STRATEGY 2: Fallback to Webkul API \u2500\u2500\n          console.log('[BCO Debug] HTML scrape failed (or was weak fallback). Attempting API fallback for ' + auctionId);\n\n          // Use spcObj if available, otherwise use known hardcoded values\n          var _apiUrl = (typeof spcObj !== 'undefined' && spcObj && spcObj.api_url) ? spcObj.api_url : 'https://sp-auction.webkul.com/';\n          var _shopName = (typeof spcObj !== 'undefined' && spcObj && spcObj.shop_name) ? spcObj.shop_name : 'buycoralonline.com'; // Updated fallback\n\n          // Try to find product ID from the card on the page\n          var card = document.querySelector('.auction-card-info[data-auction-id=\"' + auctionId + '\"]');\n          var prodId = null;\n          if (card) {\n            // Look for sibling .wk-category-auction with data-prod attribute\n            var container = card.closest('li, .product-card, product-card, .grid__item');\n            if (container) {\n              var widget = container.querySelector('.wk-category-auction[data-prod]');\n              if (widget) {\n                prodId = widget.getAttribute('data-prod');\n              }\n              // Fallback: try input[name=\"prod_id\"] if data-prod is missing\n              if (!prodId) {\n                var input = container.querySelector('input[name=\"prod_id\"]');\n                if (input) prodId = input.value;\n              }\n              // Fallback: try data-product-id on the card itself (reliable in our theme)\n              if (!prodId && card.hasAttribute('data-auction-product-id')) {\n                prodId = card.getAttribute('data-auction-product-id');\n              }\n            }\n          }\n\n          if (prodId) {\n            // STRATEGY 2: Fallback to Webkul Bulk Poll\n            console.log('[BCO Debug] HTML scrape failed. Triggering bulk poll for ' + auctionId);\n\n            // The individual API fetch is complex to reconstruct (requires config).\n            // Instead, we rely on the bulk poller (bcoDoPoll) which handles this correctly.\n            if (typeof window.bcoDoPoll === 'function') {\n              window.bcoDoPoll();\n            } else {\n              // If bcoDoPoll isn't ready, it will run on its interval/timeout anyway.\n              console.log('[BCO Debug] bcoDoPoll not yet ready, waiting for auto-poll.');\n            }\n\n            // We return null here to abort the *immediate* synchronous update which relies on rules.\n            // The bcoDoPoll will update the card asynchronously when data arrives.\n            finish(null);\n          } else {\n            console.warn('[BCO Rules] No product ID found for API fallback ' + auctionId);\n            finish(null);\n          }\n        }\n      })\n      .catch(function (err) {\n        console.error('[BCO Rules] Network error fetching rules for ' + auctionId + ', err=' + err);\n        finish(null);\n      });\n\n    function finish(rules) {\n      if (rules) {\n        // If we have rules, update any inputs that might have been waiting\n        // Logic is handled by the callback usually\n      }\n      var callbacks = _fetchingRules[auctionId] || [];\n      delete _fetchingRules[auctionId];\n      for (var i = 0; i < callbacks.length; i++) {\n        try { callbacks[i](rules); } catch (e) { /* ignore */ }\n      }\n    }\n  }\n\n  /**\n   * After fetching rules, recalculate the min bid for a card and update\n   * the input field and stored data attribute.\n   */\n  function updateCardMinBid(cardInfo, wkWidget, auctionId) {\n    // STRICT API ENFORCEMENT:\n    // Do not calculate min bid until we have the rules.\n    // If we don't have rules, fetch them and abort this update (the fetch callback will retry).\n    var rules = _biddingRulesCache[auctionId];\n    if (!rules) {\n      // Check if we are already fetching; if so, just wait\n      if (_fetchingRules && _fetchingRules[auctionId]) {\n        return;\n      }\n\n      var productUrl = getProductUrl(cardInfo);\n      if (productUrl && productUrl !== '#') {\n        console.log('[BCO Strict] Rules missing for ' + auctionId + ', fetching before update...');\n        fetchBiddingRulesForCard(productUrl, auctionId, function (fetchedRules) {\n          if (fetchedRules) {\n            // Recursive retry once rules are loaded\n            updateCardMinBid(cardInfo, wkWidget, auctionId);\n          }\n        });\n        return; // ABORT UPDATE until rules arrive\n      }\n    }\n\n    var newMin = getMinNextBid(wkWidget, auctionId, cardInfo);\n\n    // Safety check: if getMinNextBid returns a +1 fallback despite us trying to wait,\n    // verify if it matches the API expectation if possible. \n    // But generally, at this point, if rules exist, getMinNextBid uses them.\n\n    var productPid = cardInfo.getAttribute('data-product-id');\n    var curBidRaw3 = cardInfo.getAttribute('data-current-bid') || '0';\n    // VSOT sync: block if it lowers the bid\n    safeBidWrite(productPid, function () {\n      cardInfo.setAttribute('data-min-bid', String(newMin));\n\n      // Scope the input selector carefully\n      var input = cardInfo.querySelector('.auction-card-info__input');\n      if (input) {\n        var currentVal = parseFloat(input.value) || 0;\n        // Update if:\n        // 1. Current value is less than new min\n        // 2. Current value matches the old min\n        // 3. Current value is the simple fallback \"1\"\n        // 4. Current value is 161 (known bad value) but newMin is 162\n        if (!isUserEditing(input) && (currentVal < newMin || currentVal === 1)) {  // only reset if BELOW minimum (not equal)\n          input.value = newMin.toFixed(0);\n        }\n        input.min = String(newMin);\n      }\n    });\n  }\n\n  /**\n   * Find the product URL for a card.\n   */\n  function getProductUrl(cardInfo) {\n    const card = cardInfo.closest('li, .product-card, product-card, .grid__item');\n    if (!card) return '#';\n    const link = card.querySelector('a[href*=\"/products/\"]');\n    return link ? link.href : '#';\n  }\n\n  /**\n   * Update all visible card elements after a successful bid.\n   * Uses server response data when available, falls back to client-side estimates.\n   * @param {Element} cardInfo - The .auction-card-info element\n   * @param {string|number} bidAmount - The bid amount submitted\n   * @param {Object} [apiRes] - Optional API response with current_bid, bid_count, min_bid_amount\n   * @param {boolean} [isProxyBid=false] - If this was a proxy bid\n   * @param {boolean} [assumedWin=true] - If we believe we won this bid\n   */\n  function refreshCardAfterBid(cardInfo, bidAmount, apiRes, isProxyBid, assumedWin) {\n    var amount = parseFloat(bidAmount);\n    var bidCount = apiRes && apiRes.bid_count != null ? parseInt(apiRes.bid_count) : null;\n\n    // Keep proxy amount visible in the input box for the winning bidder\n    if (isProxyBid && assumedWin !== false) {\n      var inputEl = cardInfo.querySelector('.auction-card-info__input');\n      if (inputEl) {\n        inputEl.value = amount.toFixed(0);\n        inputEl.dataset.userProxyMax = amount.toFixed(0); // Mark it so safeInitialBid doesn't erase it\n      }\n    }\n\n    // \u2500\u2500 Post-bid authority: let the SERVER tell us the real values \u2500\u2500\n    // DO NOT write apiRes.current_bid to the card display \u2014 for proxy bids,\n    // apiRes.current_bid is often the proxy MAXIMUM ($50) rather than the\n    // actual visible bid ($26). Instead, poll the biddingform API which\n    // returns the correct server-authoritative visible bid.\n    var refreshPid = cardInfo.getAttribute('data-product-id');\n    if (refreshPid) {\n      // Reset _bfFirstRunDone so the next API poll does an UNCONDITIONAL write.\n      _bfFirstRunDone[refreshPid] = false;\n      // Set a cooldown so WebSocket updates don't overwrite the API poll result\n      _postBidCooldown[refreshPid] = Date.now();\n\n      // Staggered polls: 0ms (INSTANT response), 2s (catch proxy processing), 5s (final confirm)\n      if (typeof window._bcoBiddingformPoll === 'function') {\n        console.log('[BCO BidFlow] Triggering staggered polls for', refreshPid);\n        setTimeout(function () { window._bcoBiddingformPoll(refreshPid); }, 0);\n        setTimeout(function () { window._bcoBiddingformPoll(refreshPid); }, 2000);\n        setTimeout(function () { window._bcoBiddingformPoll(refreshPid); }, 5000);\n      }\n      // v86 FIX: Also trigger bulk poll to re-fetch fresh timer HTML with\n      // extended end time (popcorn behavior). The show_auction_on_category\n      // endpoint returns updated timer data after Webkul extends the auction.\n      if (typeof window.bcoDoPoll === 'function') {\n        console.log('[BCO BidFlow] Triggering bulk poll for timer refresh (popcorn)');\n        setTimeout(function () { window.bcoDoPoll(); }, 1000);\n        setTimeout(function () { window.bcoDoPoll(); }, 4000);\n      }\n    }\n\n    // \u2500\u2500 Pre-animation: Update the visible price display \u2500\u2500\n    // This satisfies the requirement that \"current bid\" updates before popcorn.\n    var priceDisplay = cardInfo.querySelector('.auction-card-info__current-bid');\n    if (priceDisplay) {\n      var displayAmount = amount;\n      if (isProxyBid && apiRes && apiRes.current_bid) {\n        // For proxy, use the visible bid from the API if available, \n        // or fall back to the min_bid_amount which is usually the new visible price.\n        displayAmount = parseFloat(apiRes.current_bid) || parseFloat(apiRes.min_bid_amount) || amount;\n      }\n      \n      // Format as currency (USD XXX.XX)\n      if (!isNaN(displayAmount)) {\n        priceDisplay.textContent = 'USD ' + displayAmount.toLocaleString(undefined, {\n          minimumFractionDigits: 2,\n          maximumFractionDigits: 2\n        });\n      }\n    }\n\n    // If apiRes provides min_bid_amount, cache it for use until the poll arrives\n    if (apiRes) {\n      var min_bid = apiRes.min_bid_amount || 0;\n      var current_bid = apiRes.current_bid || 0;\n      var step = 2; // Default\n\n      // Calculate step from min_bid and current_bid if possible\n      if (parseFloat(min_bid) > parseFloat(current_bid)) {\n        step = parseFloat(min_bid) - parseFloat(current_bid);\n      }\n\n      // Only perform safeInitialBid if we didn't just lock a proxy max\n      if (!(isProxyBid && assumedWin !== false)) {\n        // v86: Pass bid count from DOM to correctly handle 0-bid vs has-bids scenarios\n        var postBidCount = parseInt((cardInfo.querySelector('.auction-card-info__bid-count') || {}).textContent) || 1;\n        safeInitialBid(cardInfo, current_bid, min_bid, step, postBidCount);\n      }\n    }\n\n    // \u2500\u2500 1. Bid Count (safe to update immediately) \u2500\u2500\n    var bidCountEl = cardInfo.querySelector('.auction-card-info__bid-count');\n    var prevBidCount = 0;\n    if (bidCountEl) {\n      prevBidCount = parseInt(bidCountEl.textContent) || 0;\n      var count;\n      if (bidCount !== null) {\n        count = bidCount;\n      } else {\n        count = prevBidCount + 1;\n      }\n      bidCountEl.textContent = count + (count === 1 ? ' bid' : ' bids');\n    }\n\n    // \u2500\u2500 2. Status badge \u2014 context-aware \u2500\u2500\n    // v73: SKIP status update if this is the MAIN PDP PRODUCT.\n    var isMainPdpProduct = false;\n    if (window.location.pathname.includes('/products/')) {\n      var mainWidget = document.querySelector('#wk-auction');\n      if (mainWidget) {\n        var mainPid = mainWidget.getAttribute('prod-id') || mainWidget.getAttribute('data-product-id');\n        var cardPid = cardInfo.getAttribute('data-product-id');\n        if (mainPid && cardPid && String(mainPid) === String(cardPid)) {\n          isMainPdpProduct = true;\n        }\n      }\n    }\n\n    var statusEl = cardInfo.querySelector('.auction-card-info__status');\n    if (statusEl && !isMainPdpProduct) {\n      if (prevBidCount === 0) {\n        statusEl.textContent = '\u2705 Bid Placed';\n      } else {\n        statusEl.textContent = '\uD83C\uDFC6 Highest Bidder';\n      }\n      statusEl.classList.remove('is-outbid');\n      statusEl.classList.add('is-winning');\n    }\n\n    // \u2500\u2500 3. Update In-Memory Cache (No Storage) \u2500\u2500\n    const prodIdForCache = cardInfo.getAttribute('data-product-id');\n    if (prodIdForCache) {\n      _participationByProductId[prodIdForCache] = true;\n    }\n\n    // \u2500\u2500 INSTANT PDP UPDATE (v89) \u2500\u2500\n    if (false && isMainPdpProduct && typeof renderPdpState === 'function') { // v90: DISABLED\n       var pCurrentBid = apiRes && apiRes.current_bid ? parseFloat(apiRes.current_bid) : amount;\n       var pMinBid = apiRes && apiRes.min_bid_amount ? parseFloat(apiRes.min_bid_amount) : (amount + 1);\n       var pHighestName = apiRes && apiRes.highestBidderName ? apiRes.highestBidderName : '';\n       \n       renderPdpState({\n          productId: cardInfo.getAttribute('data-product-id'),\n          currentBid: pCurrentBid,\n          bidCount: bidCount !== null ? bidCount : (prevBidCount + (apiRes ? 0 : 1)),\n          minBid: pMinBid,\n          isWinning: assumedWin,\n          hasParticipated: true,\n          highestBidderName: pHighestName\n       });\n    }\n\n    // \u2500\u2500 4. Popcorn animation \u2500\u2500\n    // Use a small timeout to ensure the DOM has finished painting the new bid value\n    setTimeout(function() {\n      // 1-minute extension check: if time left is < 2 mins, we know an extension will occur\n      // (or has occurred). We can pass this state to the animation if we want special FX.\n      var timeLeftEl = cardInfo.querySelector('.auction-card-info__time-left');\n      var isLastMinute = false;\n      if (timeLeftEl) {\n        var txt = timeLeftEl.textContent || \"\";\n        var match = txt.match(/(\\d+)m\\s*(\\d+)s/);\n        if (match) {\n          var mins = parseInt(match[1]);\n          if (mins < 2) isLastMinute = true;\n        } else if (txt.includes('s') && !txt.includes('m') && !txt.includes('h')) {\n          isLastMinute = true; // Only seconds left\n        }\n      }\n\n      if (typeof triggerPopcornAnimation === 'function') {\n        triggerPopcornAnimation(cardInfo, isLastMinute);\n      } else {\n        // Fallback to flash if popcorn function fails to load\n        cardInfo.classList.add('auction-card-info--bid-success');\n        setTimeout(function () {\n          cardInfo.classList.remove('auction-card-info--bid-success');\n        }, 1200);\n      }\n\n      // \u2500\u2500 5. Client-side Timer Highlight (UX Enhancement) \u2500\u2500\n      // v85: Removed static \"01M 59S\" nudge to maintain accuracy with Webkul Admin settings.\n      // Instead, we highlight the timer in Pink/Gold to signify the \"Extension Mode\" is active.\n      // The real extended time will be fetched from the server via the aggressive 500ms poll below.\n      if (isLastMinute && timeLeftEl) {\n         timeLeftEl.style.color = '#ff4fd1'; // Highlight the expected extension\n         timeLeftEl.style.fontWeight = '700';\n         setTimeout(function() {\n            timeLeftEl.style.color = ''; // Revert after animation to show server value\n            timeLeftEl.style.fontWeight = '';\n         }, 3000);\n      }\n    }, 100);\n  }\n\n  /**\n   * Map Webkul error codes to user-friendly messages.\n   */\n  function friendlyBidError(res) {\n    var msg = res.msg || res.message || res.error || '';\n    if (msg === 'invalid_bid' || msg === 'bid_already_placed') {\n      return 'You are already the highest bidder!';\n    }\n    if (msg === 'bid_too_low' || msg === 'low_bid') {\n      var min = res.min_bid_amount ? (' Minimum: $' + res.min_bid_amount) : '';\n      return 'Bid too low.' + min;\n    }\n    if (msg === 'auction_ended' || msg === 'expired') {\n      return 'This auction has ended.';\n    }\n    if (msg === 'login_required' || msg === 'not_logged_in') {\n      return 'Please log in to place a bid.';\n    }\n    // Fall back to the raw message, cleaned up\n    return msg.replace(/_/g, ' ') || 'Bid failed \u2014 please try again.';\n  }\n\n\n  /**\n   * After a successful bid, sync the DOM so the guard blocks repeat bids.\n   * Adds .customer_highest_bidder to the Webkul widget and updates our status element.\n   */\n  function markCardAsWinning(cardInfo) {\n    var gridItem = cardInfo.closest('li, .product-card, product-card, .grid__item');\n    if (!gridItem) return;\n    var wkWidget = gridItem.querySelector('.wk-category-auction');\n    if (wkWidget) {\n      // Add .customer_highest_bidder if not already present\n      if (!wkWidget.querySelector('.customer_highest_bidder')) {\n        var marker = document.createElement('span');\n        marker.className = 'customer_highest_bidder';\n        marker.style.display = 'none';\n        wkWidget.appendChild(marker);\n      }\n      // Remove outbid marker if present\n      var outbidMarker = wkWidget.querySelector('.customer_participated');\n      if (outbidMarker) outbidMarker.remove();\n    }\n    // Update our status element\n    // v73: SKIP if Main PDP Product\n    var isMainPdpProduct = false;\n    if (window.location.pathname.includes('/products/')) {\n      var mainWidget = document.querySelector('#wk-auction');\n      if (mainWidget) {\n        var mainPid = mainWidget.getAttribute('prod-id') || mainWidget.getAttribute('data-product-id');\n        var cardPid = cardInfo.getAttribute('data-product-id');\n        if (mainPid && cardPid && String(mainPid) === String(cardPid)) isMainPdpProduct = true;\n      }\n    }\n\n    var statusEl = cardInfo.querySelector('.auction-card-info__status');\n    if (statusEl && !isMainPdpProduct) {\n      statusEl.textContent = '\uD83C\uDFC6 Winning';\n      statusEl.classList.add('is-winning');\n      statusEl.classList.remove('is-outbid');\n    }\n  }\n\n  // _myLastBid: tracks the last successful bid amount per auction for this user.\n  // Used to detect genuine outbids: if the bid amount goes ABOVE our last bid\n  // AND .customer_highest_bidder is absent, someone else outbid us.\n  // If the bid amount hasn't changed, a missing .customer_highest_bidder is\n  // just an unreliable API response \u2014 don't flip to Outbid.\n  var _myLastBid = {};\n  var _hasParticipated = {}; // Tracks participation per auction to persist \"Outbid\" status\n\n\n  /**\n   * Submit a bid via Webkul's spcObj API.\n   * Webkul expects a JSONP GET request with callback \"persistbid\".\n   */\n  function submitBid(auctionId, bidAmount, custId, cardInfo) {\n    // Refresh custId to ensure it hasn't changed since hydration\n    var freshCustId = resolveCurrentCustId() || custId;\n    console.log('[BCO BidFlow] submitBid called: auction=' + auctionId + ' amount=' + bidAmount + ' cust=' + freshCustId);\n    var submitBtn = cardInfo.querySelector('.auction-card-info__button--submit');\n    var feedbackEl = cardInfo.querySelector('.auction-card-info__feedback');\n\n    // \u2500\u2500 WINNING-STATE GUARD \u2500\u2500\n    // Allow rebid only if user is raising their proxy max above the current next minimum.\n    var statusEl2 = cardInfo.querySelector('.auction-card-info__status');\n    var isCurrentlyWinning = statusEl2 && statusEl2.classList.contains('is-winning');\n    if (isCurrentlyWinning) {\n      var guardMin = parseFloat(cardInfo.getAttribute('data-min-bid')) || 0;\n      var guardSubmit = parseFloat(bidAmount);\n      if (!(guardMin > 0 && guardSubmit > guardMin)) {\n        showFeedback(feedbackEl, 'info', 'You are already the highest bidder!');\n        resetSubmitBtn(submitBtn);\n        return;\n      }\n      console.log('[BCO BidFlow] Winning user raising proxy max: ' + guardSubmit + ' > ' + guardMin);\n    }\n\n    // Show loading state\n    if (submitBtn) {\n      submitBtn.classList.add('is-loading');\n      submitBtn.textContent = 'Placing...';\n    }\n\n    // Validate spcObj exists\n    if (typeof spcObj === 'undefined' || !spcObj.api_url) {\n      showFeedback(feedbackEl, 'error', 'Auction system unavailable');\n      resetSubmitBtn(submitBtn);\n      return;\n    }\n\n    var bidData = {\n      cust_id: freshCustId,\n      auction_id: auctionId,\n      prod_quantity: 1,\n      is_public: 1,\n      shop_name: spcObj.shop_name || '',\n      timediff: spcObj.timediff || 0,\n      // v86 FIX: Popcorn extension params \u2014 PDP's native form includes these\n      // hidden fields. Without them, Webkul's server doesn't trigger the\n      // anti-sniping time extension on last-minute bids.\n      popcorn_bidding: '1',\n      normal_as_proxy: '1',\n      normal_as_proxy_config: '1'\n    };\n\n    // \u2500\u2500 PROXY / STANDARD BID ROUTING \u2500\u2500\n    // Amount > current minimum => PROXY BID via saveproxybid (same as PDP).\n    // Amount == minimum => STANDARD BID via persistbid.\n    // The old \"sww\" error was caused by missing general_config/auction_config/theme_colors.\n    // We now include all spcObj config fields to match the PDP request exactly.\n    var submittedAmount = parseFloat(bidAmount);\n    var cardMinBid = parseFloat(cardInfo.getAttribute('data-min-bid')) || 0;\n    // FIX: If data-min-bid isn't set, try the input's min attribute.\n    if (!cardMinBid) {\n      var bidInputEl = cardInfo.querySelector('.auction-card-info__input');\n      if (bidInputEl) cardMinBid = parseFloat(bidInputEl.min) || 0;\n    }\n    if (!cardMinBid) cardMinBid = parseFloat(cardInfo.getAttribute('data-current-bid')) || 0;\n    // FIX: Use Math.ceil on cardMinBid \u2014 safeInitialBid stores the raw nextBid\n    // (e.g. 2.5) in data-min-bid, but the input displays ceil'd values (3).\n    // Without ceil, submittedAmount (3) > cardMinBid (2.5) = true \u2192 proxy.\n    var ceilMinBid = Math.ceil(cardMinBid);\n    var isDynamicProxy = ceilMinBid > 0 && submittedAmount > ceilMinBid;\n    console.log('[BCO BidFlow] Routing: submitted=' + submittedAmount + ' data-min-bid=' + cardMinBid + ' ceil=' + ceilMinBid + ' isProxy=' + isDynamicProxy);\n\n    // Normalise URL \u2014 strip trailing slash to avoid double-slash\n    var apiBase = spcObj.api_url.replace(/\\/+$/, '');\n\n    // v86 FIX: Fire the 'popcornbid' JSONP call BEFORE the actual bid.\n    // PDP sends TWO sequential requests: first 'popcornbid' (triggers the\n    // server-side anti-sniping time extension), then 'persistbid'/'saveproxybid'.\n    // Without this call, the server doesn't extend the auction on last-minute bids.\n    jQuery.ajax({\n      url: apiBase + '/index.php?p=wk_ajax_process',\n      type: 'GET',\n      dataType: 'jsonp',\n      jsonpCallback: 'popcornbid',\n      cache: false,\n      timeout: 8000,\n      data: {\n        cust_id: freshCustId,\n        is_public: 1,\n        shop_name: spcObj.shop_name || '',\n        bid_amount: submittedAmount,\n        auction_id: auctionId,\n        customer_card_exists: '0'\n      },\n      success: function (r) { console.log('[BCO Popcorn] Response:', r); },\n      error: function () { console.log('[BCO Popcorn] fire-and-forget (expected for JSONP)'); }\n    });\n\n    if (isDynamicProxy) {\n      var proxyData = {\n        cust_id: freshCustId,\n        auction_id: auctionId,\n        proxy_bid_amount: submittedAmount,\n        bid_type: 'proxy',\n        prod_quantity: 1,\n        is_public: 1,\n        shop_name: spcObj.shop_name || '',\n        timediff: spcObj.timediff || 0,\n        // v86 FIX: Popcorn extension for proxy bids \u2014 PDP's native proxy form\n        // includes proxy_popcorn_bidding=1 to trigger time extension.\n        proxy_popcorn_bidding: '1'\n      };\n      if (spcObj.general_config) proxyData.general_config = spcObj.general_config;\n      if (spcObj.auction_config) proxyData.auction_config = spcObj.auction_config;\n      if (spcObj.theme_colors)   proxyData.theme_colors   = spcObj.theme_colors;\n      console.log('[BCO BidFlow] Proxy bid (saveproxybid): amount=' + submittedAmount + ' min=' + cardMinBid);\n\n      jQuery.ajax({\n        url: apiBase + '/index.php?p=wk_ajax_process',\n        type: 'GET',\n        dataType: 'jsonp',\n        jsonpCallback: 'saveproxybid',\n        cache: false,\n        timeout: 15000,\n        data: proxyData,\n        success: function (response) {\n          console.log('[BCO Proxy] Response:', response);\n          var res;\n          try { res = typeof response === 'string' ? JSON.parse(response) : response; }\n          catch (e) { res = {}; }\n          var isOk = (res.msg === 'success' || res.status === 'success' || res.status === true || res.success === true);\n          showFeedback(feedbackEl, isOk ? 'success' : 'info', 'Proxy max set! Bidding for you automatically.');\n          // ALWAYS mark winning after proxy bid \u2014 Webkul's JSONP response is\n          // unreliable for determining success (non-standard formats cause\n          // false negatives). If we reached the callback, the bid was sent.\n          if (typeof markCardAsWinning === 'function') markCardAsWinning(cardInfo);\n          // Call refreshCardAfterBid to schedule server polls + update input\n          refreshCardAfterBid(cardInfo, submittedAmount, null, true /* isProxyBid */, true /* assumedWin */);\n          // Track participation (matches standard bid path)\n          _myLastBid[auctionId] = submittedAmount;\n          _hasParticipated[auctionId] = true;\n          // Broadcast to other tabs\n          try {\n            var bc = new BroadcastChannel('bco-bid-sync');\n            bc.postMessage({\n              auction_id: auctionId,\n              highest_bidder_Id: freshCustId,\n              source: 'self-proxy'\n            });\n            bc.close();\n          } catch (e) { /* BroadcastChannel not supported */ }\n          // v8 UX: Reset button immediately \u2014 no need to wait for poll\n          resetSubmitBtn(submitBtn);\n          var pid = cardInfo.getAttribute('data-product-id');\n          if (pid && typeof window._bcoBiddingformPoll === 'function') {\n            _bfFirstRunDone[pid] = false;\n            _postBidCooldown[pid] = Date.now();\n            setTimeout(function () { window._bcoBiddingformPoll(pid); }, 500);\n          }\n        },\n        error: function (xhr, status) {\n          console.error('[BCO Proxy] Error:', status);\n          // parseerror = server sent non-JSONP; bid may still have succeeded\n          showFeedback(feedbackEl, 'info', 'Proxy set \u2014 verifying...');\n          // ALWAYS mark winning \u2014 if we reached the callback, the bid was sent\n          if (typeof markCardAsWinning === 'function') markCardAsWinning(cardInfo);\n          refreshCardAfterBid(cardInfo, submittedAmount, null, true /* isProxyBid */, true /* assumedWin */);\n          _myLastBid[auctionId] = submittedAmount;\n          _hasParticipated[auctionId] = true;\n          // v8 UX: Reset button immediately \u2014 no need to wait for poll\n          resetSubmitBtn(submitBtn);\n          var pidErr = cardInfo.getAttribute('data-product-id');\n          if (pidErr && typeof window._bcoBiddingformPoll === 'function') {\n            _bfFirstRunDone[pidErr] = false;\n            _postBidCooldown[pidErr] = Date.now();\n            setTimeout(function () { window._bcoBiddingformPoll(pidErr); }, 500);\n          }\n        }\n      });\n      return; // skip persistbid block below\n    }\n\n    // Standard bid (amount == minimum)\n    bidData.bid_amount = submittedAmount;\n    console.log('[BCO BidFlow] Standard bid (persistbid): ' + submittedAmount);\n\n    // Safety: always reset button after 5s \u2014 guards against JSONP callback conflicts\n    // with Webkul's own use of the 'persistbid' callback name (polling etc.).\n    var _stdBidDone = false;\n    function _handleStdBidDone() {\n      if (_stdBidDone) return;\n      _stdBidDone = true;\n      clearTimeout(_stdBidSafetyTimer);\n    }\n    var _stdBidSafetyTimer = setTimeout(function () {\n      console.warn('[BCO Bid] Safety timeout \u2014 resetting button');\n      _handleStdBidDone();\n      resetSubmitBtn(submitBtn);\n      // Also show a fallback message since the callback never fired\n      showFeedback(feedbackEl, 'info', 'Bid submitted \u2014 refreshing status...');\n      var toPid = cardInfo.getAttribute('data-product-id');\n      if (toPid && typeof window._bcoBiddingformPoll === 'function') {\n        _bfFirstRunDone[toPid] = false;\n        _postBidCooldown[toPid] = Date.now();\n        setTimeout(function () { window._bcoBiddingformPoll(toPid); }, 500);\n      }\n    }, 5000);\n\n    // Normalise URL \u2014 strip trailing slash to avoid double-slash\n    var apiBase = spcObj.api_url.replace(/\\/+$/, '');\n\n    jQuery.ajax({\n      url: apiBase + '/index.php?p=wk_ajax_process',\n      type: 'GET',\n      dataType: 'jsonp',\n      jsonpCallback: 'persistbid',\n      cache: false,\n      timeout: 8000,\n      data: bidData,\n      success: function (response) {\n        // Log the raw response for debugging\n        console.log('[BCO submitBid] Raw API response:', response);\n\n        var res;\n        try {\n          res = typeof response === 'string' ? JSON.parse(response) : response;\n        } catch (parseErr) {\n          console.error('[BCO submitBid] JSON parse error:', parseErr);\n          // JSONP responses that can't be parsed \u2014 bid may have succeeded\n          showFeedback(feedbackEl, 'info', 'Bid submitted \u2014 refreshing status...');\n          // Still try to refresh from server\n          var fallbackPid = cardInfo.getAttribute('data-product-id');\n          if (fallbackPid && typeof window._bcoBiddingformPoll === 'function') {\n            _bfFirstRunDone[fallbackPid] = false;\n            _postBidCooldown[fallbackPid] = Date.now();\n            setTimeout(function () { window._bcoBiddingformPoll(fallbackPid); }, 500);\n          }\n          resetSubmitBtn(submitBtn);\n          return;\n        }\n\n        console.log('[BCO submitBid] Parsed response:', JSON.stringify(res));\n\n        // Determine if bid was successful \u2014 check various Webkul response formats\n        var isSuccess = (\n          res.msg === 'success' ||\n          res.status === 'success' ||\n          res.status === true ||\n          res.result === 'success' ||\n          res.success === true ||\n          res.code === 200 ||\n          // Webkul sometimes returns just { current_bid: X, bid_count: Y } on success\n          (res.current_bid && !res.msg && !res.error)\n        );\n\n        var isInvalidBid = (res.msg === 'invalid_bid' || res.error === 'invalid_bid');\n\n        if (isSuccess) {\n          console.log('[BCO BidFlow] Bid success handler triggered');\n\n          // Determine if we actually won, or if an existing proxy instantly outbid us\n          var assumedWin = true;\n          // Use parseBidAmount to handle formats like \"$ 14.00\"\n          var serverCurrentBid = res.current_bid ? parseBidAmount(res.current_bid) : 0;\n          if (serverCurrentBid && serverCurrentBid > submittedAmount) {\n            assumedWin = false; // The server's new visible bid is higher than our max!\n            console.log('[BCO BidFlow] Instantly outbid by proxy. Server current_bid: ' + serverCurrentBid + ' > our bid: ' + submittedAmount);\n          }\n\n          var prevCount = 0;\n          var bcEl = cardInfo.querySelector('.auction-card-info__bid-count');\n          if (bcEl) prevCount = parseInt(bcEl.textContent) || 0;\n\n          var successMsg;\n          if (!assumedWin) {\n            successMsg = '\u26A0\uFE0F Outbid by proxy limit!';\n          } else {\n            successMsg = prevCount === 0 ? '\u2705 Bid placed!' : '\uD83C\uDFC6 You\\'re now the highest bidder!';\n          }\n\n          showFeedback(feedbackEl, assumedWin ? 'success' : 'error', successMsg);\n\n          // Post-bid updates \u2014 run outside try/catch so errors don't show wrong message\n          try {\n            refreshCardAfterBid(cardInfo, submittedAmount, res, false /* standard bid */, assumedWin);\n\n            if (assumedWin) {\n              markCardAsWinning(cardInfo);\n            } else {\n              // Immediately remove winning status if we were instantly outbid\n              var statusElOutbid = cardInfo.querySelector('.auction-card-info__status');\n              if (statusElOutbid) {\n                statusElOutbid.textContent = '\u274C Outbid';\n                statusElOutbid.classList.remove('is-winning');\n                statusElOutbid.classList.add('is-outbid');\n              }\n              // Also trigger a fast poll to get the new correct min bid\n              if (typeof window.bcoDoPoll === 'function') window.bcoDoPoll();\n            }\n          } catch (uiErr) {\n            console.warn('[BCO BidFlow] Post-bid UI update error (bid still succeeded):', uiErr);\n          }\n\n          _myLastBid[auctionId] = submittedAmount;\n          _hasParticipated[auctionId] = true;\n          // Broadcast to other tabs in the same browser\n          try {\n            var bc = new BroadcastChannel('bco-bid-sync');\n            bc.postMessage({\n              auction_id: auctionId,\n              current_bid: res.current_bid || bidAmount,\n              bid_count: res.bid_count,\n              highest_bidder_Id: freshCustId,\n              min_bid_amount: res.min_bid_amount || bidAmount,\n              currency: res.currency || 'USD',\n              rules: _biddingRulesCache[auctionId],\n              source: 'self'\n            });\n            bc.close();\n          } catch (e) { /* BroadcastChannel not supported */ }\n        } else if (isInvalidBid) {\n          console.log('[BCO BidFlow] Bid invalid:', res);\n          var statusEl = cardInfo.querySelector('.auction-card-info__status');\n          var actuallyWinning = statusEl && statusEl.classList.contains('is-winning');\n          if (actuallyWinning) {\n            showFeedback(feedbackEl, 'info', 'You are already the highest bidder!');\n            // v80: Also show PDP-level feedback so it's visible on the product page\n            showPdpFeedback('info', 'You are already the highest bidder!');\n          } else {\n            showFeedback(feedbackEl, 'error', 'Bid too low or invalid. Updating...');\n            // v80: Also show PDP-level feedback\n            showPdpFeedback('error', 'Bid too low or invalid. Please try a higher amount.');\n            // Force an immediate poll to get the new price\n            if (typeof window.bcoDoPoll === 'function') window.bcoDoPoll();\n\n            // Force a refresh of this specific card to fix blank inputs\n            var gridItem3 = cardInfo.closest('li, .product-card, product-card, .grid__item');\n            var wkWidget3 = gridItem3 ? gridItem3.querySelector('.wk-category-auction') : null;\n            updateCardMinBid(cardInfo, wkWidget3, auctionId);\n          }\n        } else {\n          // Unknown response format \u2014 log it but also try a server refresh\n          console.warn('[BCO BidFlow] Unknown response format:', res);\n          showFeedback(feedbackEl, 'info', 'Bid submitted \u2014 verifying...');\n          // Try to refresh from server in case bid actually succeeded\n          var unknownPid = cardInfo.getAttribute('data-product-id');\n          if (unknownPid && typeof window._bcoBiddingformPoll === 'function') {\n            _bfFirstRunDone[unknownPid] = false;\n            _postBidCooldown[unknownPid] = Date.now();\n            setTimeout(function () { window._bcoBiddingformPoll(unknownPid); }, 500);\n          }\n        }\n        _handleStdBidDone();\n        resetSubmitBtn(submitBtn);\n      },\n      error: function (xhr, status, error) {\n        console.error('[BCO submitBid] AJAX error:', status, error);\n        if (status === 'parsererror') {\n          showFeedback(feedbackEl, 'error', 'Bid may not have saved \u2014 please refresh and check');\n        } else {\n          showFeedback(feedbackEl, 'error', 'Network error \u2014 please try again');\n        }\n        _handleStdBidDone();\n        resetSubmitBtn(submitBtn);\n      }\n    });\n  }\n\n  function showFeedback(el, type, message) {\n    if (!el) {\n      console.warn('[BCO BidFlow] showFeedback called with null element for:', message);\n      return;\n    }\n    console.log('[BCO BidFlow] showFeedback:', type, message);\n    el.textContent = message;\n    el.className = 'auction-card-info__feedback is-' + type;\n    el.style.display = 'block';\n    // Longer display for success (6s) so users see confirmation after rebid\n    var hideDelay = type === 'success' ? 6000 : 5000;\n    setTimeout(() => {\n      el.style.display = 'none';\n    }, hideDelay);\n  }\n\n  /**\n   * v80: Show feedback directly on the PDP #wk-auction widget.\n   * Used when submitBid gets an invalid_bid response but the card-level\n   * feedback element is not visible on PDP (it belongs to the inline card widget).\n   */\n  function showPdpFeedback(type, message) {\n    // v90: DISABLED \u2014 Let Webkul handle its own PDP notifications.\n    return;\n    // Remove any existing PDP feedback\n    var old = pdpWidget.querySelector('.bco-pdp-bid-feedback');\n    if (old) old.remove();\n    var fb = document.createElement('div');\n    fb.className = 'bco-pdp-bid-feedback';\n    var bgColor = type === 'info' ? 'rgba(0,180,216,0.15)' : 'rgba(220,38,38,0.15)';\n    var txtColor = type === 'info' ? '#00b4d8' : '#dc2626';\n    var borderColor = type === 'info' ? 'rgba(0,180,216,0.3)' : 'rgba(220,38,38,0.3)';\n    fb.style.cssText = 'padding:12px 16px;margin:12px 0;border-radius:10px;font-weight:600;' +\n      'text-align:center;font-size:15px;line-height:1.4;' +\n      'background:' + bgColor + ';color:' + txtColor + ';' +\n      'border:1px solid ' + borderColor + ';display:block;z-index:10;position:relative;';\n    fb.textContent = (type === 'info' ? '\uD83C\uDFC6 ' : '\u26A0\uFE0F ') + message;\n    // Insert at the top of the widget\n    pdpWidget.prepend(fb);\n    setTimeout(function () { fb.remove(); }, 6000);\n  }\n\n  /**\n   * v80: Auto-dismiss Webkul's native PDP success/error notifications.\n   * Webkul shows a sticky alert with a cross icon after bid submission.\n   * This runs periodically to catch and auto-hide those notifications.\n   */\n  function dismissWebkulNativeNotifications() {\n    // v90: Re-enabled \u2014 only hides stale notification alerts, doesn't restructure DOM.\n    var selectors = [\n      '#wk-auction .pa-alert',\n      '#wk-auction .wk-alert',\n      '#wk-auction .pa-success',\n      '#wk-auction .pa-error',\n      '#wk-auction [class*=\"success-msg\"]',\n      '#wk-auction [class*=\"alert-success\"]',\n      '#wk-auction [class*=\"error-msg\"]',\n      '#wk-auction [class*=\"alert-danger\"]',\n      '#wk-auction [class*=\"flash-message\"]',\n      '#wk-auction [class*=\"wk-message\"]',\n      '#wk_notify_bid'\n    ];\n    var notifications = document.querySelectorAll(selectors.join(','));\n    notifications.forEach(function (n) {\n      // v81: Force-hide immediately \u2014 these are stale notifications from\n      // prior bids that Webkul persists via inline style=\"display:block\"\n      n.style.setProperty('display', 'none', 'important');\n    });\n    // v81: Also click the native close button if present\n    var closeBtn = document.querySelector('.wk_close_notify');\n    if (closeBtn && !closeBtn.hasAttribute('data-bco-dismiss')) {\n      closeBtn.setAttribute('data-bco-dismiss', 'true');\n      closeBtn.click();\n    }\n\n    // \u2500\u2500 NEW: Popcorn Trigger on PDP \u2500\u2500\n    // If we find a new success notification, trigger the animation on the main PDP widget\n    if (notifications.length > 0) {\n      notifications.forEach(function(n) {\n        if (!n.hasAttribute('data-popcorn-fired') && (n.classList.contains('pa-success') || n.innerText.toLowerCase().includes('success'))) {\n          n.setAttribute('data-popcorn-fired', 'true');\n          var pdpWidget = document.querySelector('#wk-auction');\n          if (pdpWidget && typeof triggerPopcornAnimation === 'function') {\n            // Check last minute for PDP too\n            var timerEl = pdpWidget.querySelector('.pa-timer');\n            var isLastMinute = false;\n            if (timerEl) {\n              var txt = timerEl.innerText || \"\";\n              if (txt.includes('00D 00H 01M') || (txt.includes('00D 00H 00M') && !txt.includes('Ended'))) {\n                isLastMinute = true;\n              }\n            }\n            triggerPopcornAnimation(pdpWidget, isLastMinute);\n\n            // \u2500\u2500 5. Client-side Timer Highlight (PDP) \u2500\u2500\n            if (isLastMinute && timerEl) {\n               timerEl.style.color = '#ff4fd1'; // Highlight expected extension\n               setTimeout(function() {\n                  timerEl.style.color = ''; \n               }, 3000);\n            }\n          }\n        }\n      });\n    }\n  }\n  // Run periodically to catch Webkul notifications injected after AJAX\n  // v84 PERF: Self-clearing \u2014 stops after 60s of no notifications. Re-starts on bid actions.\n  var _dismissMissCount = 0;\n  var _dismissTimer = setInterval(function () {\n    var found = document.querySelectorAll('.flash-message:not([style*=\"none\"]), [class*=\"flash-message\"]:not([style*=\"none\"]), #wk_notify_bid:not([style*=\"none\"])');\n    if (found.length === 0) {\n      _dismissMissCount++;\n      if (_dismissMissCount >= 60) { // 60 \u00D7 1s = 60 seconds of nothing\n        clearInterval(_dismissTimer);\n        return;\n      }\n    } else {\n      _dismissMissCount = 0;\n    }\n    dismissWebkulNativeNotifications();\n  }, 1000);\n  // Re-start the dismisser after a bid action\n  window._bcoRestartDismisser = function () {\n    _dismissMissCount = 0;\n    if (!_dismissTimer) {\n      _dismissTimer = setInterval(function () {\n        var found = document.querySelectorAll('.flash-message:not([style*=\"none\"]), [class*=\"flash-message\"]:not([style*=\"none\"])');\n        if (found.length === 0) {\n          _dismissMissCount++;\n          if (_dismissMissCount >= 60) { clearInterval(_dismissTimer); _dismissTimer = null; return; }\n        } else { _dismissMissCount = 0; }\n        dismissWebkulNativeNotifications();\n      }, 1000);\n    }\n  };\n\n  function resetSubmitBtn(btn) {\n    if (!btn) return;\n    btn.classList.remove('is-loading');\n    btn.textContent = 'Bid Now';\n    btn.style.pointerEvents = '';\n  }\n\n  /**\n   * Wire up all inline bid widgets on the page.\n   * Waits for Webkul to render its auction data, then hydrates our cards.\n   */\n  function setupBidWidgets() {\n    var hasAuctionCards = document.querySelector('.auction-card-info[data-auction-id]') ||\n      document.querySelector('.auction-card-info[data-auction-product-id]') ||\n      document.querySelector('.wk-category-auction[data-prod]') ||\n      document.querySelector('#wk-auction');\n    if (!hasAuctionCards) return;\n    const cards = document.querySelectorAll('.auction-card-info');\n    if (cards.length === 0) return;\n\n    const loggedIn = isCustomerLoggedIn();\n\n    cards.forEach(cardInfo => {\n      // Find the sibling Webkul widget\n      const gridItem = cardInfo.closest('li, .product-card, product-card, .grid__item');\n      const wkWidget = gridItem?.querySelector('.wk-category-auction');\n\n      // Always hydrate display fields (even on re-runs)\n      hydrateCardDisplay(cardInfo, wkWidget);\n\n      // Remove loading state\n      cardInfo.classList.remove('auction-card-info--loading');\n\n      // Only set up event handlers once\n      if (cardInfo.hasAttribute('data-bid-widget-ready')) return;\n      cardInfo.setAttribute('data-bid-widget-ready', 'true');\n\n      // \u2500\u2500 Normalize Attribute Names \u2500\u2500\n      // Some themes use data-auction-product-id instead of data-product-id\n      if (!cardInfo.hasAttribute('data-product-id') && cardInfo.hasAttribute('data-auction-product-id')) {\n        cardInfo.setAttribute('data-product-id', cardInfo.getAttribute('data-auction-product-id'));\n      }\n\n      // Extract auction data\n      // Critical fix: DO NOT artificially inject Product IDs into auctionId. If it's missing, it's null until server fills it.\n      const auctionId = cardInfo.getAttribute('data-auction-id') || getAuctionId(wkWidget);\n      const currentCustId = wkWidget?.getAttribute('cust-id') || resolveCurrentCustId();\n      const minBid = getMinNextBid(wkWidget, auctionId, cardInfo);\n      const productUrl = getProductUrl(cardInfo);\n\n      // Store on the element only if it's a real auction ID\n      if (auctionId) {\n        cardInfo.setAttribute('data-auction-id', auctionId);\n      }\n\n      replaceStepperSpanWithInput(cardInfo);\n      cardInfo.setAttribute('data-min-bid', String(minBid));\n\n      // Fetch the real bidding rules from the product page (async)\n      // This replaces the default $2 increment with whatever is configured\n      // in Webkul's admin. Once fetched, it updates the card's min bid.\n      if (auctionId && productUrl && productUrl !== '#') {\n        fetchBiddingRulesForCard(productUrl, auctionId, function () {\n          updateCardMinBid(cardInfo, wkWidget, auctionId);\n        });\n      }\n\n      // Auction state is determined by the server on each page load.\n      // No client-side caching of winning status.\n\n      // Get form elements\n      const bidForm = cardInfo.querySelector('.auction-card-info__bid-form');\n      const input = cardInfo.querySelector('.auction-card-info__input');\n      const minusBtn = cardInfo.querySelector('.auction-card-info__step-button--minus');\n      const plusBtn = cardInfo.querySelector('.auction-card-info__step-button--plus');\n      const submitBtn = cardInfo.querySelector('.auction-card-info__button--submit');\n\n      if (!bidForm || !input || !submitBtn) return;\n\n      // Set initial input value to min bid\n      input.value = minBid.toFixed(0);\n      input.min = String(minBid);\n      input.step = '1';\n\n      // \u2500\u2500 Track user interaction to prevent sync overwriting their input \u2500\u2500\n      input.addEventListener('focus', function () { markEditing(input); });\n      input.addEventListener('input', function () { markEditing(input); });\n      input.addEventListener('blur', function () {\n        // Delay clearing so +/- click (which blurs then re-focuses) doesn't reset\n        setTimeout(function () {\n          if (input !== document.activeElement) clearEditing(input);\n        }, 500);\n      });\n\n      // Add feedback element if missing\n      if (!cardInfo.querySelector('.auction-card-info__feedback')) {\n        const fb = document.createElement('div');\n        fb.className = 'auction-card-info__feedback';\n        fb.style.display = 'none';\n        bidForm.appendChild(fb);\n      }\n\n      // \u2500\u2500 Stepper logic \u2500\u2500\n      // Read minBid live from data attribute so it reflects dynamic rules\n      if (minusBtn) {\n        minusBtn.addEventListener('click', (e) => {\n          e.preventDefault();\n          e.stopPropagation();\n          markEditing(input);\n          const liveMin = parseFloat(cardInfo.getAttribute('data-min-bid')) || minBid;\n          const current = parseFloat(input.value) || liveMin;\n          const newVal = Math.max(liveMin, current - 1);\n          input.value = newVal.toFixed(0);\n        });\n      }\n\n      if (plusBtn) {\n        plusBtn.addEventListener('click', (e) => {\n          e.preventDefault();\n          e.stopPropagation();\n          markEditing(input);\n          const current = parseFloat(input.value) || minBid;\n          // Priority: server explicit min > locally calculated next min\n          var productId = cardInfo.getAttribute('data-product-id');\n          var nextVal = applyBiddingRules(current, auctionId, productId);\n\n          // Ensure we actually stepped up (applyBiddingRules can return current+rate)\n          // If rules are available, use the rate from the first rule as a fallback increment\n          var rules = _biddingRulesCache[auctionId] || _rulesByProductId[productId] || getGlobalDefaultRules();\n          if (nextVal <= current && rules && rules.length > 0) {\n            nextVal = current + (parseFloat(rules[0].rate) || 1);\n          }\n\n          // If there's a server-provided min_bid_amount (displayMin), use it if higher\n          // This `displayMin` variable is not available here, so we'll rely on `nextVal`\n          // and the `data-min-bid` attribute which is updated by `updateCardMinBid` or `refreshCardAfterBid`.\n          // For the stepper, we just want to ensure we step up by at least 1 or the rule's rate.\n          var finalMin = nextVal; // Simplified, as displayMin is not directly available here.\n          input.value = String(Math.ceil(finalMin));\n          // NOTE: stepper only changes proposed bid \u2014 do NOT update input.min or data-min-bid\n          // (those are server values set by polling; overwriting causes isDynamicProxy to fail)\n        });\n      }\n\n      // Enforce min on manual input\n      input.addEventListener('change', () => {\n        const liveMin = parseFloat(cardInfo.getAttribute('data-min-bid')) || minBid;\n        const val = parseFloat(input.value) || 0;\n        if (val < liveMin) {\n          input.value = liveMin.toFixed(0);\n        }\n      });\n\n      // \u2500\u2500 Submit logic \u2500\u2500\n      submitBtn.addEventListener('click', (e) => {\n        e.preventDefault();\n        e.stopPropagation();\n        e.stopImmediatePropagation();\n\n        // \u2500\u2500 WINNING-STATE CHECK \u2500\u2500\n        // v80: Block rebidding on grid cards (home/auction). Proxy bidding is PDP-only.\n        var statusEl = cardInfo.querySelector('.auction-card-info__status');\n        if (statusEl && statusEl.classList.contains('is-winning')) {\n          console.log('[BCO BidFlow] User is already winning \u2014 blocking grid card rebid');\n          showFeedback(\n            cardInfo.querySelector('.auction-card-info__feedback'),\n            'info', 'You are already the highest bidder!'\n          );\n          return;\n        }\n\n        const liveAuctionId = cardInfo.getAttribute('data-auction-id') || getAuctionId(wkWidget) || '';\n        // v105 SECURITY: Check login FIRST, before resolving custId.\n        // isCustomerLoggedIn() is the sole authority (Shopify meta tag only).\n        var freshLoggedIn = isCustomerLoggedIn();\n        if (!freshLoggedIn) {\n          console.log('[BCO BidFlow] Guest user (no Shopify session), redirecting to Login');\n          // Clear any stale localStorage to prevent future bypass\n          try { localStorage.removeItem('bco_cust_id'); } catch(e) {}\n          window.location.href = '/account/login?checkout_url=' + encodeURIComponent(window.location.pathname + window.location.search);\n          return false;\n        }\n\n        const liveCustId = resolveCurrentCustId() || cardInfo.getAttribute('cust-id') || (document.querySelector('.current-customer-id') ? document.querySelector('.current-customer-id').value : '') || '';\n        console.log('[BCO BidFlow] BID NOW clicked: auction=' + liveAuctionId + ' freshLoggedIn=' + freshLoggedIn + ' custId=' + liveCustId);\n\n        if (!liveCustId || liveCustId === '0') {\n          console.log('[BCO BidFlow] Logged in but no custId resolved, redirecting to Login');\n          window.location.href = '/account/login?checkout_url=' + encodeURIComponent(window.location.pathname + window.location.search);\n          return false;\n        }\n\n        if (!liveAuctionId) {\n          console.warn('[BCO BidFlow] No auction ID available');\n          showFeedback(\n            cardInfo.querySelector('.auction-card-info__feedback'),\n            'error', 'Auction not available'\n          );\n          return;\n        }\n\n        const liveMin = parseFloat(cardInfo.getAttribute('data-min-bid')) || minBid;\n        const bidAmount = parseFloat(input.value) || 0;\n        console.log('[BCO BidFlow] bidAmount=' + bidAmount + ' liveMin=' + liveMin);\n        if (bidAmount < liveMin) {\n          showFeedback(\n            cardInfo.querySelector('.auction-card-info__feedback'),\n            'error', 'Minimum bid is $' + liveMin\n          );\n          return;\n        }\n\n        // --- NEW DUPLICATE BID GUARD ---\n        if (_myLastBid[liveAuctionId] && bidAmount <= _myLastBid[liveAuctionId]) {\n          console.warn('[BCO BidFlow] Duplicate bid prevented: ' + bidAmount + ' <= ' + _myLastBid[liveAuctionId]);\n          showFeedback(\n            cardInfo.querySelector('.auction-card-info__feedback'),\n            'info', 'You already placed this bid!'\n          );\n          return;\n        }\n\n        if (submitBtn.classList.contains('is-loading')) return;\n        submitBtn.classList.add('is-loading');\n        submitBtn.style.pointerEvents = 'none';\n\n        clearEditing(input);\n        submitBid(liveAuctionId, bidAmount, liveCustId, cardInfo);\n        return false;\n      }, { capture: true });\n\n      // Show the form\n      bidForm.style.display = '';\n    });\n  }\n\n  // \u2500\u2500\u2500 Homepage: Expand parent scroller containers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  // The horizontal scroller constrains slides to 218px, but\n  // auction cards need ~560px.  CSS :has() overrides lose the\n  // specificity battle, so we set inline styles directly.\n  //\n  // Per CSS spec, overflow-x:auto forces overflow-y to 'auto'.\n  // We hide the scrollbar via scrollbar-width:none and size\n  // the container to fit the tallest card so no scroll triggers.\n  function expandAuctionCardParents() {\n    if (!document.querySelector('main[data-template=\"index\"]')) return;\n\n    // Inject <style> to override theme heights + hide scrollbar.\n    // We use stylesheet rules (not just inline styles) because the\n    // theme JS continually re-sets inline heights.\n    if (!document.getElementById('auction-carousel-scrollbar-fix')) {\n      const style = document.createElement('style');\n      style.id = 'auction-carousel-scrollbar-fix';\n      style.textContent = `\n        body main[data-template=\"index\"] slideshow-slides {\n          scrollbar-width: none !important;\n        }\n        body main[data-template=\"index\"] slideshow-slides::-webkit-scrollbar {\n          display: none !important;\n        }\n        body main[data-template=\"index\"] slideshow-component.resource-list__carousel {\n          height: auto !important;\n          min-height: unset !important;\n          max-height: none !important;\n          aspect-ratio: auto !important;\n        }\n        body main[data-template=\"index\"] .ui-test-product-list slideshow-component,\n        body main[data-template=\"index\"] .ui-test-product-list slideshow-slide {\n          aspect-ratio: auto !important;\n          height: auto !important;\n        }\n      `;\n      document.head.appendChild(style);\n    }\n\n    // MutationObserver: theme JS re-sets slideshow-component height\n    // to a fixed px value. Watch and strip it immediately.\n    const comp = document.querySelector(\n      'main[data-template=\"index\"] slideshow-component.resource-list__carousel'\n    );\n    if (comp && !comp.__auctionHeightObserver) {\n      const observer = new MutationObserver(() => {\n        const h = comp.style.height;\n        if (h && h !== 'auto') {\n          comp.style.setProperty('height', 'auto', 'important');\n        }\n        const mh = comp.style.minHeight;\n        if (mh && mh !== '0px' && mh !== 'unset') {\n          comp.style.setProperty('min-height', 'unset', 'important');\n        }\n      });\n      observer.observe(comp, { attributes: true, attributeFilter: ['style'] });\n      comp.__auctionHeightObserver = true;\n      // Also force it right now\n      comp.style.setProperty('height', 'auto', 'important');\n      comp.style.setProperty('min-height', 'unset', 'important');\n      comp.style.setProperty('max-height', 'none', 'important');\n    }\n\n    // Measure the tallest auction card\n    const cards = document.querySelectorAll('product-card:has(.auction-card-info)');\n    let maxH = 0;\n    cards.forEach(c => {\n      const h = c.getBoundingClientRect().height;\n      if (h > maxH) maxH = h;\n    });\n    // Add a small buffer; fall back to 'auto' if cards haven't rendered\n    const needed = maxH > 0 ? Math.ceil(maxH + 16) + 'px' : 'auto';\n\n    cards.forEach(card => {\n      let curr = card.parentElement;\n      for (let depth = 0; depth < 8 && curr && curr !== document.body; depth++) {\n        const tag = curr.tagName.toLowerCase();\n        const cls = curr.className || '';\n\n        if (cls.includes('resource-list__item') ||\n          tag === 'slideshow-slide' ||\n          tag === 'slideshow-container') {\n          curr.style.setProperty('height', 'auto', 'important');\n          curr.style.setProperty('min-height', needed, 'important');\n          curr.style.setProperty('max-height', 'none', 'important');\n          curr.style.setProperty('overflow-x', 'visible', 'important');\n          curr.style.setProperty('overflow-y', 'visible', 'important');\n        }\n\n        if (tag === 'slideshow-slides') {\n          curr.style.setProperty('height', 'auto', 'important');\n          curr.style.setProperty('min-height', needed, 'important');\n          curr.style.setProperty('max-height', 'none', 'important');\n          curr.style.setProperty('align-items', 'stretch', 'important');\n        }\n\n        if (tag === 'slideshow-component') {\n          // Theme forces this to 1024px \u2014 override to auto\n          curr.style.setProperty('height', 'auto', 'important');\n          curr.style.setProperty('min-height', needed, 'important');\n          curr.style.setProperty('max-height', 'none', 'important');\n          curr.style.setProperty('overflow-x', 'visible', 'important');\n          curr.style.setProperty('overflow-y', 'visible', 'important');\n        }\n\n        // Also override the parent wrapper (.resource-list__carousel)\n        if (cls.includes('resource-list__carousel')) {\n          curr.style.setProperty('height', 'auto', 'important');\n          curr.style.setProperty('min-height', needed, 'important');\n          curr.style.setProperty('max-height', 'none', 'important');\n        }\n\n        curr = curr.parentElement;\n      }\n    });\n\n    // \u2500\u2500\u2500 Impulse Theme (coral-vault): expand grid containers \u2500\u2500\u2500\n    // The Impulse theme uses .grid-product__content, .grid-product__link,\n    // and .grid__item instead of custom elements. Force overflow visible\n    // so the auction bid form isn't clipped.\n    var impulseItems = document.querySelectorAll('.grid__item:has(.auction-card-info)');\n    impulseItems.forEach(function (gridItem) {\n      // (v72) Authoritative restoration: ensure native title is visible for all auction products\n      var nativeTitle = gridItem.closest('.grid-product__content, .grid__item, .slider-item, .swiper-slide')?.querySelector('.grid-product__title, .product-slider__title, .featured-collection-title, [class*=\"featured-collection-title-\"]');\n      if (nativeTitle) {\n        nativeTitle.style.display = 'block';\n        nativeTitle.style.visibility = 'visible';\n      }\n      gridItem.style.setProperty('overflow', 'visible', 'important');\n      var content = gridItem.querySelector('.grid-product__content');\n      if (content) {\n        content.style.setProperty('overflow', 'visible', 'important');\n        content.style.setProperty('height', 'auto', 'important');\n      }\n      var link = gridItem.querySelector('.grid-product__link');\n      if (link) {\n        link.style.setProperty('overflow', 'visible', 'important');\n      }\n    });\n    // Also handle the grid-overflow-wrapper used by Impulse's mobile scroll\n    var overflowWrappers = document.querySelectorAll('.grid-overflow-wrapper:has(.auction-card-info)');\n    overflowWrappers.forEach(function (wrapper) {\n      wrapper.style.setProperty('overflow', 'visible', 'important');\n    });\n\n    // \u2500\u2500\u2500 Collection Slider: expand slider containers \u2500\u2500\u2500\n    // The homepage renders auction cards inside:\n    //   .slider-item \u2192 .slider-track \u2192 .collection-slider (overflow:hidden)\n    // Use overflow-x:hidden to keep slider clipping working (prevents blank slides)\n    // but overflow-y:visible so bid forms aren't clipped vertically.\n    var sliderContainers = document.querySelectorAll('.collection-slider:has(.auction-card-info)');\n    sliderContainers.forEach(function (slider) {\n      slider.style.setProperty('overflow-x', 'hidden', 'important');\n      slider.style.setProperty('overflow-y', 'visible', 'important');\n    });\n    var sliderItems = document.querySelectorAll('.slider-item:has(.auction-card-info)');\n    sliderItems.forEach(function (item) {\n      item.style.setProperty('overflow', 'visible', 'important');\n      item.style.setProperty('height', 'auto', 'important');\n    });\n    var sliderTracks = document.querySelectorAll('.slider-track:has(.auction-card-info)');\n    sliderTracks.forEach(function (track) {\n      // DO NOT set overflow-x:hidden on the track \u2014 it clips items\n      // beyond the track's width, making later slides invisible.\n      // Only .collection-slider (the outermost container) clips.\n      track.style.setProperty('overflow', 'visible', 'important');\n    });\n  }\n\n  /**\n   * Guard Webkul's native \"Place My Bid\" button on product detail pages.\n   * Uses a multi-layer approach:\n   *  1. Form-level submit intercept (catches all submission paths)\n   *  2. Click intercept on the bid button (backup)\n   *  3. Physical disable of button + input when already winning\n   *  4. Visible banner telling the user they're highest bidder\n   */\n  var _guardRetryCount = 0;\n  var _guardMaxRetries = 20; // 20 \u00D7 500ms = 10 seconds\n  function setupProductPageGuard() {\n    // v90: DISABLED \u2014 Our bid guards conflict with Webkul's native widget.\n    return;\n\n    // Skip if guard already fully set up\n    if (document.body.hasAttribute('data-bco-page-guard')) return;\n\n    // Find Webkul's auction widget on the product page\n    var wkWidget = document.querySelector('#wk-auction, .wk-category-auction');\n\n    // Extract auction ID (if widget exists)\n    var auctionId = '';\n    if (wkWidget) {\n      auctionId = getAuctionId(wkWidget) || '';\n      if (!auctionId) {\n        var globalInput = document.querySelector('input#auction_id, input[name=\"auction_id\"]');\n        if (globalInput && globalInput.value) auctionId = globalInput.value;\n      }\n    }\n\n    // Extract customer ID\n    var custId = '';\n    if (wkWidget) {\n      custId = wkWidget.getAttribute('cust-id') || '';\n      if (!custId) {\n        var custEl = document.querySelector('[cust-id]');\n        if (custEl) custId = custEl.getAttribute('cust-id') || '';\n      }\n    }\n\n    // If prerequisites not met, retry after 500ms\n    if (!wkWidget || !auctionId || !custId) {\n      _guardRetryCount++;\n      if (_guardRetryCount < _guardMaxRetries) {\n        setTimeout(setupProductPageGuard, 500);\n      }\n      return;\n    }\n\n    // All prerequisites met \u2014 mark guard as set up so we don't re-enter\n    document.body.setAttribute('data-bco-page-guard', 'true');\n\n    // Note: We do NOT sync DOM state (.customer_highest_bidder) to localStorage\n    // because Shopify's full-page cache can serve stale HTML where another user's\n    // winning state appears for ALL visitors. Only trust localStorage entries\n    // we set ourselves after a confirmed bid via the API.\n\n    // \u2500\u2500 Helper: is the user currently the highest bidder on THIS product? \u2500\u2500\n    // v80: Check #bco-pdp-winning-banner which renderPdpState creates,\n    // because renderPdpState STRIPS .customer_highest_bidder from the DOM.\n    // Also check _lastPdpState which is always kept current.\n    function isCurrentlyWinning() {\n      // Source 1: Our winning banner (most reliable \u2014 set by renderPdpState)\n      if (document.getElementById('bco-pdp-winning-banner')) return true;\n      // Source 2: _lastPdpState cache (set by every biddingform poll)\n      if (_lastPdpState && _lastPdpState.isWinning === true) return true;\n      // Source 3: Webkul's native marker (may be present before first poll)\n      var mainWidget = document.querySelector('#wk-auction');\n      if (mainWidget && mainWidget.querySelector('.customer_highest_bidder')) return true;\n      return false;\n    }\n\n    // \u2500\u2500 Helper: show/create the feedback banner \u2500\u2500\n    var _bannerShown = false;\n    function showWinningBanner() {\n      return; // v73: Disable redundant banner (renderPdpState handles it)\n      /*\n      if (_bannerShown) return; // Only create/modify banner once\n      var banner = document.getElementById('bco-product-bid-feedback');\n      if (!banner) {\n        banner = document.createElement('div');\n        banner.id = 'bco-product-bid-feedback';\n        banner.style.cssText =\n          'padding:12px 16px;margin:12px 0;border-radius:10px;font-weight:600;' +\n          'text-align:center;font-size:15px;line-height:1.4;' +\n          'background:rgba(0,180,216,0.15);color:#00b4d8;' +\n          'border:1px solid rgba(0,180,216,0.3);display:block;';\n        banner.textContent = '\\uD83C\\uDFC6 You are already the highest bidder!';\n        // Insert before the form or after the bid button\n        var insertTarget = document.querySelector('#bidding-form, .wk_submit_bid');\n        if (insertTarget && insertTarget.parentNode) {\n          insertTarget.parentNode.insertBefore(banner, insertTarget);\n        }\n      }\n      _bannerShown = true;\n      */\n    }\n\n    // \u2500\u2500 Helper: toggle bid form controls based on winning status \u2500\u2500\n    // IMPORTANT: Never permanently disable \u2014 status can change when outbid.\n    // NOTE: Only disable BUTTONS, never the bid input \u2014 users must be able\n    // to enter proxy bids (any amount >= next min) even when winning.\n    function setBidFormState(winning) {\n      var btns = document.querySelectorAll('.wk_submit_bid, #pa_place_bid_link, .pa-category-btn, #pa_place_bid');\n      var bidInput = document.querySelector('#wk_bid_amount, input[name=\"bid_amount\"]');\n      if (winning) {\n        // For proxy bidding: do NOT disable buttons or input.\n        // User must be able to increase their proxy max at any time.\n        // Server validates bid eligibility.\n        console.log('[BCO PDP] User is winning \u2014 keeping form enabled for proxy bidding');\n        showWinningBanner();\n      } else {\n        btns.forEach(function (btn) {\n          btn.disabled = false;\n          btn.style.opacity = '';\n          btn.style.pointerEvents = '';\n          btn.style.cursor = '';\n        });\n        if (bidInput) {\n          bidInput.disabled = false;\n          bidInput.style.opacity = '';\n        }\n        // Remove winning banner if present\n        var banner = document.getElementById('bco-product-bid-feedback');\n        if (banner) banner.remove();\n        _bannerShown = false;\n      }\n    }\n\n    // \u2500\u2500 Proactive state: if already winning, show banner (informational) \u2500\u2500\n    if (isCurrentlyWinning()) {\n      setBidFormState(true);\n      // v78: More aggressive PDP disablement\n      setTimeout(function () {\n        setBidFormState(true);\n      }, 1000);\n      setTimeout(function () {\n        setBidFormState(true);\n      }, 3000);\n    }\n\n    // \u2500\u2500 Layer 1: Form submit intercept \u2500\u2500\n    // v80: Catches ALL bid submissions. BLOCKS when winning and sets cooldown.\n    var formIds = ['bidding-form', 'proxy_bidding_form', 'collection_bidding_form'];\n    formIds.forEach(function (formId) {\n      var form = document.getElementById(formId);\n      if (!form) return;\n      form.addEventListener('submit', function (e) {\n        // Set post-bid cooldown for PDP native bids to prevent input flipping\n        var pdpWidget = document.querySelector('#wk-auction');\n        var pdpPid = pdpWidget ? (pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id')) : null;\n        if (pdpPid) {\n          _postBidCooldown[pdpPid] = Date.now();\n          console.log('[BCO PDP Guard] Set post-bid cooldown for product ' + pdpPid);\n        }\n        // v80: Block submission when user is already the highest bidder\n        if (isCurrentlyWinning()) {\n          e.preventDefault();\n          e.stopImmediatePropagation();\n          console.log('[BCO PDP Guard] BLOCKED form submit \u2014 user is already winning');\n          showPdpFeedback('info', 'You are already the highest bidder!');\n          return false;\n        }\n      }, { capture: true });\n    });\n\n    // \u2500\u2500 Layer 2: Click intercept on bid button \u2500\u2500\n    var bidBtns = document.querySelectorAll('.wk_submit_bid, #pa_place_bid_link, .pa-category-btn');\n    bidBtns.forEach(function (bidBtn) {\n      if (bidBtn.hasAttribute('data-bco-guard')) return;\n      bidBtn.setAttribute('data-bco-guard', 'true');\n\n      bidBtn.addEventListener('click', function (e) {\n        // v80: Block bid when user is already winning\n        if (isCurrentlyWinning()) {\n          e.preventDefault();\n          e.stopPropagation();\n          e.stopImmediatePropagation();\n          console.log('[BCO PDP Guard] BLOCKED button click \u2014 user is already winning');\n          showPdpFeedback('info', 'You are already the highest bidder!');\n          return false;\n        }\n        // Set cooldown for PDP native bids\n        var pdpWidget = document.querySelector('#wk-auction');\n        var pdpPid = pdpWidget ? (pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id')) : null;\n        if (pdpPid) {\n          _postBidCooldown[pdpPid] = Date.now();\n        }\n      }, { capture: true });\n    });\n\n    // \u2500\u2500 Helper: resolve auction ID for a specific element \u2500\u2500\n    // Walks up the DOM from any button/form to find its closest\n    // auction widget and extracts that widget's auction ID.\n    // This ensures each recommended product uses its OWN auction ID,\n    // not the main product's closured ID.\n    function getElementAuctionId(el) {\n      var widget = el.closest('#wk-auction, .wk-category-auction, [auction_id]');\n      if (widget) {\n        var id = widget.getAttribute('auction_id');\n        if (id) return id;\n      }\n      // Fallback: check for hidden auction_id input near this element\n      var form = el.closest('form');\n      if (form) {\n        var hiddenInput = form.querySelector('input[name=\"auction_id\"], input#auction_id');\n        if (hiddenInput && hiddenInput.value) return hiddenInput.value;\n      }\n      // Last resort: use the main product's auction ID\n      return auctionId;\n    }\n\n    // \u2500\u2500 Helper: check if user is winning a SPECIFIC auction \u2500\u2500\n    // Checks the DOM for Webkul's .customer_highest_bidder class\n    // in the widget matching this specific auction ID.\n    function isWinningThisAuction(specificAuctionId) {\n      var wkWidgets = document.querySelectorAll('.wk-category-auction[auction_id=\"' + specificAuctionId + '\"]');\n      for (var i = 0; i < wkWidgets.length; i++) {\n        if (wkWidgets[i].querySelector('.customer_highest_bidder')) return true;\n      }\n      return false;\n    }\n\n    // \u2500\u2500 Layer 3: Watch for late-arriving bid buttons AND winning status \u2500\u2500\n    // Webkul loads button via AJAX after #wk-auction container appears,\n    // so our Layer 2 click intercept misses it. This observer attaches\n    // the guard to any newly-added .wk_submit_bid buttons.\n    function attachGuardToButton(btn) {\n      if (btn.hasAttribute('data-bco-guard')) return;\n      btn.setAttribute('data-bco-guard', 'true');\n      btn.addEventListener('click', function (e) {\n        // v80: Block bid when user is already winning\n        if (isCurrentlyWinning()) {\n          e.preventDefault();\n          e.stopPropagation();\n          e.stopImmediatePropagation();\n          console.log('[BCO PDP Guard] BLOCKED late button click \u2014 user is already winning');\n          showPdpFeedback('info', 'You are already the highest bidder!');\n          return false;\n        }\n        // Set cooldown for PDP native bids\n        var pdpWidget = document.querySelector('#wk-auction');\n        var pdpPid = pdpWidget ? (pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id')) : null;\n        if (pdpPid) {\n          _postBidCooldown[pdpPid] = Date.now();\n        }\n      }, { capture: true });\n    }\n\n    function attachFormGuard(form) {\n      if (form.hasAttribute('data-bco-form-guard')) return;\n      form.setAttribute('data-bco-form-guard', 'true');\n      form.addEventListener('submit', function (e) {\n        // Set cooldown for PDP native bids\n        var pdpWidget = document.querySelector('#wk-auction');\n        var pdpPid = pdpWidget ? (pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id')) : null;\n        if (pdpPid) {\n          _postBidCooldown[pdpPid] = Date.now();\n        }\n        // v80: Block submission when user is already winning\n        if (isCurrentlyWinning()) {\n          e.preventDefault();\n          e.stopImmediatePropagation();\n          console.log('[BCO PDP Guard] BLOCKED late form submit \u2014 user is already winning');\n          showPdpFeedback('info', 'You are already the highest bidder!');\n          return false;\n        }\n      }, { capture: true });\n    }\n\n    var statusObserver = new MutationObserver(function (mutations) {\n      // Check for newly-added bid buttons or forms\n      for (var i = 0; i < mutations.length; i++) {\n        var added = mutations[i].addedNodes;\n        for (var j = 0; j < added.length; j++) {\n          var node = added[j];\n          if (node.nodeType !== 1) continue;\n          // Check if this node IS a bid button\n          if (node.classList && node.classList.contains('wk_submit_bid')) {\n            attachGuardToButton(node);\n          }\n          // Check if this node CONTAINS bid buttons\n          if (node.querySelectorAll) {\n            var btns = node.querySelectorAll('.wk_submit_bid, #pa_place_bid_link, .pa-category-btn');\n            btns.forEach(attachGuardToButton);\n            // Check for forms too\n            var forms = node.querySelectorAll('#bidding-form, #proxy_bidding_form');\n            forms.forEach(attachFormGuard);\n          }\n        }\n      }\n    });\n    statusObserver.observe(wkWidget, { childList: true, subtree: true });\n\n    // \u2500\u2500 Layer 4: Polling fallback \u2500\u2500\n    // Webkul may use innerHTML or other methods that don't reliably\n    // trigger MutationObserver addedNodes. Poll for un-guarded elements.\n    var pollCount = 0;\n    var pollMax = 20; // 20 \u00D7 500ms = 10 seconds\n    var pollTimer = setInterval(function () {\n      pollCount++;\n      // Guard any un-guarded bid buttons\n      document.querySelectorAll('.wk_submit_bid, #pa_place_bid_link, .pa-category-btn').forEach(attachGuardToButton);\n      // Guard any un-guarded forms\n      var fIds = ['bidding-form', 'proxy_bidding_form', 'collection_bidding_form'];\n      fIds.forEach(function (fId) {\n        var f = document.getElementById(fId);\n        if (f) attachFormGuard(f);\n      });\n      // Stop polling after max attempts\n      if (pollCount >= pollMax) clearInterval(pollTimer);\n      // Proactively disable if winning status appeared since page load\n      if (isCurrentlyWinning()) {\n        setBidFormState(true);\n        clearInterval(pollTimer); // No need to keep polling\n      }\n    }, 500);\n  }\n\n  /**\n   * Suppress ONLY Webkul's misleading authorization-amount modals.\n   * IMPORTANT: Do NOT suppress consecutive-bids modals \u2014 those are\n   * Webkul's legitimate duplicate-bid validation.\n   * Only triggers when an actual pa-modal element is detected.\n   */\n  function suppressWebkulModals() {\n    // Keywords that indicate a misleading Webkul message (NOT consecutive bids)\n    var suppressPatterns = [\n      'authorised amount',\n      'authorized amount',\n      'increase the authorization',\n      'bidding amount is higher'\n    ];\n\n    function shouldSuppress(text) {\n      var lower = (text || '').toLowerCase();\n      for (var i = 0; i < suppressPatterns.length; i++) {\n        if (lower.indexOf(suppressPatterns[i]) !== -1) return true;\n      }\n      return false;\n    }\n\n    // \u2500\u2500 Scan and hide ONLY authorization-related modals \u2500\u2500\n    function scanAndSuppress() {\n      var selectors = '.pa-modal-container, [class*=\"pa-modal\"], [class*=\"pa-popup\"]';\n      document.querySelectorAll(selectors).forEach(function (modal) {\n        if (shouldSuppress(modal.textContent)) {\n          modal.style.setProperty('display', 'none', 'important');\n          var backdrop = modal.closest('.pa-modal-bg') || modal.querySelector('.pa-modal-bg');\n          if (backdrop) {\n            backdrop.style.setProperty('display', 'none', 'important');\n          }\n        }\n      });\n    }\n\n    // Run once immediately for any pre-rendered modals\n    scanAndSuppress();\n\n    // \u2500\u2500 Targeted MutationObserver \u2014 only scan when a modal element is added \u2500\u2500\n    var _modalObserverRunning = false;\n    var observer = new MutationObserver(function (mutations) {\n      if (_modalObserverRunning) return;\n      for (var i = 0; i < mutations.length; i++) {\n        var added = mutations[i].addedNodes;\n        for (var j = 0; j < added.length; j++) {\n          var node = added[j];\n          if (node.nodeType !== 1) continue;\n          // Only scan if this node IS a modal or CONTAINS a modal\n          var isModal = node.classList && (\n            node.classList.contains('pa-modal-container') ||\n            node.className.indexOf('pa-modal') !== -1 ||\n            node.className.indexOf('pa-popup') !== -1\n          );\n          var hasModal = node.querySelector && node.querySelector(\n            '.pa-modal-container, [class*=\"pa-modal\"], [class*=\"pa-popup\"]'\n          );\n          if (isModal || hasModal) {\n            _modalObserverRunning = true;\n            setTimeout(function () {\n              scanAndSuppress();\n              _modalObserverRunning = false;\n            }, 100);\n            return;\n          }\n        }\n      }\n    });\n\n    observer.observe(document.body, {\n      childList: true,\n      subtree: false // Only watch direct children, not entire subtree\n    });\n  }\n\n  // \u2500\u2500\u2500 Init \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n  // \u2500\u2500 Shared: resolve current customer ID (used by sync layers + guards) \u2500\u2500\n  var _currentCustId = '';\n  function resolveCurrentCustId() {\n    if (_currentCustId && _currentCustId !== '0') return _currentCustId;\n    \n    var custMeta = document.querySelector('meta[name=\"logged-in-customer-id\"]') || document.querySelector('meta[name=\"customer-id\"]');\n    if (custMeta && custMeta.content && custMeta.content.trim() !== '0') {\n      _currentCustId = custMeta.content.trim();\n    }\n    \n    if (!_currentCustId || _currentCustId === '0') {\n      var wkEl = document.querySelector('.wk-category-auction[cust-id], #wk-auction[cust-id], [cust-id]');\n      if (wkEl) _currentCustId = wkEl.getAttribute('cust-id') || '';\n    }\n    \n    if (!_currentCustId || _currentCustId === '0') {\n      if (window.__st && window.__st.cid) _currentCustId = window.__st.cid;\n      else if (window.ShopifyAnalytics && window.ShopifyAnalytics.meta && window.ShopifyAnalytics.meta.page && window.ShopifyAnalytics.meta.page.customerId) {\n          _currentCustId = window.ShopifyAnalytics.meta.page.customerId;\n      }\n      else if (typeof customer_id !== 'undefined') _currentCustId = customer_id;\n    }\n    \n    // v105 SECURITY: Removed localStorage fallback for custId.\n    // It persisted after logout, allowing guests to resolve a stale custId\n    // and bypass the bid submission login check.\n    // localStorage is still used for participation data (wk_part_auc/wk_part_pid)\n    // but NOT for identity/authentication.\n    \n    return _currentCustId || '0';\n  }\n\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  // LIVE BID SYNC \u2014 hooks into Webkul's existing WebSocket to update\n  // our custom auction cards in real-time when any user places a bid.\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  var _liveSyncSetup = false;\n\n  function setupLiveBidSync() {\n    if (_liveSyncSetup) return;\n\n    var currentCustId = resolveCurrentCustId();\n\n    // Wait for spcObj.socket to be available (it loads asynchronously)\n    var socketPollCount = 0;\n    var socketPollMax = 40; // 40 \u00D7 250ms = 10 seconds\n    var socketPollTimer = setInterval(function () {\n      socketPollCount++;\n      if (socketPollCount >= socketPollMax) {\n        clearInterval(socketPollTimer);\n        console.log('[BCO LiveSync] Socket not found after 10s \u2014 skipping live sync');\n        return;\n      }\n      if (typeof spcObj === 'undefined' || !spcObj.socket || !spcObj.socket.on) return;\n\n      // Socket is ready \u2014 attach our listener\n      clearInterval(socketPollTimer);\n      _liveSyncSetup = true;\n\n      // \u2500\u2500 CRITICAL: Join the auction broadcast room \u2500\u2500\n      // Webkul's server requires clients to emit 'joinAuction' with the\n      // shop domain as the room ID. Without this, the socket receives\n      // ZERO placeBid events even though it's connected.\n      var roomId = (typeof Shopify !== 'undefined' && Shopify.shop) ? Shopify.shop : (spcObj.shop_name || '');\n      if (roomId) {\n        spcObj.socket.emit('joinAuction', roomId);\n        console.log('[BCO LiveSync] Joined room: ' + roomId);\n      }\n\n      // \u2500\u2500 Heartbeat \u2500\u2500\n      // Re-emit joinAuction periodically to ensure the server hasn't dropped the\n      // client due to inactivity or internal resets.\n      setInterval(function () {\n        if (roomId && spcObj.socket && spcObj.socket.connected) {\n          spcObj.socket.emit('joinAuction', roomId);\n        }\n      }, 60000);\n\n      // Re-join on reconnection (WebSocket may drop and reconnect)\n      spcObj.socket.on('connect', function () {\n        if (roomId) {\n          spcObj.socket.emit('joinAuction', roomId);\n          console.log('[BCO LiveSync] Reconnected \u2014 re-joined room: ' + roomId);\n        }\n      });\n\n      console.log('[BCO LiveSync] Connected \u2014 listening for live bid updates');\n\n      // Track whether the tab is visible to avoid unnecessary DOM thrash\n      var _tabVisible = !document.hidden;\n      var _pendingUpdates = []; // queue updates when tab is hidden\n\n      document.addEventListener('visibilitychange', function () {\n        _tabVisible = !document.hidden;\n        if (_tabVisible && _pendingUpdates.length > 0) {\n          // Flush queued updates\n          _pendingUpdates.forEach(function (data) { applyBidUpdate(data); });\n          _pendingUpdates = [];\n        }\n      });\n\n      // Listen for Webkul's placeBid broadcast event\n      spcObj.socket.on('placeBid', function (response) {\n        if (!response || !response.auction_id) return;\n        // Webkul fires TWO events per bid \u2014 the first has current_bid=undefined.\n        // Skip those to avoid a brief $0.00 flash on the card.\n        if (response.current_bid == null) return;\n\n        if (_tabVisible) {\n          applyBidUpdate(response);\n        } else {\n          // Queue \u2014 only keep latest per auction_id to avoid stacking\n          _pendingUpdates = _pendingUpdates.filter(function (u) {\n            return u.auction_id !== response.auction_id;\n          });\n          _pendingUpdates.push(response);\n        }\n      });\n\n      // \u2500\u2500 BroadcastChannel \u2014 same-browser cross-tab sync \u2500\u2500\n      // When the same user places a bid in another tab, we get instant\n      // notification via BroadcastChannel (no server round-trip needed).\n      try {\n        var bc = new BroadcastChannel('bco-bid-sync');\n        bc.onmessage = function (event) {\n          var data = event.data;\n          if (!data || !data.auction_id) return;\n          console.log('[BCO LiveSync] BroadcastChannel update for auction ' + data.auction_id);\n          applyBidUpdate(data);\n        };\n      } catch (e) { /* BroadcastChannel not supported in this browser */ }\n\n\n      /**\n       * Apply a bid update from the socket to all matching auction cards.\n       * @param {Object} data - { auction_id, current_bid, bid_count, highest_bidder_Id, min_bid_amount, currency }\n       */\n      function applyBidUpdate(data) {\n        var auctionId = String(data.auction_id || data.auctionId || '');\n        var currentBid = data.current_bid || data.currentBid || 0;\n        var bidCount = data.bid_count || data.bidCount || 0;\n        var productId = data.product_id || data.productId || '';\n\n        // Persist to global price cache for cross-tab and cross-alias sync\n        // Global state updated in-memory for subsequent sync\n\n        // Update locally... (rest of the existing logic)\n        var highestBidderId = (data.highest_bidder_Id || data.highest_bidder_id || data.highest_bidderId || '');\n        highestBidderId = String(highestBidderId);\n        var minBidAmount = data.min_bid_amount || data.minBidAmount || 0;\n        var currency = data.currency || 'USD';\n\n        // Handle multi-currency conversion if needed\n        if (Number(data.multiCurrency) && typeof spcObj.convertCurrency === 'function' &&\n          spcObj.shop_currency !== (typeof Shopify !== 'undefined' ? Shopify.currency?.active : spcObj.shop_currency)) {\n          try {\n            currentBid = spcObj.convertCurrency(parseFloat(String(currentBid).replace(/,/g, '')), spcObj.shop_currency);\n            minBidAmount = spcObj.convertCurrency(parseFloat(String(minBidAmount).replace(/,/g, '')), spcObj.shop_currency);\n            currency = Shopify.currency.active;\n          } catch (e) { /* conversion failed, use original values */ }\n        }\n\n        var displayBid = parseBidAmount(String(currentBid)) || 0;\n        var displayMin = parseBidAmount(String(minBidAmount)) || 0;\n        var displayCount = parseInt(bidCount) || 0;\n\n        // \u2500\u2500 Card Selection (ID Aliasing & Product Matching) \u2500\u2500\n        // Webkul sometimes uses different Auction IDs for the same product across different pages.\n        // We find the primary card to resolve the Product ID, then update ALL cards for that product.\n        var targetCards = Array.from(document.querySelectorAll('.auction-card-info[data-auction-id=\"' + auctionId + '\"]'));\n        var productId = data.product_id || data.productId || '';\n\n        if (!productId && targetCards.length > 0) {\n          var pc = targetCards[0].closest('[data-product-id], product-card');\n          productId = pc ? pc.getAttribute('data-product-id') : '';\n        }\n\n        // If we have a product ID, find all widgets for that product even if Auction ID differs\n        if (productId) {\n          var productExtras = Array.from(document.querySelectorAll('.auction-card-info[data-product-id=\"' + productId + '\"]'));\n          productExtras.forEach(function (p) { if (!targetCards.includes(p)) targetCards.push(p); });\n\n          // Also check for containers where product ID is on the parent\n          var parents = document.querySelectorAll('[data-product-id=\"' + productId + '\"], product-card[data-product-id=\"' + productId + '\"]');\n          parents.forEach(function (p) {\n            var widget = p.querySelector('.auction-card-info');\n            if (widget && !targetCards.includes(widget)) targetCards.push(widget);\n          });\n        }\n\n        // \u2500\u2500 Monotonic Guard \u2500\u2500\n        // If the socket sends a bid LOWER than what we already have, ignore it.\n        if (targetCards.length > 0) {\n          var currentCardBid = parseFloat(targetCards[0].getAttribute('data-current-bid') || '0');\n          if (currentCardBid === 0) {\n            var priceEl = targetCards[0].querySelector('.auction-card-info__current-bid');\n            currentCardBid = priceEl ? parseFloat(priceEl.textContent.replace(/[^0-9.]/g, '')) : 0;\n          }\n          if (displayBid < currentCardBid) {\n            console.log('[BCO LiveSync] Ignoring stale socket update: ' + displayBid + ' < ' + currentCardBid);\n            return;\n          }\n\n          // \u2500\u2500 Post-bid cooldown: skip attribute + display writes \u2500\u2500\n          // After a bid submission, the WebSocket may send the proxy max ($50)\n          // while the real visible bid is lower ($26). During cooldown, skip\n          // data-current-bid and _bfLastUpdate writes so the API poll can\n          // write the correct server-authoritative value unmolested.\n          var cooldownProductId = productId || (targetCards[0] ? targetCards[0].getAttribute('data-product-id') : '');\n\n          safeBidWrite(cooldownProductId, function () {\n            // Update the attribute for all matched cards\n            targetCards.forEach(function (c) { c.setAttribute('data-current-bid', String(displayBid)); });\n            _lastBidUpdate[auctionId] = { bid: displayBid, ts: Date.now() };\n\n            // v71: Stamp _bfLastUpdate so doBiddingformPoll defers to this\n            // fresher socket data instead of overwriting with stale API data.\n            if (productId) {\n              _bfLastUpdate[productId] = Date.now();\n            }\n          }, currentCardBid, displayBid);\n        }\n\n        // Resolve current customer ID fresh\n        var freshCustId = String(resolveCurrentCustId());\n        var hBidderId = String(highestBidderId);\n        var isMeWinning = freshCustId && freshCustId !== '0' && freshCustId === hBidderId;\n\n        // Update local rules cache if provided (in-memory only)\n        if (data.rules && Array.isArray(data.rules)) {\n          _biddingRulesCache[auctionId] = data.rules;\n          if (productId) _rulesByProductId[productId] = data.rules;\n        }\n\n        // \u2500\u2500 Unified Price Calculation \u2500\u2500\n        // Trust server's min_bid_amount if available and higher than current bid\n        var calculatedMin = applyBiddingRules(displayBid, auctionId, productId);\n        var nextMin = Math.max(displayMin, calculatedMin);\n\n        // \u2500\u2500 Update All Resolved Cards \u2500\u2500\n        targetCards.forEach(function (cardInfo) {\n          var dom = getCardDom(cardInfo);\n\n          // Current Bid - Enforce USD prefix, guard against $0 flash\n          if (dom.bidEl) {\n            // \u2500\u2500 Post-bid cooldown: trust API poll over WebSocket \u2500\u2500\n            var cooldownPid = cardInfo.getAttribute('data-product-id');\n            var stepAmt = (displayMin > displayBid) ? (displayMin - displayBid) : 2;\n            safeBidWrite(cooldownPid, function () {\n              safeInitialBid(cardInfo, displayBid, displayMin, stepAmt, displayCount);\n            }, currentCardBid, displayBid);\n          }\n\n          // Bid Count\n          if (dom.countEl) {\n            safeBidWrite(cooldownPid, function () {\n              dom.countEl.textContent = displayCount + (displayCount === 1 ? ' bid' : ' bids');\n            }, currentCardBid, displayBid);\n          }\n\n          // Min bid input handled via safeInitialBid above\n\n          // Status badge\n          if (dom.statusEl && freshCustId && freshCustId !== '0') {\n            safeBidWrite(cooldownPid, function () {\n              if (isMeWinning) {\n                dom.statusEl.textContent = '\uD83C\uDFC6 Winning';\n                dom.statusEl.classList.add('is-winning');\n                dom.statusEl.classList.remove('is-outbid');\n                if (!_hasParticipated[auctionId]) {\n                  _hasParticipated[auctionId] = true;\n                }\n              } else {\n                if (highestBidderId && highestBidderId !== '0' && _hasParticipated[auctionId]) {\n                  dom.statusEl.textContent = '\u26A0\uFE0F Outbid';\n                  dom.statusEl.classList.add('is-outbid');\n                  dom.statusEl.classList.remove('is-winning');\n                }\n              }\n            }, currentCardBid, displayBid);\n          }\n\n          // Update Webkul hidden DOM markers\n          _suppressDomWatcher = true;\n          var gridItem2 = cardInfo.closest('li, .product-card, product-card, .grid__item');\n          var wkWidget2 = gridItem2 ? gridItem2.querySelector('.wk-category-auction') : null;\n          if (wkWidget2) {\n            if (isMeWinning) {\n              if (!wkWidget2.querySelector('.customer_highest_bidder')) {\n                var marker = document.createElement('span');\n                marker.className = 'customer_highest_bidder';\n                marker.style.display = 'none';\n                wkWidget2.appendChild(marker);\n              }\n              var outM = wkWidget2.querySelector('.customer_participated');\n              if (outM) outM.remove();\n            } else if (freshCustId && freshCustId !== '0' && highestBidderId && highestBidderId !== '0') {\n              var winM = wkWidget2.querySelector('.customer_highest_bidder');\n              if (winM) winM.remove();\n              if (_hasParticipated[auctionId] && !wkWidget2.querySelector('.customer_participated')) {\n                var partM = document.createElement('span');\n                partM.className = 'customer_participated';\n                partM.style.display = 'none';\n                wkWidget2.appendChild(partM);\n              }\n            }\n          }\n          // v84 PERF: Removed duplicate timeout\n          setTimeout(function () { _suppressDomWatcher = false; }, 100);\n\n          // Flash/Popcorn animation ONLY if bid actually increased\n          var oldBid = parseFloat(cardInfo.getAttribute('data-last-flashed-bid') || '0');\n          if (displayBid && displayBid > oldBid) {\n            cardInfo.setAttribute('data-last-flashed-bid', String(displayBid));\n            \n            // v84: Trigger popcorn instead of simple flash\n            if (typeof triggerPopcornAnimation === 'function') {\n              // WebSocket updates are often \"last minute\" bids\n              var timeLeftEl = cardInfo.querySelector('.auction-card-info__time-left');\n              var isLastMinute = false;\n              if (timeLeftEl) {\n                var txt = timeLeftEl.textContent || \"\";\n                if (txt.includes('00D 00H 01M') || (txt.includes('00D 00H 00M') && !txt.includes('Ended'))) isLastMinute = true;\n              }\n              triggerPopcornAnimation(cardInfo, isLastMinute);\n            } else {\n              cardInfo.classList.add('auction-card-info--bid-success');\n              setTimeout(function () {\n                cardInfo.classList.remove('auction-card-info--bid-success');\n              }, 1200);\n            }\n          }\n        });\n\n        // \u2500\u2500 Update PDP via single render function \u2500\u2500\n        // v90: DISABLED \u2014 Don't write to Webkul's native widget from WebSocket updates.\n        var mainWidget = null; // document.querySelector('#wk-auction');\n        if (false && mainWidget && window.location.pathname.includes('/products/')) {\n          var mainAuctionId = getAuctionId(mainWidget);\n          var mainProductId = mainWidget.getAttribute('data-product-id');\n\n          if (mainAuctionId === auctionId || (productId && productId === mainProductId)) {\n            var pdpNextMin = applyBiddingRules(displayBid, auctionId, mainProductId || productId);\n            var finalMin = Math.max(displayMin, pdpNextMin);\n            // Carry over bidder name from the latest API poll cache (WebSocket doesn't include it)\n            var socketBidderName = (_minBidFromApi[mainProductId || productId] && _minBidFromApi[mainProductId || productId].highestBidderName) || '';\n\n            renderPdpState({\n              productId: mainProductId || productId,\n              currentBid: displayBid,\n              bidCount: displayCount,\n              minBid: finalMin,\n              highestBidderName: socketBidderName\n              // v74: Socket does NOT define isWinning/hasParticipated.\n              // We leave status authority 100% to the API poll.\n            });\n          }\n        }\n      }\n    }, 250);\n  }\n\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  // TIMER SYNC \u2014 keeps our card timers in sync with Webkul's ticking\n  // .pa-timer elements. Runs every 1 second for precise countdown.\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  var _timerSyncSetup = false;\n\n  function setupTimerSync() {\n    if (_timerSyncSetup) return;\n    var cards = document.querySelectorAll('.auction-card-info');\n    if (cards.length === 0) return;\n    _timerSyncSetup = true;\n\n    function syncTimers() {\n      // v84 PERF: Skip timer sync when tab is hidden\n      if (document.hidden) return;\n\n      document.querySelectorAll('.auction-card-info').forEach(function (card) {\n        var timeLeftEl = card.querySelector('.auction-card-info__time-left');\n        if (!timeLeftEl) return;\n\n        // Find timer directly by unique auction ID instead of structural DOM traversal\n        var aid = card.getAttribute('data-auction-id');\n\n        // V77 HOTFIX: Asynchronous timer backfill via Product ID (Cross-DOM linking)\n        // The homepage slider cards exist entirely separate from Webkul's native .wkgrid nodes.\n        // We match them by `data-auction-product-id`.\n        if (!aid) {\n          var pid = card.getAttribute('data-auction-product-id') || card.getAttribute('data-product-id');\n          if (pid) {\n            // Find Webkul's specific hidden widget wrapper anywhere on the page for this product\n            var wkWidget = document.querySelector('.wk-category-auction[data-prod=\"' + pid + '\"]');\n            if (wkWidget) {\n              var timerEl = wkWidget.querySelector('.pa-timer[id^=\"auction_poa_\"], .pa-timer[id^=\"auction_\"]');\n              if (timerEl) {\n                var idMatch = timerEl.id.match(/auction(?:_poa)?_(\\d+)/);\n                if (idMatch) {\n                  aid = idMatch[1];\n                  card.setAttribute('data-auction-id', aid);\n                  console.log('[BCO LiveSync] Bridged missing timer ID via Product ID (' + pid + ') -> Auction ID:', aid);\n                }\n              }\n            }\n          }\n        }\n\n        if (!aid) return;\n\n        // V89 FIX: ALWAYS prefer data-timer-end if it exists (monotonically guarded by BiddingformPoll).\n        // If it doesn't exist, read Webkul's DOM ONCE to initialize it, then never read the DOM again!\n        // This completely eliminates the popcorn timer flicker caused by reading stale DOM injected by Webkul's AJAX.\n        var endTs = parseInt(card.getAttribute('data-timer-end')) || 0;\n        if (endTs === 0) {\n          // Initialization: Find the Webkul timer ONLY ONCE to get the starting epoch\n          var timer = null;\n          if (card.parentElement) {\n            timer = card.parentElement.querySelector('.pa-timer');\n          }\n          if (!timer) {\n            timer = document.getElementById('auction_' + aid) || document.getElementById('auction_poa_' + aid);\n          }\n          if (!timer) {\n            var pid = card.getAttribute('data-auction-product-id') || card.getAttribute('data-product-id');\n            if (pid) {\n              var wkWidget = document.querySelector('.wk-category-auction[data-prod=\"' + pid + '\"]');\n              if (wkWidget) timer = wkWidget.querySelector('.pa-timer');\n            }\n          }\n          if (timer) {\n            var digits = timer.querySelectorAll('.pa-theme-color');\n            if (digits.length >= 4) {\n              var d = parseInt((digits[0].textContent || '0').replace(/[^0-9]/g, '')) || 0;\n              var h = parseInt((digits[1].textContent || '0').replace(/[^0-9]/g, '')) || 0;\n              var m = parseInt((digits[2].textContent || '0').replace(/[^0-9]/g, '')) || 0;\n              var s = parseInt((digits[3].textContent || '0').replace(/[^0-9]/g, '')) || 0;\n              var totalSecs = (d * 86400) + (h * 3600) + (m * 60) + s;\n              endTs = Date.now() + (totalSecs * 1000);\n              card.setAttribute('data-timer-end', String(endTs));\n            }\n          }\n        }\n\n        // Now strictly count down from endTs\n        if (endTs > 0) {\n          var remSecs = Math.max(0, Math.floor((endTs - Date.now()) / 1000));\n          var rd = Math.floor(remSecs / 86400); var diffH = remSecs % 86400;\n          var rh = Math.floor(diffH / 3600); var diffM = diffH % 3600;\n          var rm = Math.floor(diffM / 60);\n          var rs = diffM % 60;\n          var newText = remSecs <= 0 && rd === 0 && rh === 0 && rm === 0 ? 'Ended'\n            : String(rd).padStart(2,'0') + 'D ' + String(rh).padStart(2,'0') + 'H ' + String(rm).padStart(2,'0') + 'M ' + String(rs).padStart(2,'0') + 'S';\n          \n          if (timeLeftEl.textContent.trim() !== newText) {\n            timeLeftEl.textContent = newText;\n          }\n\n          // AUCTION END STATE FIX: If ended, explicitly hide the bid form and update status\n          if (remSecs <= 0 && rd === 0 && rh === 0 && rm === 0) {\n             var formEl = card.querySelector('.auction-card-info__bid-form');\n             if (formEl && formEl.style.display !== 'none') formEl.style.setProperty('display', 'none', 'important');\n             \n             var statRow = card.querySelector('.auction-card-info__status-row');\n             if (statRow) {\n                 var statEl = statRow.querySelector('.auction-card-info__status');\n                 if (statEl && !statEl.classList.contains('is-ended')) {\n                     statEl.textContent = 'Auction Ended';\n                     statEl.className = 'auction-card-info__status is-ended';\n                     statEl.style.color = '#fff';\n                     statEl.style.opacity = '0.6';\n                     statRow.style.setProperty('display', 'flex', 'important');\n                 }\n             }\n\n             // For PDP, hide the flex wrapper if we are on the main product\n             // v90: DISABLED \u2014 Don't manipulate Webkul's native PDP widget DOM.\n             if (false && window.location.pathname.includes('/products/')) {\n                 var mainWidget = document.querySelector('#wk-auction');\n                 if (mainWidget) {\n                     var mainPid = mainWidget.getAttribute('prod-id') || mainWidget.getAttribute('data-product-id');\n                     var cardPid = card.getAttribute('data-product-id');\n                     if (mainPid && cardPid && String(mainPid) === String(cardPid)) {\n                         var pdpInput = document.querySelector('#wk_bid_amount, #bid_amount');\n                         if (pdpInput && pdpInput.parentNode && pdpInput.parentNode.parentNode) {\n                             var flexWrap = pdpInput.parentNode.parentNode.querySelector('.bco-pdp-bid-row');\n                             if (flexWrap && flexWrap.style.display !== 'none') {\n                                 flexWrap.style.setProperty('display', 'none', 'important');\n                             }\n                         }\n                     }\n                 }\n             }\n          }\n        }\n      });\n    }\n\n    // Run every second\n    setInterval(syncTimers, 1000);\n    // Run once immediately\n    syncTimers();\n    console.log('[BCO LiveSync] Timer sync active (1s interval)');\n  }\n\n\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  // DOM WATCHER \u2014 v72: STRIPPED of all writes.\n  // Previously mirrored stale Webkul widget DOM values to our cards,\n  // causing first-poll desync (stale widget \u2192 revert \u2192 biddingform fix).\n  // Now purely observational \u2014 doBiddingformPoll is the SINGLE AUTHORITY.\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  // v84 CLEANUP: setupDomWatcher was dead code (stripped in v72). Stub kept for caller compatibility.\n  function setupDomWatcher() { }\n\n\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  // WEBKUL BULK API POLL \u2014 cross-device fallback\n  // Uses the SAME endpoint Webkul's own JS calls on the page:\n  //   show_auction_on_category with all spcObj config params\n  // Returns JSONP with per-product HTML templates containing\n  // wk-current-bid, pa-timer, and bidder status.\n  // The individual get_auction_details endpoint returns \"No Record\n  // Found\" for this store, so we MUST use the bulk endpoint.\n  // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n  var _apiPollSetup = false;\n\n  function setupApiPoll() {\n    if (_apiPollSetup) return;\n    var hasWidget = !!document.querySelector('.auction-card-info, #wk-auction');\n    if (!hasWidget) return;\n\n    // spcObj MUST be available (Webkul injects it)\n    if (typeof spcObj === 'undefined' || !spcObj.shop_name || !spcObj.api_url) {\n      console.log('[BCO LiveSync] spcObj not ready \u2014 cannot start API poll');\n      return;\n    }\n    _apiPollSetup = true;\n\n    var polling = false;\n    var tabVisible = !document.hidden;\n    var currentCustId = resolveCurrentCustId();\n\n    // Build product ID list from Webkul widgets on the page\n    function getProductIds() {\n      var ids = [];\n      document.querySelectorAll('.wk-category-auction[data-prod]').forEach(function (w) {\n        var pid = w.getAttribute('data-prod');\n        if (pid && ids.indexOf(pid) === -1) ids.push(pid);\n      });\n      // \u2500\u2500 HOMEPAGE FALLBACK: collect from auction-card-info[data-product-id] \u2500\u2500\n      // On the homepage carousel, Webkul renders wk-category-auction WITHOUT data-prod.\n      // The product ID is set on the auction-card-info overlay element instead.\n      document.querySelectorAll('.auction-card-info[data-product-id]').forEach(function (card) {\n        var cpid = card.getAttribute('data-product-id');\n        if (cpid && ids.indexOf(cpid) === -1) ids.push(cpid);\n      });\n      // \u2500\u2500 HOMEPAGE SLIDER FIX: also pick up data-auction-product-id \u2500\u2500\n      // The homepage slider liquid snippet sets data-auction-product-id (not data-product-id).\n      // Without this, slider cards are never polled and _minBidFromApi is never populated for them.\n      document.querySelectorAll('.auction-card-info[data-auction-product-id]').forEach(function (card) {\n        var apid = card.getAttribute('data-auction-product-id');\n        if (apid && ids.indexOf(apid) === -1) ids.push(apid);\n      });\n      // \u2500\u2500 NEW: Include PDP Main Widget \u2500\u2500\n      var pdp = document.querySelector('#wk-auction');\n      if (pdp) {\n        var pid = pdp.getAttribute('prod-id') || pdp.getAttribute('data-product-id');\n        if (pid && ids.indexOf(pid) === -1) ids.push(pid);\n      }\n      return ids;\n    }\n\n    // Build product-to-auction mapping\n    function buildProdToAuctionMap() {\n      var map = {};\n      document.querySelectorAll('.wk-category-auction[data-prod]').forEach(function (w) {\n        var pid = w.getAttribute('data-prod');\n        if (!pid) return;\n        var gridItem = w.closest('li, .product-card, product-card, .grid__item');\n        var card = gridItem ? gridItem.querySelector('.auction-card-info[data-auction-id]') : null;\n        if (card) {\n          map[pid] = card.getAttribute('data-auction-id');\n        }\n      });\n      return map;\n    }\n\n    // Build the bulk API URL with all required Webkul config params\n    function buildBulkUrl() {\n      var productIds = getProductIds();\n      if (productIds.length === 0) return null;\n\n      var custId = currentCustId || '0';\n      // Try getting cust_id from Webkul widget attribute\n      var wkCustAttr = document.querySelector('.wk-category-auction[cust-id]');\n      if (wkCustAttr) {\n        custId = wkCustAttr.getAttribute('cust-id') || custId;\n      }\n\n      var products = productIds.join(',') + ',';\n\n      // Base64-encode the config objects (same as Webkul's own JS does)\n      var generalConfig = '';\n      try { generalConfig = btoa(JSON.stringify(spcObj.general_config || {})); } catch (e) { /* */ }\n      var auctionConfig = '';\n      try { auctionConfig = btoa(JSON.stringify(spcObj.auction_config || {})); } catch (e) { /* */ }\n      var themeColors = '';\n      try { themeColors = btoa(JSON.stringify(spcObj.theme_colors || {})); } catch (e) { /* */ }\n      var widgetConfig = spcObj.widget_config || '';\n\n      var params = new URLSearchParams();\n      params.append('p', 'wk_ajax_process');\n      params.append('callback', 'show_auction_on_category');\n      params.append('shop_name', spcObj.shop_name);\n      params.append('products', products);\n      params.append('cust_id', custId);\n      if (spcObj.timediff !== undefined) params.append('timediff', String(spcObj.timediff));\n      if (generalConfig) params.append('general_config', encodeURIComponent(generalConfig));\n      if (auctionConfig) params.append('auction_config', encodeURIComponent(auctionConfig));\n      if (widgetConfig) params.append('widget_config', unescape(encodeURIComponent(widgetConfig)));\n      if (themeColors) params.append('theme_colors', encodeURIComponent(themeColors));\n      if (typeof Shopify !== 'undefined' && Shopify.currency) {\n        params.append('active_currency', typeof Shopify.currency === 'object' ? JSON.stringify(Shopify.currency) : String(Shopify.currency));\n      }\n      // Cache bust\n      params.append('_t', Date.now().toString());\n      params.append('_t', String(Date.now()));\n\n      return spcObj.api_url + 'index.php?' + params.toString();\n    }\n\n    // Update a single card from fresh API data\n    // v71: STRIPPED of all DOM writes (price, count, min bid).\n    // doBiddingformPoll is the SINGLE AUTHORITY for card field updates.\n    // This function's only job is to trigger a biddingform refresh so the\n    // authoritative poller picks up the new data.\n    function updateCard(card, freshHtml) {\n      // v99 FIX: The liquid snippet for home page slider uses data-auction-product-id,\n      // not data-product-id. Fall back to it so we can trigger doBiddingformPoll.\n      var productId = card.getAttribute('data-product-id') || card.getAttribute('data-auction-product-id');\n      if (!productId) return;\n\n      // v86 FIX: Re-inject timer from fresh bulk HTML into Webkul's native .pa-timer\n      // This ensures timer extension (popcorn) is reflected on collection cards.\n      // The bulk API returns the server-authoritative timer after Webkul extends\n      // the auction end time. Without this, syncTimers() reads stale digits.\n      try {\n        var tempDoc = new DOMParser().parseFromString(freshHtml, 'text/html');\n        var freshTimer = tempDoc.querySelector('.pa-timer');\n        if (freshTimer) {\n          var freshDigits = freshTimer.querySelectorAll('.pa-theme-color');\n          if (freshDigits.length >= 4) {\n            // Find the native timer for this product\n            var nativeWidget = document.querySelector('.wk-category-auction[data-prod=\"' + productId + '\"]');\n            var nativeTimer = nativeWidget ? nativeWidget.querySelector('.pa-timer') : null;\n            if (nativeTimer) {\n              var nativeDigits = nativeTimer.querySelectorAll('.pa-theme-color');\n              if (nativeDigits.length >= 4) {\n                // Parse both timers to compare\n                var freshD = parseInt(freshDigits[0].textContent) || 0;\n                var freshH = parseInt(freshDigits[1].textContent) || 0;\n                var freshM = parseInt(freshDigits[2].textContent) || 0;\n                var freshS = parseInt(freshDigits[3].textContent) || 0;\n                var freshSecs = freshD * 86400 + freshH * 3600 + freshM * 60 + freshS;\n\n                var nativeD = parseInt(nativeDigits[0].textContent) || 0;\n                var nativeH = parseInt(nativeDigits[1].textContent) || 0;\n                var nativeM = parseInt(nativeDigits[2].textContent) || 0;\n                var nativeS = parseInt(nativeDigits[3].textContent) || 0;\n                var nativeSecs = nativeD * 86400 + nativeH * 3600 + nativeM * 60 + nativeS;\n\n                // MONOTONIC GUARD: Only update if server time is GREATER (extension happened).\n                // The previous abs(diff)>5 drift clause allowed stale responses to overwrite\n                // extended timers during popcorn, causing flicker. Removed per v87 fix.\n                if (freshSecs > nativeSecs) {\n                  scheduleScrollAwareDomWrite(function() {\n                    nativeDigits[0].textContent = String(freshD);\n                    nativeDigits[1].textContent = String(freshH);\n                    nativeDigits[2].textContent = String(freshM);\n                    nativeDigits[3].textContent = String(freshS);\n                  });\n                  console.log('[BCO Timer] Re-injected timer for product ' + productId + ': ' + freshSecs + 's (was ' + nativeSecs + 's)');\n                }\n              }\n            }\n          }\n        }\n      } catch (e) { /* timer sync error, non-blocking */ }\n\n      // Trigger biddingform poll for this specific product.\n      // doBiddingformPoll will update price, count, status, and min bid\n      // from the authoritative per-product API response.\n      if (typeof window._bcoBiddingformPoll === 'function') {\n        window._bcoBiddingformPoll(productId);\n      }\n    }\n\n    function doPoll() {\n      window.bcoDoPoll = doPoll; // Expose for manual triggering\n      if (polling) return;\n      polling = true;\n\n      var url = buildBulkUrl();\n      if (!url) { polling = false; return; }\n\n      fetch(url)\n        .then(function (resp) { return resp.text(); })\n        .then(function (text) {\n          if (!text || text.length < 100) return;\n\n          // Response is JSONP: show_auction_on_category({...})\n          var start = text.indexOf('(');\n          var end = text.lastIndexOf(')');\n          if (start === -1 || end <= start) return;\n\n          var inner = text.substring(start + 1, end);\n          var data;\n          try {\n            data = JSON.parse(inner);\n          } catch (e) {\n            console.log('[BCO LiveSync] API-poll: JSON parse error', e.message);\n            return;\n          }\n\n          // data is { productId: {template: \"html...\"}, ... } or { productId: \"html...\", ... }\n          var prodToAuction = buildProdToAuctionMap();\n\n          Object.keys(data).forEach(function (prodId) {\n            if (prodId === 'theme') return; // skip theme key\n            var raw = data[prodId];\n\n            // Webkul returns objects with a .template property, not raw strings\n            var html = (raw && typeof raw === 'object' && raw.template) ? raw.template : raw;\n            if (!html || typeof html !== 'string' || html.length < 50) return;\n\n\n            // Find ALL widgets for this product (handles aliased IDs)\n            var cards = Array.from(document.querySelectorAll('.auction-card-info[data-product-id=\"' + prodId + '\"]'));\n\n            // Also check for containers where product ID is on the parent\n            var parents = document.querySelectorAll('[data-product-id=\"' + prodId + '\"], product-card[data-product-id=\"' + prodId + '\"]');\n            parents.forEach(function (p) {\n              var widget = p.querySelector('.auction-card-info');\n              if (widget && !cards.includes(widget)) cards.push(widget);\n            });\n\n            // FIX: Also match by data-auction-product-id (set by Liquid before setupBidWidgets runs)\n            // Home page slider cards have data-auction-product-id but not data-product-id when doPoll first fires\n            document.querySelectorAll('.auction-card-info[data-auction-product-id=\"' + prodId + '\"]').forEach(function (c) {\n              if (!cards.includes(c)) cards.push(c);\n            });\n\n            // If no product-based cards found, fallback to the mapped auction ID\n            if (cards.length === 0) {\n              var mappedAuctionId = prodToAuction[prodId];\n              if (mappedAuctionId) {\n                var c = document.querySelector('.auction-card-info[data-auction-id=\"' + mappedAuctionId + '\"]');\n                if (c) cards.push(c);\n              }\n            }\n\n            // FIX: Extract bidder name from bulk HTML BEFORE cards.forEach so the PDP\n            // sync block below can use it too. On PDP, cards is empty (wk-auction is skipped),\n            // so extracting inside the loop meant the PDP block always got an empty name.\n            var _preExtractedName = '';\n            try {\n              var _preParser = new DOMParser();\n              var _preDoc = _preParser.parseFromString(html, 'text/html');\n              var _preNameEl = _preDoc.querySelector('.highest_bidder_name');\n              if (!_preNameEl) {\n                _preDoc.querySelectorAll('div, span, td').forEach(function (el) {\n                  if (!_preNameEl && el.textContent.includes('Highest Bidder:')) {\n                    var parts = el.textContent.split('Highest Bidder:');\n                    if (parts[1] && parts[1].trim() && !parts[1].includes('{')) {\n                      _preNameEl = { textContent: parts[1].replace(/\\\\n/g, '\\n').split('\\n')[0].replace(/\\r/g, '').trim() };\n                    }\n                  }\n                });\n              }\n              _preExtractedName = _preNameEl ? _preNameEl.textContent.trim() : '';\n              if (_preExtractedName) {\n                // Cache immediately so PDP block and doBiddingformPoll can both read it\n                if (_minBidFromApi[prodId]) _minBidFromApi[prodId].highestBidderName = _preExtractedName;\n                else _minBidFromApi[prodId] = { highestBidderName: _preExtractedName };\n              }\n            } catch (e) { /* ignore parse errors */ }\n\n            cards.forEach(function (card) {\n              if (card.id === 'wk-auction') return; // SKIP PDP Widget (Handled explicitly below)\n              updateCard(card, html);\n\n              // Inject pre-extracted bidder name into each card\n              try {\n                var bulkName = _preExtractedName;\n                // GUARD: Never show bidder name on 0-bid cards\n                var bulkCountEl = card.querySelector('.auction-card-info__bid-count');\n                var bulkCountStr = bulkCountEl ? bulkCountEl.textContent.trim() : '';\n                var bulkCountNum = parseInt(bulkCountStr) || 0;\n                var bulkPid = card.getAttribute('data-product-id') || card.getAttribute('data-auction-product-id');\n                if (bulkCountNum === 0 && bulkPid && _minBidFromApi[bulkPid]) {\n                  bulkCountNum = parseInt(_minBidFromApi[bulkPid].bidCount) || 0;\n                }\n                if (bulkCountNum === 0) {\n                  // Clear any stale bidder name on 0-bid card\n                  var staleEl = card.querySelector('.auction-card-info__highest-bidder');\n                  if (staleEl && staleEl.textContent.trim()) staleEl.textContent = '';\n                  var staleRow = card.querySelector('.auction-card-info__bidder-row');\n                  if (staleRow) staleRow.style.display = 'none';\n                  bulkName = ''; // prevent setting\n                }\n                if (bulkName) {\n                  scheduleScrollAwareDomWrite(function() {\n                    var bidderDisplayEl = card.querySelector('.auction-card-info__highest-bidder');\n                    if (!bidderDisplayEl) {\n                      var newBidderRow = document.createElement('div');\n                      newBidderRow.className = 'auction-card-info__meta-row auction-card-info__bidder-row';\n                      var newLbl = document.createElement('span');\n                      newLbl.className = 'auction-card-info__highest-bidder-label';\n                      newLbl.textContent = 'Highest Bidder:';\n                      var newSp = document.createElement('span');\n                      newSp.className = 'auction-card-info__highest-bidder';\n                      newBidderRow.appendChild(newLbl);\n                      newBidderRow.appendChild(newSp);\n                      var srRef = card.querySelector('.auction-card-info__status-row, .auction-card-info__bid-form');\n                      if (srRef) card.insertBefore(newBidderRow, srRef);\n                      else card.appendChild(newBidderRow);\n                      bidderDisplayEl = newSp;\n                    }\n                    if (bidderDisplayEl && bidderDisplayEl.textContent !== bulkName) {\n                      bidderDisplayEl.textContent = formatBidderName(bulkName);\n                    }\n                    // Unhide the bidder row (snippet starts with display:none)\n                    var bulkBidderRow = card.querySelector('.auction-card-info__bidder-row');\n                    if (bulkBidderRow && bulkBidderRow.style.display === 'none') {\n                      bulkBidderRow.style.display = '';\n                    }\n                  });\n                }\n              } catch (e) { /* ignore inject errors */ }\n            });\n\n            // \u2500\u2500 NEW: Explicitly Sync PDP Widget \u2500\u2500\n            var pdpWidget = document.querySelector('#wk-auction');\n            var pdpId = pdpWidget ? (pdpWidget.getAttribute('prod-id') || pdpWidget.getAttribute('data-product-id')) : null;\n\n            // Loose comparison for ID string/number mismatch\n            if (pdpWidget && pdpId && String(pdpId) === String(prodId)) {\n              var parser = new DOMParser();\n              var doc = parser.parseFromString(html, 'text/html');\n\n              // 1. Extract Bid Validated Data\n              // Priority: Generic (.wk-current-bid, aligns with updateCard) > Hidden Input > Main Bid (.font-16)\n              // SCOPED SEARCH: Broaden selector to any element with the ID\n              var responseCard = doc.querySelector('[data-product-id=\"' + prodId + '\"]');\n              var context = responseCard || doc;\n\n              var genericBidEl = context.querySelector('.wk-current-bid');\n              var bidEl = context.querySelector('#current_bid_hidden');\n              var mainBidEl = context.querySelector('.font-16');\n\n              var bidVal = 0;\n              if (genericBidEl) {\n                // Use the selector that worked for updateCard (Home Page got 71)\n                bidVal = parseFloat(genericBidEl.textContent.replace(/[^0-9.]/g, '')) || 0;\n              } else if (bidEl && bidEl.value) {\n                bidVal = parseFloat(bidEl.value.replace(/[^0-9.]/g, '')) || 0;\n              } else if (mainBidEl) {\n                bidVal = parseFloat(mainBidEl.textContent.replace(/[^0-9.]/g, '')) || 0;\n              }\n\n              // Debug logging removed (v65)\n\n              if (bidVal > 0) {\n                var countEl = doc.querySelector('.wk-bid-count');\n                var countVal = countEl ? (parseInt(countEl.textContent) || 0) : 0;\n\n                // 2. IMPORTANT: Scrape & Cache Rules for PDP to ensure applyBiddingRules works!\n                var rulesInput = doc.querySelector('#bidding_rules');\n                var aucIdInput = doc.querySelector('#auction_id') || pdpWidget.querySelector('#auction_id');\n                var aucId = aucIdInput ? aucIdInput.value : null;\n\n                if (rulesInput && rulesInput.value && aucId) {\n                  try {\n                    var freshRules = JSON.parse(rulesInput.value);\n                    if (Array.isArray(freshRules) && freshRules.length > 0) {\n                      _biddingRulesCache[aucId] = freshRules;\n                      // Also link by productId for robustness\n                      _rulesByProductId[prodId] = freshRules;\n                    }\n                  } catch (e) { console.log('[BCO Debug] PDP rule parse fail', e); }\n                }\n\n                // Retrieve the highest bidder name we just extracted and cached from doPoll\n                var pBulkName = _minBidFromApi[prodId] ? _minBidFromApi[prodId].highestBidderName : '';\n\n                // 3. Route through single PDP render function\n                renderPdpState({\n                  productId: prodId,\n                  currentBid: bidVal,\n                  bidCount: countVal,\n                  minBid: applyBiddingRules(bidVal, aucId, prodId),\n                  highestBidderName: pBulkName\n                  // isWinning and hasParticipated are NOT reliable from the generic bulk API response for PDP\n                  // The biddingform API handles that authoritatively.\n                });\n              }\n            }\n          });\n        })\n        .catch(function (err) {\n          console.log('[BCO LiveSync] API-poll error:', err.message);\n        })\n        .finally(function () {\n          polling = false;\n        });\n    }\n\n    // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n    // BIDDINGFORM API POLLER \u2014 fetches server-computed min_bid_amount\n    // per product, exactly like the PDP does via the biddingform callback.\n    // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n    var _bfPolling = false;\n\n    function buildBiddingformUrl(productId) {\n      var params = new URLSearchParams();\n      params.append('p', 'wk_ajax_process');\n      params.append('callback', 'biddingform');\n      params.append('shop_name', spcObj.shop_name);\n      params.append('prod_id', productId);\n      params.append('cust_id', currentCustId || '');\n      params.append('page', 'products');\n      if (spcObj.timediff !== undefined) params.append('timediff', String(spcObj.timediff));\n      try { params.append('general_config', btoa(JSON.stringify(spcObj.general_config || {}))); } catch (e) { /* */ }\n      try { params.append('auction_config', btoa(JSON.stringify(spcObj.auction_config || {}))); } catch (e) { /* */ }\n      try { params.append('theme_colors', btoa(JSON.stringify(spcObj.theme_colors || {}))); } catch (e) { /* */ }\n      params.append('_t', String(Date.now()));\n      return spcObj.api_url + 'index.php?' + params.toString();\n    }\n\n    function fetchMinBidFromApi(productId, callback) {\n      // PROXY FIX v98: Revert to direct Webkul API for individual item polling.\n      // Individual App Proxy calls (/tools/*) for every item cause 500 errors and rate limits.\n      // We now handle authentication separately via fetchBulkParticipation().\n      var url = buildBiddingformUrl(productId);\n      fetch(url)\n        .then(function (resp) { return resp.text(); })\n        .then(function (text) {\n          if (!text || text.length < 50) {\n            if (callback) callback(null);\n            return;\n          }\n\n          console.warn('[BCO DEBUG] Raw payload for ' + productId + ':\\n' + text.substring(0, 1500));\n\n          // \u2500\u2500 Extract ALL useful data from the biddingform JSONP response \u2500\u2500\n          var result = { ts: Date.now() };\n\n          // 0. auction_id (critical for homepage bid submission)\n          //    The biddingform JSONP contains: <input type=\"hidden\" id=\"auction_id\" value=\"123\">\n          var aidMatch = text.match(/id\\s*=\\s*\\\\?\"auction_id\\\\?\"[^>]*value\\s*=\\s*\\\\?\"(\\d+)\\\\?\"/i);\n          if (!aidMatch) aidMatch = text.match(/value\\s*=\\s*\\\\?\"(\\d+)\\\\?\"[^>]*id\\s*=\\s*\\\\?\"auction_id\\\\?\"/i);\n          if (!aidMatch) aidMatch = text.match(/auction_id[^\"]*\"\\s*value\\s*=\\s*\\\\?\"(\\d+)/i);\n          if (aidMatch) {\n            result.auctionId = aidMatch[1];\n          }\n\n          // 1. min_bid_amount (primary \u2014 always extract)\n          var mbMatch = text.match(/var\\s+min_bid_amount\\s*=\\s*([\\d.]+)/);\n          if (mbMatch) {\n            result.minBid = parseFloat(mbMatch[1]);\n          }\n\n          // 2. current_bid \u2014 from hidden input (globals get shadowed by DOM)\n          //    The JSONP wraps HTML in a JS string literal, so quotes appear as\n          //    escaped \\\" in the raw text.  We try BOTH escaped and plain forms.\n          //    Example raw: \\t<input type=\\\"hidden\\\" id=\\\"current_bid_hidden\\\" value=\\\"76.00\\\">\n          var cbMatch = text.match(/id\\s*=\\s*\\\\?\"current_bid_hidden\\\\?\"[^>]*value\\s*=\\s*\\\\?\"([\\d.]+)\\\\?\"/i);\n          if (!cbMatch) cbMatch = text.match(/value\\s*=\\s*\\\\?\"([\\d.]+)\\\\?\"[^>]*id\\s*=\\s*\\\\?\"current_bid_hidden\\\\?\"/i);\n          // Broad fallback: just find current_bid_hidden near a number\n          if (!cbMatch) cbMatch = text.match(/current_bid_hidden[^0-9]*([\\d]+\\.[\\d]+)/i);\n          if (cbMatch) {\n            result.currentBid = parseFloat(cbMatch[1]);\n          }\n\n          // 3. bid_count \u2014 from \"N Bid(s)\" text (works with escaped or plain)\n          var bcElMatch = text.match(/([\\d]+)\\s*Bid\\(s\\)/i);\n          if (bcElMatch) {\n            result.bidCount = parseInt(bcElMatch[1]);\n          } else {\n            // Fallback: try show_bids element or javascript var\n            var bcElMatch2 = text.match(/show_bids[^>]*>([\\d]+)/i);\n            if (bcElMatch2) {\n              result.bidCount = parseInt(bcElMatch2[1]);\n            } else {\n              var parts = text.match(/(\\d+)D\\s+(\\d+)H\\s+(\\d+)M\\s+(\\d+)S/);\n              var bcVarMatch = text.match(/var\\s+bid_count\\s*=\\s*(\\d+)/);\n              if (bcVarMatch) result.bidCount = parseInt(bcVarMatch[1]);\n            }\n          }\n\n          // 3b. Extract Highest Bidder Username using DOMParser\n          // The biddingform response is JSONP with JS-escaped HTML. Regex on the raw\n          // text fails because quotes are backslash-escaped. We use DOMParser which\n          // properly decodes any escaped HTML sequences.\n          try {\n            var bfParser = new DOMParser();\n            // Strip JSONP wrapper: biddingform({...}) or biddingform(\"...\")\n            var bfStart = text.indexOf('(');\n            var bfEnd = text.lastIndexOf(')');\n            var bfInner = (bfStart !== -1 && bfEnd > bfStart) ? text.substring(bfStart + 1, bfEnd) : text;\n            // The content is either a JSON object with an html key, or a raw HTML string\n            var bfHtml = bfInner;\n            try {\n              var bfJson = JSON.parse(bfInner);\n              if (bfJson && typeof bfJson === 'object') {\n                bfHtml = bfJson.html || bfJson.template || bfJson.content || '';\n                if (!bfHtml) bfHtml = Object.values(bfJson).find(v => typeof v === 'string' && v.length > 100) || '';\n              } else if (typeof bfJson === 'string') {\n                bfHtml = bfJson;\n              }\n            } catch (e2) { /* not JSON, use raw inner text */ }\n            var bfDoc = bfParser.parseFromString(bfHtml, 'text/html');\n            // Critical Badge Extraction\n            // Webkul's biddingform response includes CSS rules for .customer_highest_bidder\n            // but NEVER actually renders the HTML element with that class (Webkul proxy bid bug).\n            // So DOMParser-based .customer_highest_bidder queries always return null.\n            // FIX: We use NAME-BASED COMPARISON as the primary winning detection method.\n            var winEl = bfDoc.querySelector('.customer_highest_bidder');\n            var partEl = bfDoc.querySelector('.customer_participated');\n            var bfNameEl = bfDoc.querySelector('.highest_bidder_name, [class*=\"highest_bidder\"] span, .highest-bidder-name');\n            if (!bfNameEl) bfNameEl = bfDoc.querySelector('[class*=\"highest_bidder\"]');\n            \n            // Extract highest bidder name from DOMParser result FIRST (before isWinning check)\n            if (bfNameEl && bfNameEl.textContent.trim()) {\n              var bfParsedName = bfNameEl.textContent.trim();\n              if (!isLikelyBidAmount(bfParsedName)) {\n                result.highestBidderName = bfParsedName;\n              }\n            }\n            \n            // 1. Strict winner check: Webkul actually rendered the element (rare/never for proxy bids)\n            var isStrictWinner = !!(winEl && winEl.textContent && winEl.textContent.trim().length > 3 && (!winEl.hasAttribute('style') || !winEl.getAttribute('style').includes('display: none')));\n            \n            // 2. Name-based winner check: compare extracted bidder name to logged-in customer display name\n            var isNameBasedWinner = false;\n            var custNameMeta = document.querySelector('meta[name=\"logged-in-customer-name\"]');\n            var custDisplayName = custNameMeta ? custNameMeta.content.trim() : '';\n            if (custDisplayName && result.highestBidderName) {\n              // Case-insensitive comparison \u2014 Webkul may format names differently\n              isNameBasedWinner = custDisplayName.toLowerCase() === result.highestBidderName.toLowerCase();\n              if (isNameBasedWinner) {\n                console.log('[BCO] Name-based winning: \"' + result.highestBidderName + '\" matches logged-in customer \"' + custDisplayName + '\"');\n              }\n            }\n            \n            result.isWinning = isStrictWinner || isNameBasedWinner;\n            result.hasParticipated = result.isWinning || !!(partEl && ((partEl.textContent && partEl.textContent.trim().length > 3) || partEl.innerHTML.includes('participated')) && (!partEl.hasAttribute('style') || !partEl.getAttribute('style').includes('display: none')));\n            \n            // STORE: When user is winning, capture their Webkul bidder name for \"You\" override\n            if (result.isWinning && result.highestBidderName && !isLikelyBidAmount(result.highestBidderName)) {\n              _currentUserWebkulName = result.highestBidderName;\n              console.log('[BCO] Stored Webkul identity: \"' + _currentUserWebkulName + '\"');\n            }\n            \n          } catch (e3) { /* DOMParser fallback failed */ }\n          // Regex fallback if DOMParser didn't find a highest bidder name\n          if (!result.highestBidderName) {\n            var hbNameMatch = text.match(/highest_bidder_name\\\\?\"[^>]*>([^<\\r\\n]+)/i);\n            if (!hbNameMatch) hbNameMatch = text.match(/Highest Bidder:\\s*(?:<[^>]+>)*\\s*([^<\\r\\n]+)/i);\n            if (hbNameMatch && hbNameMatch[1]) {\n              var cleanName = hbNameMatch[1]\n                .replace(/\\\\n/g, '\\n').split('\\n')[0]\n                .replace(/\\r/g, '').trim();\n              var looksLikeBid = /^USD\\s/i.test(cleanName) || /^\\$/.test(cleanName) || /^\\d/.test(cleanName);\n              if (cleanName && !cleanName.includes('{') && !cleanName.includes('}') && !looksLikeBid) {\n                result.highestBidderName = cleanName;\n              }\n            }\n            // If name was found via regex and we haven't done the name-based winning check yet, do it now\n            if (result.highestBidderName && !result.isWinning) {\n              var custNameMeta2 = document.querySelector('meta[name=\"logged-in-customer-name\"]');\n              var custDisplayName2 = custNameMeta2 ? custNameMeta2.content.trim() : '';\n              if (custDisplayName2 && custDisplayName2.toLowerCase() === result.highestBidderName.toLowerCase()) {\n                result.isWinning = true;\n                result.hasParticipated = true;\n                _currentUserWebkulName = result.highestBidderName;\n                console.log('[BCO] Regex name-based winning: \"' + result.highestBidderName + '\" matches \"' + custDisplayName2 + '\"');\n              }\n            }\n          }\n\n          // v86 FIX: Extract timer data from biddingform response for precise sync\n          // Strategy 1: Look for formatted \"XD XH XM XS\" in the HTML template\n          var timerMatch = text.match(/(\\d+)D\\s+(\\d+)H\\s+(\\d+)M\\s+(\\d+)S/);\n          if (timerMatch) {\n            result.timerDays = parseInt(timerMatch[1]) || 0;\n            result.timerHours = parseInt(timerMatch[2]) || 0;\n            result.timerMinutes = parseInt(timerMatch[3]) || 0;\n            result.timerSeconds = parseInt(timerMatch[4]) || 0;\n            result.timerTotalSecs = result.timerDays * 86400 + result.timerHours * 3600\n              + result.timerMinutes * 60 + result.timerSeconds;\n          }\n          // Strategy 2 (fallback): Parse \"var time_left_to_end = XXXX;\"\n          // The biddingform response often uses this JS variable instead of\n          // pre-formatted timer text. Convert seconds \u2192 D/H/M/S.\n          if (result.timerTotalSecs === undefined) {\n            var secsMatch = text.match(/time_left_to_end\\s*=\\s*(\\d+)/);\n            if (secsMatch) {\n              var totalSecs = parseInt(secsMatch[1]) || 0;\n              result.timerTotalSecs = totalSecs;\n              result.timerDays = Math.floor(totalSecs / 86400);\n              totalSecs %= 86400;\n              result.timerHours = Math.floor(totalSecs / 3600);\n              totalSecs %= 3600;\n              result.timerMinutes = Math.floor(totalSecs / 60);\n              result.timerSeconds = totalSecs % 60;\n            }\n          }\n\n          // Use currentBid as fallback for minBid if minBid is missing/zero\n          if (!result.minBid && result.currentBid && result.currentBid > 0) {\n            result.minBid = result.currentBid;\n          }\n          if (result.minBid !== undefined && !isNaN(result.minBid) && result.minBid >= 0) {\n            // v11 FIX: Clear bidder name when bid count is 0.\n            // Webkul's API returns stale names from proxy bids even on 0-bid products.\n            if ((result.bidCount || 0) === 0) {\n              result.highestBidderName = '';\n            }\n            result.value = result.minBid || result.currentBid || 0;\n            _minBidFromApi[productId] = result;\n            console.log('[BCO LiveSync] Biddingform: product=' + productId +\n              ' min_bid=' + result.minBid +\n              ' current_bid=' + (result.currentBid || '?') +\n              ' count=' + (result.bidCount || '?') +\n              ' winning=' + result.isWinning);\n            if (callback) callback(result);\n            return;\n          }\n          if (callback) callback(null);\n        })\n        .catch(function (err) {\n          console.log('[BCO LiveSync] Biddingform error for ' + productId + ':', err.message);\n          if (callback) callback(null);\n        });\n    }\n\n    function doBiddingformPoll(singleProductId, forceBypassGuard) {\n      // v7 FIX: forceBypassGuard allows cross-page My Bids to bypass the _bfPolling lock\n      if (_bfPolling && !singleProductId && !forceBypassGuard) return;\n      var productIds = singleProductId ? [singleProductId] : getProductIds();\n      if (productIds.length === 0) return;\n      if (!singleProductId) _bfPolling = true;\n\n      var completed = 0;\n      var total = productIds.length;\n\n      productIds.forEach(function (pid, idx) {\n        // Stagger requests by 80ms to avoid burst\n        setTimeout(function () {\n          fetchMinBidFromApi(pid, function (result) {\n            completed++;\n            if (result !== null) {\n              var ceilMin = Math.ceil(result.minBid);\n              var currentCustId = resolveCurrentCustId();\n\n              // \u2500\u2500 Apply to ALL auction-card-info and wk-category-auction cards \u2500\u2500\n              // Covers: Home, Collection, PDP inline cards, AND YMAL section\n              // Stamp authority timestamp \u2014 updateCard will defer to this\n              _bfLastUpdate[pid] = Date.now();\n\n              var cards = Array.from(document.querySelectorAll('.auction-card-info[data-product-id=\"' + pid + '\"], .wk-category-auction[data-prod=\"' + pid + '\"]'));\n              // FIX: Also match by data-auction-product-id for home page slider cards\n              document.querySelectorAll('.auction-card-info[data-auction-product-id=\"' + pid + '\"]').forEach(function (c) {\n                if (!cards.includes(c)) cards.push(c);\n              });\n              cards.forEach(function (card) {\n                // Batch all DOM writes into a single animation frame to\n                // prevent mid-frame partial updates (price without count, etc.)\n                scheduleScrollAwareDomWrite(function () {\n                  var dom = getCardDom(card);\n                  // v72: First-run unconditional overwrite.\n                  // On the very first biddingform poll for this product, we\n                  // UNCONDITIONALLY overwrite price and count \u2014 no comparison,\n                  // no guard. This ensures stale server-rendered / widget-rendered\n                  // DOM values are replaced immediately. After the first\n                  // authoritative write, subsequent polls use the monotonic guard\n                  // to prevent stale API responses from regressing socket data.\n                  var isFirstRun = !_bfFirstRunDone[pid];\n\n                  // 1. Update current bid and next bid display\n                  var step = result.minBid - result.currentBid;\n                  var curBid4 = card.getAttribute('data-current-bid') || '0';\n                  // Let safeBidWrite's global monotonic guard handle protection\n                  safeBidWrite(pid, function () {\n                    safeInitialBid(card, result.currentBid, result.minBid, step, result.bidCount);\n                  }, curBid4, result.currentBid);\n\n                  // 2. Update bid count (strict monotonic)\n                  if (result.bidCount !== undefined && result.bidCount > 0 && dom.countEl) {\n                    var currentCount = parseInt(dom.countEl.textContent) || 0;\n                    if (result.bidCount >= currentCount) {\n                      dom.countEl.textContent = result.bidCount + (result.bidCount === 1 ? ' bid' : ' bids');\n                    }\n                  }\n\n                  // 2.5 Update Highest Bidder Name\n                  // Auto-inject bidder row if missing (e.g. homepage cards use a stripped template)\n                  // PRIORITY: Fresh authenticated `biddingform` API poll over the guest bulk cache\n                  var highestName = result.highestBidderName || ((_minBidFromApi[pid] && _minBidFromApi[pid].highestBidderName) ? _minBidFromApi[pid].highestBidderName : '');\n                  \n                  // GUARD: If bid count is 0, NEVER show a bidder name \u2014 clear any stale one\n                  var pollBidCount = result.bidCount || 0;\n                  if (pollBidCount === 0) {\n                    highestName = '';\n                    var staleCardBidder = card.querySelector('.auction-card-info__highest-bidder');\n                    if (staleCardBidder && staleCardBidder.textContent.trim()) staleCardBidder.textContent = '';\n                    var staleBidderRow = card.querySelector('.auction-card-info__bidder-row');\n                    if (staleBidderRow) staleBidderRow.style.display = 'none';\n                  }\n                  \n                  // STATUS GUARD: Protect name during post-bid cooldown\n                  const isWinningNow = dom.statusEl && dom.statusEl.classList.contains('is-winning');\n                  const isInCooldown = pid && _postBidCooldown[pid] && (Date.now() - _postBidCooldown[pid] < 20000);\n                  \n                  // DETECT: Capture Webkul bidder name from cooldown or winning state\n                  if (highestName && !isLikelyBidAmount(highestName) && highestName !== '(You)' && highestName !== 'You') {\n                    if (isInCooldown || isWinningNow) {\n                      // After a bid or when winning, the highest bidder name IS the user's Webkul name\n                      _currentUserWebkulName = highestName;\n                      console.log('[BCO] Captured Webkul identity from ' + (isInCooldown ? 'cooldown' : 'winning') + ': \"' + highestName + '\"');\n                    }\n                  }\n                  \n                  if (highestName || (isInCooldown && isWinningNow)) {\n                    var cardBidderEl = card.querySelector('.auction-card-info__highest-bidder');\n                    var writeName = true;\n                    \n                    // If we are in cooldown AND winning, the user expects to see their name.\n                    // If the API hasn't caught up and still returns the old name,\n                    // force the display to 'You' to synchronize with the 'WINNING' status.\n                    if (isInCooldown && isWinningNow && (!highestName || (highestName !== 'You' && highestName !== '(You)'))) {\n                       highestName = 'You';\n                       console.log('[BCO StatusGuard] Forcing bidder name to You during cooldown for ' + pid);\n                    }\n                    \n                    if (writeName) {\n                      if (!cardBidderEl) {\n                      // Row is missing (homepage cards) \u2014 create and insert it before the status row\n                      var bidderRow = document.createElement('div');\n                      bidderRow.className = 'auction-card-info__meta-row auction-card-info__bidder-row';\n                      var bidderLabel = document.createElement('span');\n                      bidderLabel.className = 'auction-card-info__highest-bidder-label';\n                      bidderLabel.textContent = 'Highest Bidder: ';\n                      var bidderSpan = document.createElement('span');\n                      bidderSpan.className = 'auction-card-info__highest-bidder';\n                      bidderSpan.textContent = formatBidderName(highestName);\n                      bidderRow.appendChild(bidderLabel);\n                      bidderRow.appendChild(bidderSpan);\n                      // Insert before status row or append to card\n                      var statusRow = card.querySelector('.auction-card-info__status-row');\n                      if (statusRow) {\n                        card.insertBefore(bidderRow, statusRow);\n                      } else {\n                        var bidFormRow = card.querySelector('.auction-card-info__bid-form');\n                        if (bidFormRow) card.insertBefore(bidderRow, bidFormRow);\n                        else card.appendChild(bidderRow);\n                      }\n                    } else {\n                      if (cardBidderEl.textContent !== highestName) {\n                        cardBidderEl.textContent = formatBidderName(highestName);\n                      }\n                      // Fix: Unhide the bidder row (snippet starts it display:none)\n                      var bfBidderRow = card.querySelector('.auction-card-info__bidder-row');\n                      if (bfBidderRow && bfBidderRow.style.display === 'none') {\n                        bfBidderRow.style.display = '';\n                      }\n                    }\n                  }\n                }\n\n                  // Mark this product as having received its first authoritative write\n                  _bfFirstRunDone[pid] = true;\n\n                  // 3. Update min bid attribute (The safeInitialBid above handles value/min logic)\n                  // FIX: Only overwrite if API's ceilMin is strictly higher than locally calculated nextBid\n                  var calculatedNextBid = parseFloat(card.getAttribute('data-min-bid')) || ceilMin;\n                  card.setAttribute('data-min-bid', String(Math.max(calculatedNextBid, ceilMin)));\n\n                  // v86 FIX: Sync timer from biddingform API (server-authoritative).\n                  // This eliminates the ~30s timer mismatch between PDP and collection\n                  // page by using the same server-computed countdown as PDP.\n                  if (result.timerTotalSecs !== undefined) {\n                    // v87 MONOTONIC GUARD: Compute proposed end timestamp and compare\n                    // against existing. Only update if new end time is >= existing.\n                    // This prevents stale poll responses from reverting an already-extended\n                    // popcorn timer, eliminating the flicker cycle.\n                    var newEndTs = Date.now() + result.timerTotalSecs * 1000;\n                    var existingEndTs = parseInt(card.getAttribute('data-timer-end')) || 0;\n                    var isMonotonicOk = (existingEndTs === 0) || (newEndTs >= existingEndTs);\n\n                    if (isMonotonicOk) {\n                      var timeLeftEl = card.querySelector('.auction-card-info__time-left');\n                      if (timeLeftEl) {\n                        var td = String(result.timerDays).padStart(2, '0');\n                        var th = String(result.timerHours).padStart(2, '0');\n                        var tm = String(result.timerMinutes).padStart(2, '0');\n                        var ts = String(result.timerSeconds).padStart(2, '0');\n                        var newTimerText = result.timerTotalSecs <= 0 ? 'Ended' : td + 'D ' + th + 'H ' + tm + 'M ' + ts + 'S';\n                        timeLeftEl.textContent = newTimerText;\n                      }\n                      // Store end timestamp so syncTimers() can count down locally\n                      // even when no native .pa-timer elements exist (home page).\n                      card.setAttribute('data-timer-end', String(newEndTs));\n                      // Also update native Webkul timer so syncTimers() reads correct values\n                      var nativeWidget = document.querySelector('.wk-category-auction[data-prod=\"' + pid + '\"]');\n                      if (nativeWidget) {\n                        var nativeTimer = nativeWidget.querySelector('.pa-timer');\n                        if (nativeTimer) {\n                          var nativeDigits = nativeTimer.querySelectorAll('.pa-theme-color');\n                          if (nativeDigits.length >= 4) {\n                            nativeDigits[0].textContent = String(result.timerDays);\n                            nativeDigits[1].textContent = String(result.timerHours);\n                            nativeDigits[2].textContent = String(result.timerMinutes);\n                            nativeDigits[3].textContent = String(result.timerSeconds);\n                          }\n                        }\n                      }\n                    } else {\n                      console.log('[BCO Timer] Monotonic block: stale poll for ' + pid + ' (new=' + Math.floor(newEndTs/1000) + ' < existing=' + Math.floor(existingEndTs/1000) + ')');\n                    }\n                  }\n\n                  // 4. Update winning/outbid status badge\n                  // Write auction ID from API if not already set\n                  if (result.auctionId && (!card.getAttribute('data-auction-id') || card.getAttribute('data-auction-id') === '')) {\n                    card.setAttribute('data-auction-id', result.auctionId);\n                    console.log('[BCO LiveSync] Set auction ID from API: product=' + pid + ' auction=' + result.auctionId);\n                  }\n                  var auctionId = card.getAttribute('data-auction-id') || '?';\n\n                  if (dom.statusEl && currentCustId && currentCustId !== '0') {\n                    // IMPORTANT: rely ONLY on result.isWinning from the biddingform API.\n                    // The previous DOM fallback (.customer_highest_bidder querySelector) was\n                    // incorrect: Webkul always renders that element (just hidden via CSS),\n                    // causing every participated card to show WINNING when they may be outbid.\n                    var effectiveWinning = result.isWinning;\n                    var curBid5 = card.getAttribute('data-current-bid') || '0';\n                    safeBidWrite(pid, function () {\n                      // v87: STATUS GUARD \u2014 If the user is currently winning (from a fresh socket/submit),\n                      // do NOT let a stale API poll downgrade them to \"Outbid\" during the cooldown.\n                      if (effectiveWinning) {\n                        dom.statusEl.textContent = '\uD83C\uDFC6 Winning';\n                        dom.statusEl.classList.add('is-winning');\n                        dom.statusEl.classList.remove('is-outbid');\n                        _hasParticipated[auctionId] = true;\n                      } else if (isInCooldown && isWinningNow) {\n                        // Keep Winning status during cooldown if API says otherwise (stale cache)\n                        console.log('[BCO StatusGuard] Keeping WINNING during cooldown for ' + pid);\n                        _hasParticipated[auctionId] = true;\n                      } else if (_hasParticipated[auctionId] || _participationByProductId[pid] || result.hasParticipated) {\n                        dom.statusEl.textContent = '\u26A0\uFE0F Outbid';\n                        dom.statusEl.classList.add('is-outbid');\n                        dom.statusEl.classList.remove('is-winning');\n                        _hasParticipated[auctionId] = true;\n                        if (pid) _participationByProductId[pid] = true;\n                      }\n                    }, curBid5, result.currentBid);\n                  }\n\n                  // Remove awaiting-data placeholder hiding now that\n                  // authoritative API data has been written\n                  card.classList.remove('auction-card-info--awaiting-data');\n                });\n              });\n\n              // \u2500\u2500 Apply to PDP via single render function \u2500\u2500\n              var pdpHighestName = result.highestBidderName || ((_minBidFromApi[pid] && _minBidFromApi[pid].highestBidderName) ? _minBidFromApi[pid].highestBidderName : '');\n              // v81: Set authoritative min BEFORE renderPdpState so the\n              // guard inside renderPdpState uses this value.\n              _pdpAuthoritativeMin = { value: ceilMin, pid: pid, ts: Date.now() };\n\n              renderPdpState({\n                productId: pid,\n                currentBid: result.currentBid,\n                bidCount: result.bidCount,\n                minBid: ceilMin,\n                isWinning: result.isWinning,\n                hasParticipated: result.hasParticipated,\n                highestBidderName: pdpHighestName\n              });\n            }\n            if (completed >= total && !singleProductId) {\n              _bfPolling = false;\n              // If we are currently filtering for My Bids, refresh the filter so freshly fetched items appear\n              if (document.documentElement.classList.contains('bco-filtering-my-bids')) {\n                 if (typeof filterMyBids === 'function') filterMyBids();\n              }\n            }\n          });\n        // v10 PERF: Widen stagger on mobile (200ms vs 80ms) to reduce burst\n        }, singleProductId ? 0 : idx * (_isMobile ? 200 : 80));\n      });\n    }\n\n    // Expose for post-bid forced refresh\n    window._bcoBiddingformPoll = doBiddingformPoll;\n\n    // Poll every 15s on desktop, 25s on mobile (User Requirement: 10-15s desktop)\n    // v10 PERF: Wider interval on mobile to reduce network + CPU pressure\n    var _pollIntervalMs = _isMobile ? 25000 : 15000;\n\n    // v105 FIX: Track scroll state to defer polls during active scrolling.\n    // This prevents layout shifts / visible \"auto-refresh\" while the user is reading.\n    var _userScrolling = false;\n    var _scrollEndTimer = null;\n    var _deferredPoll = false;\n    // v93 FIX: Queue for DOM writes that arrive while user is scrolling.\n    // Poll responses from in-flight requests land asynchronously and write to\n    // 48 cards via requestAnimationFrame, causing visible \"random refresh\" mid-scroll.\n    // By queuing those writes and flushing them in one batch after scroll stops,\n    // the page stays perfectly still while the user is reading/scrolling.\n    var _scrollDomQueue = [];\n    function scheduleScrollAwareDomWrite(fn) {\n      if (_userScrolling) {\n        _scrollDomQueue.push(fn);\n      } else {\n        requestAnimationFrame(fn);\n      }\n    }\n    function flushScrollDomQueue() {\n      if (_scrollDomQueue.length === 0) return;\n      var batch = _scrollDomQueue.splice(0);\n      requestAnimationFrame(function () {\n        for (var i = 0; i < batch.length; i++) batch[i]();\n      });\n    }\n    // v94 FIX: Exposed so code outside setupApiPoll (e.g. the grid watcher in init)\n    // can use it \u2014 calling it directly from there threw a ReferenceError.\n    window._bcoScrollAwareWrite = scheduleScrollAwareDomWrite;\n    window.addEventListener('scroll', function () {\n      _userScrolling = true;\n      clearTimeout(_scrollEndTimer);\n      _scrollEndTimer = setTimeout(function () {\n        _userScrolling = false;\n        // Flush any queued DOM writes first\n        flushScrollDomQueue();\n        // Fire deferred poll now that scrolling has stopped\n        if (_deferredPoll && tabVisible) {\n          _deferredPoll = false;\n          doPoll();\n        }\n      }, 2000);\n    }, { passive: true });\n\n    setInterval(function () {\n      if (!tabVisible) return;\n      // v105: Defer poll if user is actively scrolling\n      if (_userScrolling) {\n        _deferredPoll = true;\n        return;\n      }\n      doPoll();\n      // v105: Removed redundant second doBiddingformPoll() call.\n      // doPoll() \u2192 updateCard() already triggers per-product biddingform polls,\n      // so the 5-second staggered call was doubling DOM writes for no benefit.\n    }, _pollIntervalMs);\n\n    // Immediate poll when tab becomes visible\n    // v95 FIX (mobile \"refresh\" on return): removed the extra full\n    // doBiddingformPoll() that re-fetched and rewrote all 48 cards a second\n    // time on return. doPoll() \u2192 updateCard() already refreshes each card,\n    // and its DOM writes go through the scroll-aware queue.\n    document.addEventListener('visibilitychange', function () {\n      tabVisible = !document.hidden;\n      if (tabVisible) {\n        setTimeout(doPoll, 500);\n      }\n    });\n\n    // Initial polls\n    // v91 PERF: Fire bulk poll immediately (was 500ms). On response, updateCard()\n    // triggers a per-product biddingform fetch for every card in parallel \u2014 this\n    // is the fast path that fills in price/bids/status.\n    doPoll();\n\n    // v91 PERF: Previously a full staggered doBiddingformPoll() ran at 1000ms,\n    // re-fetching EVERY product a second time (80 products \u00D7 80ms stagger \u2248 7s\n    // desktop, \u00D7 200ms \u2248 17s mobile) and competing for connections with the\n    // fast path above. It's now a safety net that only fetches products the\n    // bulk path didn't cover (bulk request failed, product missing from bulk\n    // response, or card only matched via .wk-category-auction[data-prod]).\n    setTimeout(function () {\n      var missing = getProductIds().filter(function (pid) { return !_bfLastUpdate[pid]; });\n      if (missing.length > 0) {\n        console.log('[BCO LiveSync] Safety-net biddingform for ' + missing.length + ' uncovered product(s)');\n        missing.forEach(function (pid, idx) {\n          setTimeout(function () { doBiddingformPoll(pid); }, idx * 50);\n        });\n      }\n      if (document.documentElement.classList.contains('bco-filtering-my-bids') && typeof filterMyBids === 'function') {\n        filterMyBids();\n      }\n    }, _isMobile ? 5000 : 3000);\n\n    console.log('[BCO LiveSync] Webkul bulk API + biddingform poll active (' + getProductIds().length + ' products, shop=' + spcObj.shop_name + ')');\n  }\n\n\n  /**\n   * PDP Glassmorphism: Injects classes and forceful inline styles into Webkul elements.\n   * This is needed because Webkul sets inline styles that override CSS !important rules.\n   */\n  function setupPdpGlassmorphism() {\n    // v90: DISABLED \u2014 CSS-only glassmorphism via auction-card-info.css.\n    // Inline style injection conflicts with Webkul's rendering.\n    return;\n    const topbars = document.querySelectorAll('.hc_cd.at_top');\n    topbars.forEach(function (timer) {\n      // Force sticky positioning via inline style (defeats Webkul's inline position:relative)\n      timer.style.setProperty('position', 'fixed', 'important');\n      timer.style.setProperty('top', '0', 'important');\n      timer.style.setProperty('left', '0', 'important');\n      timer.style.setProperty('width', '100%', 'important');\n      timer.style.setProperty('z-index', '999999', 'important');\n      timer.style.setProperty('background', 'rgba(10, 10, 15, 0.96)', 'important');\n      timer.style.setProperty('backdrop-filter', 'blur(25px)', 'important');\n      timer.style.setProperty('border-bottom', '2px solid rgba(79, 209, 197, 0.45)', 'important');\n      timer.style.setProperty('border-top', 'none', 'important');\n      timer.style.setProperty('border-left', 'none', 'important');\n      timer.style.setProperty('border-right', 'none', 'important');\n      timer.style.setProperty('border-radius', '0', 'important');\n      timer.style.setProperty('padding', '12px 5%', 'important');\n      timer.style.setProperty('margin', '0', 'important');\n      timer.style.setProperty('display', 'flex', 'important');\n      timer.style.setProperty('align-items', 'center', 'important');\n      timer.style.setProperty('justify-content', 'space-between', 'important');\n\n      // \u2500\u2500 Mobile single-line override (inline styles defeat CSS media queries) \u2500\u2500\n      var isMobile = window.innerWidth <= 600;\n      if (isMobile) {\n        timer.style.setProperty('flex-direction', 'row', 'important');\n        timer.style.setProperty('flex-wrap', 'nowrap', 'important');\n        timer.style.setProperty('padding', '6px 3%', 'important');\n        timer.style.setProperty('gap', '8px', 'important');\n        timer.style.setProperty('justify-content', 'center', 'important');\n        timer.style.setProperty('min-height', '36px', 'important');\n      }\n\n      // \u2500\u2500 2. Remove borders from all descendant elements \u2500\u2500\n      timer.querySelectorAll('*').forEach(function (el) {\n        el.style.setProperty('border', 'none', 'important');\n        el.style.setProperty('background', 'transparent', 'important');\n        el.style.setProperty('box-shadow', 'none', 'important');\n        el.style.setProperty('border-radius', '0', 'important');\n      });\n\n      // \u2500\u2500 3. Style the heading text (AUCTION ROUND ENDS) \u2500\u2500\n      // Try multiple heading selectors used by Webkul\n      var headings = timer.querySelectorAll('p, .hc_cd-title, > div:first-child, > div:first-child p, > div:first-child span');\n      headings.forEach(function (h) {\n        if (!h.closest('.hc_cd-timer')) { // Only target heading, not timer digits\n          h.style.setProperty('color', '#4fd1c5', 'important');\n          h.style.setProperty('font-weight', '800', 'important');\n          h.style.setProperty('letter-spacing', isMobile ? '0.08em' : '0.2em', 'important');\n          h.style.setProperty('text-transform', 'uppercase', 'important');\n          h.style.setProperty('font-size', isMobile ? '9px' : '13px', 'important');\n          h.style.setProperty('text-shadow', '0 0 15px rgba(79, 209, 197, 0.6)', 'important');\n          h.style.setProperty('white-space', 'nowrap', 'important');\n        }\n      });\n\n      // Round 13 code removed in favor of Global Sync Round 14 at top of file\n\n      var numEls = timer.querySelectorAll('.hc_cd_timernum, .hc_time, [class*=\"timernum\"], [class*=\"timer_num\"]');\n      numEls.forEach(function (el) {\n        el.style.setProperty('color', '#4fd1c5', 'important');\n        el.style.setProperty('font-weight', '800', 'important');\n        el.style.setProperty('font-size', isMobile ? '15px' : '22px', 'important');\n      });\n\n      // \u2500\u2500 5. Style the countdown labels (Days, Hours, etc.) \u2500\u2500\n      var labelEls = timer.querySelectorAll('.hc_cd_timerlabel, .hc_label, [class*=\"timerlabel\"], [class*=\"timer_label\"]');\n      labelEls.forEach(function (el) {\n        el.style.setProperty('color', '#ffffff', 'important');\n        el.style.setProperty('opacity', '0.8', 'important');\n        el.style.setProperty('font-size', isMobile ? '8px' : '10px', 'important');\n        el.style.setProperty('letter-spacing', isMobile ? '1px' : '2px', 'important');\n        el.style.setProperty('text-transform', 'uppercase', 'important');\n      });\n\n      // \u2500\u2500 6. Hide separators (colons) \u2500\u2500\n      var seps = timer.querySelectorAll('.hc_sep, [class*=\"sep\"]');\n      seps.forEach(function (el) { el.style.setProperty('display', 'none', 'important'); });\n    });\n\n    // \u2500\u2500 7. Add top padding to body so content doesn't hide under the fixed bar \u2500\u2500\n    if (topbars.length > 0 && window.location.pathname.includes('/products/')) {\n      document.body.style.setProperty('padding-top', '65px', 'important');\n    }\n\n    // \u2500\u2500 8. Target the main container \u2500\u2500\n    var containers = document.querySelectorAll('.wk_auction_container, #wk-auction');\n    containers.forEach(function (container) {\n      if (!container.classList.contains('auction-glass-container')) {\n        container.classList.add('auction-glass-container');\n      }\n    });\n\n    // \u2500\u2500 9. Clean up row dividers \u2500\u2500\n    document.querySelectorAll('.margin-top-15.pa-bdr').forEach(function (row) {\n      row.style.border = 'none';\n      row.style.borderBottom = '1px solid rgba(255,255,255,0.08)';\n    });\n  }\n\n  /**\n   * Enhance Bid Input with +/- Stepper buttons (PDP Version)\n   * \n   * Strategy: Instead of wrapping the Webkul input (which breaks its flex row),\n   * inject a standalone stepper control ABOVE the Webkul bid row. The stepper\n   * syncs its displayed value to the actual #bid_amount so Webkul's form works.\n   */\n  function setupPdpStepper() {\n    // v90: DISABLED \u2014 Use Webkul's native bid input and Place Bid button.\n    // DOM restructuring (hiding inputs, moving buttons) breaks Webkul's re-render.\n    return;\n    var inputs = document.querySelectorAll('#bid_amount, #wk_bid_amount');\n    inputs.forEach(function (input) {\n      if (input.hasAttribute('data-enhanced')) return;\n\n      // Scoping: Only enhance the MAIN product input on PDP.\n      var isInsideCard = input.closest('.auction-card-info');\n      if (isInsideCard) return;\n\n      // Find the Webkul bid container \u2014 insert stepper as its first child\n      // This puts the stepper right above the input+PLACE BID row\n      var wkContainer = input.closest('.wk_auction_container, #wk-auction, .wk-bid-section');\n      var insertTarget = wkContainer || input.parentNode;\n\n      // Get starting value\n      var startVal = parseFloat(input.value) || parseFloat(input.getAttribute('min')) || 1;\n\n      // Build the standalone stepper (injected ABOVE the Webkul row)\n      var stepper = document.createElement('div');\n      stepper.className = 'auction-product-page-stepper';\n      stepper.id = 'bco-pdp-stepper';\n\n      var minusBtn = document.createElement('button');\n      minusBtn.type = 'button';\n      minusBtn.className = 'auction-card-info__step-button auction-card-info__step-button--minus';\n      minusBtn.innerHTML = '-';\n      minusBtn.style.cssText = 'position: relative !important; display: flex !important; align-items: center !important; justify-content: center !important; width: 70px !important; height: 70px !important; flex-shrink: 0 !important; font-size: 36px !important; background-color: transparent !important; background-image: none !important; color: white !important; border: none !important; z-index: 10 !important; opacity: 1 !important; visibility: visible !important; margin: 0 !important; padding: 0 !important; font-family: sans-serif !important; flex-basis: 70px !important; line-height: 1 !important;';\n\n      var display = document.createElement('div');\n      display.className = 'auction-card-info__stepper-display';\n      display.style.cssText = 'flex: 1 1 auto !important; display: flex !important; align-items: center !important; justify-content: center !important; background: transparent !important; border: none !important; min-width: 0 !important;';\n      \n      // Use an editable input instead of a span so users can type bid amounts\n      var valueInput = document.createElement('input');\n      valueInput.type = 'number';\n      valueInput.className = 'auction-card-info__stepper-value auction-card-info__input';\n      valueInput.value = startVal;\n      valueInput.min = startVal;\n      valueInput.step = '1';\n      valueInput.setAttribute('inputmode', 'decimal');\n      // Make input wider, larger font, no background\n      valueInput.style.cssText = 'background:transparent !important; border:none !important; color:white !important; font-size:28px !important; font-weight:700 !important; text-align:center !important; width:100% !important; min-width: 0 !important; outline:none !important; -moz-appearance:textfield; padding: 0 !important; margin: 0 !important; box-shadow: none !important; height: 70px !important; z-index: 5 !important;';\n\n      var currSymbol = document.createElement('span');\n      currSymbol.className = 'auction-card-info__currency-symbol';\n      currSymbol.textContent = '$';\n      currSymbol.style.cssText = 'color: rgba(255,255,255,0.6) !important; font-size: 20px !important; padding-right: 4px !important;';\n      display.appendChild(currSymbol);\n      display.appendChild(valueInput);\n\n      var plusBtn = document.createElement('button');\n      plusBtn.type = 'button';\n      plusBtn.className = 'auction-card-info__step-button auction-card-info__step-button--plus';\n      plusBtn.innerHTML = '+';\n      plusBtn.style.cssText = 'position: relative !important; display: flex !important; align-items: center !important; justify-content: center !important; width: 70px !important; height: 70px !important; flex-shrink: 0 !important; font-size: 36px !important; background-color: transparent !important; background-image: none !important; color: white !important; border: none !important; z-index: 10 !important; opacity: 1 !important; visibility: visible !important; margin: 0 !important; padding: 0 !important; font-family: sans-serif !important; flex-basis: 70px !important; line-height: 1 !important;';\n\n      stepper.appendChild(minusBtn);\n      stepper.appendChild(display);\n      stepper.appendChild(plusBtn);\n\n      // v88 FIX: Align stepper + Place Bid button horizontally.\n      // Previous code forced flex-direction:column which stacked them vertically.\n      // Now we wrap both in a single flex row for proper alignment.\n      var bidInputRow = input.parentNode;\n      if (bidInputRow && bidInputRow.parentNode) {\n        // Find the Place Bid button in the Webkul row\n        var placeBidBtn = bidInputRow.querySelector('.wk_submit_bid, #pa_place_bid_link, #pa_place_bid');\n\n        // Create a vertical wrapper for stepper + button (user requested Place Bid on another row)\n        var bidRowWrapper = document.createElement('div');\n        bidRowWrapper.className = 'bco-pdp-bid-row clearfix';\n        \n        // Use a block layout instead of flex to absolutely guarantee vertical stacking\n        bidRowWrapper.style.cssText = 'display:block;width:100%;margin-top:10px;text-align:center;box-sizing:border-box;clear:both;';\n\n        // Insert wrapper where the bid row was\n        bidInputRow.parentNode.insertBefore(bidRowWrapper, bidInputRow);\n\n        // Move stepper into wrapper\n        // Wrap the stepper in its own centered block\n        var stepperWrapper = document.createElement('div');\n        stepperWrapper.style.cssText = 'display:flex;justify-content:center;margin-bottom:15px;width:100%;';\n        \n        stepper.style.setProperty('flex', '1 1 auto', 'important');\n        stepper.style.setProperty('width', '100%', 'important');\n        stepper.style.setProperty('max-width', '100%', 'important');\n        stepper.style.setProperty('height', '70px', 'important');\n        stepper.style.setProperty('border-radius', '35px', 'important');\n        stepper.style.setProperty('border', '1px solid rgba(255,255,255,0.2)', 'important');\n        stepper.style.setProperty('background', 'rgba(0,0,0,0.4)', 'important');\n        stepper.style.setProperty('box-sizing', 'border-box', 'important');\n        stepper.style.setProperty('overflow', 'hidden', 'important');\n        stepperWrapper.appendChild(stepper);\n        bidRowWrapper.appendChild(stepperWrapper);\n\n        // Search broader for the Place Bid button inside the entire Webkul container\n        if (!placeBidBtn && insertTarget) {\n            placeBidBtn = insertTarget.querySelector('.wk_submit_bid, #pa_place_bid_link, #pa_place_bid, button[type=\"submit\"]');\n        }\n\n        // Move Place Bid button into wrapper (beside stepper)\n        if (placeBidBtn) {\n          // Style the button to match stepper height and prevent native absolute position overlapping\n          placeBidBtn.style.setProperty('margin', '20px auto 0 auto', 'important'); // spacing between stepper and button\n          placeBidBtn.style.setProperty('display', 'flex', 'important');\n          placeBidBtn.style.setProperty('justify-content', 'center', 'important');\n          placeBidBtn.style.setProperty('align-items', 'center', 'important');\n          placeBidBtn.style.setProperty('width', '100%', 'important');\n          placeBidBtn.style.setProperty('max-width', '100%', 'important');\n          placeBidBtn.style.setProperty('height', '70px', 'important');\n          placeBidBtn.style.setProperty('font-size', '20px', 'important');\n          placeBidBtn.style.setProperty('border-radius', '35px', 'important');\n          placeBidBtn.style.setProperty('position', 'relative', 'important');\n          placeBidBtn.style.setProperty('left', 'auto', 'important');\n          placeBidBtn.style.setProperty('right', 'auto', 'important');\n          placeBidBtn.style.setProperty('transform', 'none', 'important');\n          bidRowWrapper.appendChild(placeBidBtn);\n        }\n\n        // Hide the original Webkul bid row (contains only the hidden input now)\n        bidInputRow.style.setProperty('display', 'none', 'important');\n      } else {\n        // Fallback: first child of wkContainer\n        insertTarget.insertBefore(stepper, insertTarget.firstChild);\n      }\n\n      // Keep real Webkul input in sync (Webkul reads it for submission)\n      input.style.setProperty('display', 'none', 'important');\n      input.setAttribute('data-enhanced', 'true');\n      input.value = startVal;\n\n      // Sync valueInput \u2192 hidden Webkul input on every change\n      function syncToWebkul(newVal) {\n        var minVal = parseFloat(input.getAttribute('min')) || 1;\n        if (newVal < minVal) newVal = minVal;\n        input.value = newVal;\n        valueInput.value = newVal;\n        // Trigger Webkul's listeners\n        input.dispatchEvent(new Event('input', { bubbles: true }));\n        input.dispatchEvent(new Event('change', { bubbles: true }));\n      }\n\n      // Manual typing in the visible input\n      valueInput.addEventListener('change', function () {\n        syncToWebkul(parseFloat(valueInput.value) || 1);\n      });\n      valueInput.addEventListener('input', function () {\n        // Live-sync to hidden input as user types\n        input.value = valueInput.value;\n      });\n\n      // Attach WeakMap editing guard so WebSocket sync doesn't overwrite while typing\n      valueInput.addEventListener('focus', function () { markEditing(valueInput); markEditing(input); });\n      valueInput.addEventListener('input', function () { markEditing(valueInput); markEditing(input); });\n      valueInput.addEventListener('blur', function () {\n        setTimeout(function () {\n          if (valueInput !== document.activeElement) {\n            clearEditing(valueInput);\n            clearEditing(input);\n          }\n        }, 500);\n      });\n\n      minusBtn.addEventListener('click', function (e) {\n        e.preventDefault();\n        e.stopPropagation();\n        markEditing(valueInput);\n        markEditing(input);\n        syncToWebkul((parseFloat(valueInput.value) || 1) - 1);\n      });\n\n      plusBtn.addEventListener('click', function (e) {\n        e.preventDefault();\n        e.stopPropagation();\n        markEditing(valueInput);\n        markEditing(input);\n        syncToWebkul((parseFloat(valueInput.value) || 1) + 1);\n      });\n\n      // Keep stepper value in sync if Webkul changes the input externally\n      var observer = new MutationObserver(function () {\n        if (isUserEditing(valueInput)) return; // don't overwrite while user is typing\n        var v = parseFloat(input.value) || 1;\n        if (String(valueInput.value) !== String(v)) valueInput.value = v;\n      });\n      observer.observe(input, { attributes: true, attributeFilter: ['value'] });\n      input.addEventListener('change', function () {\n        if (!isUserEditing(valueInput)) {\n          valueInput.value = parseFloat(input.value) || 1;\n        }\n      });\n\n      console.log('[BCO PDP] Standalone stepper installed above bid row.');\n    });\n  }\n\n  /**\n   * Auction Tabs Setup\n   * Handles switching between \"Running\" and \"Upcoming\" auctions.\n   */\n  function setupAuctionTabs() {\n    const tabContainer = document.querySelector('.auction-tabs');\n    const tabs = document.querySelectorAll('.auction-tab-trigger');\n    if (tabs.length === 0) return;\n\n    if (tabContainer) {\n      tabContainer.style.display = 'flex';\n      tabContainer.style.gap = '20px';\n      tabContainer.style.marginBottom = '20px';\n      tabContainer.style.borderBottom = '1px solid rgba(255,255,255,0.1)';\n      tabContainer.style.paddingBottom = '10px';\n    }\n\n    if (tabContainer) {\n      tabContainer.style.setProperty('display', 'flex', 'important');\n      tabContainer.style.setProperty('flex-direction', 'row', 'important');\n      tabContainer.style.setProperty('justify-content', 'flex-start', 'important');\n      tabContainer.style.setProperty('gap', '30px', 'important');\n      tabContainer.style.setProperty('margin-bottom', '30px', 'important');\n      tabContainer.style.setProperty('border-bottom', '1px solid rgba(255,255,255,0.1)', 'important');\n      tabContainer.style.setProperty('padding', '0 0 15px 0', 'important');\n      tabContainer.style.setProperty('width', '100%', 'important');\n    }\n\n    tabs.forEach(tab => {\n      tab.style.setProperty('cursor', 'pointer', 'important');\n      tab.style.setProperty('padding', '10px 0', 'important');\n      tab.style.setProperty('font-size', '15px', 'important');\n      tab.style.setProperty('text-transform', 'uppercase', 'important');\n      tab.style.setProperty('background', 'none', 'important');\n      tab.style.setProperty('border', 'none', 'important');\n      tab.style.setProperty('border-radius', '0', 'important');\n      tab.style.setProperty('margin', '0', 'important');\n      tab.style.setProperty('color', 'rgba(255,255,255,0.6)', 'important');\n      tab.style.setProperty('white-space', 'nowrap', 'important');\n\n      // Inject initial active state style if missing\n      if (tab.classList.contains('is-active')) {\n        tab.style.setProperty('color', '#fff', 'important');\n        tab.style.setProperty('border-bottom', '2px solid #4fd1c5', 'important');\n        tab.style.setProperty('font-weight', '700', 'important');\n      }\n\n      tab.addEventListener('click', function () {\n        const targetTab = this.getAttribute('data-tab');\n\n        tabs.forEach(t => {\n          t.classList.remove('is-active');\n          t.style.color = 'rgba(255,255,255,0.6)';\n          t.style.borderBottom = 'none';\n          t.style.fontWeight = '600';\n        });\n        this.classList.add('is-active');\n        this.style.color = '#fff';\n        this.style.borderBottom = '2px solid #4fd1c5';\n        this.style.fontWeight = '700';\n\n        // Filter Grid Items\n        const gridItems = document.querySelectorAll('#products_on_auction .wkgrid, #products_on_auction .product-card, #products_on_auction .grid-product');\n        gridItems.forEach(item => {\n          // Webkul usually adds .wk_upcoming or similar, or we check for timer absence/text\n          const isUpcoming =\n            item.classList.contains('wk_upcoming') ||\n            item.textContent.includes('Upcoming') ||\n            item.innerHTML.includes('upcoming') ||\n            item.hasAttribute('data-upcoming') ||\n            (item.querySelector('.wk-auction-timer') === null && item.querySelector('.pa-timer') === null);\n\n          if (targetTab === 'upcoming') {\n            item.style.setProperty('display', isUpcoming ? '' : 'none', 'important');\n          } else {\n            item.style.setProperty('display', isUpcoming ? 'none' : '', 'important');\n          }\n        });\n\n        console.log('[BCO Tabs] Switched to: ' + targetTab);\n      });\n    });\n  }\n\n  /**\n   * App Grid Injection \u2014 v82\n   * Targets the /pages/products-on-auction-1 app-injected grid.\n   */\n  function setupAppGridInjection() {\n    var target = document.querySelector('#products_on_auction');\n    if (!target) return; // CRITICAL: Stop the injection script from shattering the native Home Page liquid sliders\n\n    var blueprint = document.querySelector('#bco-auction-blueprint .auction-card-info');\n\n    // \u2500\u2500 LAYOUT FIX: Move Webkul Search and Sort into ONE Flexbox Row (Rev 3) \u2500\u2500\n    var actionRow = document.querySelector('.collection-filter__item--auction-actions');\n    if (actionRow && target) {\n      // 1. Move Search\n      var searchInput = target.querySelector('input#wk_pa_search');\n      if (searchInput && !searchInput.hasAttribute('data-relocated')) {\n        var searchGroup = document.createElement('div');\n        searchGroup.className = 'bco-search-group pa-wk-form-group';\n\n        var searchIcon = target.querySelector('#wk_pa_search_icon') || target.querySelector('.pa-search-btn');\n        if (searchIcon) {\n          searchGroup.appendChild(searchIcon);\n          searchIcon.classList.add('pa-search-btn');\n        }\n\n        // Reparent input\n        searchGroup.appendChild(searchInput);\n        searchInput.setAttribute('data-relocated', 'true');\n        actionRow.appendChild(searchGroup);\n\n        // --- BCO Custom Search Listener ---\n        // Because we relocated the search input out of Webkul's native container,\n        // Webkul's script (spObj.beforeProductOnAuctionSubmit) can no longer find it.\n        // We must manually intercept the enter block and icon clicks.\n        function executeSearch() {\n          var term = searchInput ? searchInput.value.trim() : '';\n          var sortSelectEl = document.querySelector('select#sort_by');\n          var sortVal = sortSelectEl ? sortSelectEl.value : '';\n\n          var params = new URLSearchParams(window.location.search);\n          if (term) params.set('s', term);\n          else params.delete('s');\n\n          if (sortVal) params.set('sort_by', sortVal);\n          else params.delete('sort_by');\n\n          window.location.href = window.location.pathname + '?' + params.toString();\n        }\n\n        // Listen for Enter Key\n        searchInput.addEventListener('keypress', function (e) {\n          if (e.key === 'Enter') {\n            e.preventDefault();\n            executeSearch();\n          }\n        });\n\n        // Listen for Icon Click\n        if (searchIcon) {\n          searchIcon.addEventListener('click', function (e) {\n            e.preventDefault();\n            e.stopPropagation(); // Stop Webkul from trying to fire null\n            executeSearch();\n          });\n        }\n      }\n\n      // 2. Move Sort\n      var sortSelect = target.querySelector('select#sort_by');\n      if (sortSelect && !sortSelect.hasAttribute('data-relocated')) {\n        var sortGroup = document.createElement('div');\n        sortGroup.className = 'bco-sort-group pa-wk-form-group';\n\n        // Hide original label if it exists\n        var sortLabel = target.querySelector('#wk_pa_sort_by_label');\n        if (sortLabel) sortLabel.style.display = 'none';\n\n        sortGroup.appendChild(sortSelect);\n        sortSelect.setAttribute('data-relocated', 'true');\n        actionRow.appendChild(sortGroup);\n\n        // Listen for Sort Change\n        sortSelect.addEventListener('change', function (e) {\n          e.preventDefault();\n          e.stopPropagation();\n          // We must redefine executeSearch here or just call it if it's hoisted.\n          // Because executeSearch is defined inside the IF block above, we'll\n          // rebuild the URL manually or assume executeSearch is globally accessible \n          // within setupAppGridInjection. Let's build it to be safe.\n          var termEl = document.querySelector('input#wk_pa_search');\n          var term = termEl ? termEl.value.trim() : '';\n          var sortVal = sortSelect.value;\n\n          var params = new URLSearchParams(window.location.search);\n          if (term) params.set('s', term);\n          else params.delete('s');\n\n          if (sortVal) params.set('sort_by', sortVal);\n          else params.delete('sort_by');\n\n          window.location.href = window.location.pathname + '?' + params.toString();\n        });\n      }\n    }\n\n    // Comprehensive Cleanup: Hide Webkul containers globally\n    document.querySelectorAll('.wk-search-sort-row, .wk_search_sort_div, .wk-searchbox-left, .wk-searchbox-button-right, .wk-sort-by-selector-right').forEach(function (el) {\n      if (!el.closest('.collection-filter')) {\n        el.style.setProperty('display', 'none', 'important');\n      }\n    });\n\n    // Find the master blueprint once outside the loop\n    var masterBlueprint = null;\n    var allBlueprints = document.querySelectorAll('.auction-card-info');\n    for (var i = 0; i < allBlueprints.length; i++) {\n      if (!allBlueprints[i].closest('.wkgrid')) {\n        masterBlueprint = allBlueprints[i];\n        break;\n      }\n    }\n\n    // v84 CLEANUP: Disabled pagination interceptor REMOVED.\n    // The entire block was dead code \u2014 it had `return;` at line 4903\n    // making everything after it unreachable. Webkul handles pagination natively.\n    if (target && !target.hasAttribute('data-pagination-bound')) {\n      target.setAttribute('data-pagination-bound', 'true');\n    }\n\n    var wkRows = target ? target.querySelectorAll('.wkcol-md-3, .wkcol-md-4, .wkgrid') :\n      document.querySelectorAll('#products_on_auction .wkcol-md-3, #products_on_auction .wkcol-md-4, .wkgrid');\n\n    wkRows.forEach(function (gridItem) {\n      // v92 PERF: Skip nodes detached while processing their parent card\n      // (inner .wkcol-md-3 columns). They used to fire a 404 product fetch each.\n      if (!gridItem.isConnected) return;\n      var currentHandle = '';\n      var viewLink = gridItem.querySelector('a[href*=\"/products/\"]');\n      if (viewLink) {\n        var href = viewLink.getAttribute('href');\n        currentHandle = href.split('/').pop().split('?')[0].split('#')[0].trim();\n      }\n\n      // If Webkul stripped the anchor, we must manufacture a dummy handle \n      // otherwise this function aborts and the item remains an unstyled black square.\n      // NOTE: .wkgrid on the custom app page does NOT have data-prod, so rely on auctionId if needed.\n      var auctionId = '';\n      var timerEl = gridItem.querySelector('[id^=\"auction_poa_\"], [id^=\"auction_\"]');\n      if (timerEl) {\n        var idMatch = timerEl.id.match(/auction(?:_poa)?_(\\d+)/);\n        if (idMatch) {\n          auctionId = idMatch[1];\n        }\n      }\n\n      if (!currentHandle) {\n         var pId = gridItem.getAttribute('data-prod') || gridItem.querySelector('[data-prod]')?.getAttribute('data-prod') || gridItem.querySelector('.wk-category-auction')?.getAttribute('data-prod');\n         if (pId) {\n             currentHandle = 'proxy-product-' + pId;\n         } else if (auctionId) {\n             currentHandle = 'proxy-auction-' + auctionId;\n         } else {\n             // Absolute last resort: Math.random so it physically cannot abort\n             currentHandle = 'proxy-unknown-' + Math.floor(Math.random() * 100000);\n         }\n      }\n\n      // Self-healing: if it's already injected AND has our title, skip.\n      // Otherwise (if wiped by Webkul), re-inject.\n      if (gridItem.hasAttribute('data-injected') && gridItem.querySelector('.auction-card-info__title-header')) {\n        return;\n      }\n\n      // CRITICAL: Block the native injection script from maliciously overwriting the clones\n      // brought in by fetchNextPage, which are already fully processed!\n      if (gridItem.classList.contains('bco-filter-processed') || gridItem.querySelector('.bco-filter-processed')) {\n        return;\n      }\n\n      if (!currentHandle) return;\n      var handle = currentHandle;\n\n      gridItem.setAttribute('data-injected', 'true');\n\n      // \u2500\u2500 Extract Product Title & Highest Bidder Username from Native DOM \u2500\u2500\n      var productTitle = '';\n      var titleSelectors = [\n        '.pa-col-md-9 a b',\n        '.product-title',\n        'h3.product-card__title',\n        '.grid-view-item__title',\n        '.wk-category-auction-title',\n        '.pa-col-md-9 h3',\n        '.wk_products_row b'\n      ];\n\n      for (var s = 0; s < titleSelectors.length; s++) {\n        var tEl = gridItem.querySelector(titleSelectors[s]);\n        if (tEl && tEl.textContent.trim()) {\n          productTitle = tEl.textContent.trim();\n          break;\n        }\n      }\n\n      // If still empty, try to salvage from handle (last resort)\n      if (!productTitle && handle) {\n        productTitle = handle.replace(/-/g, ' ').replace(/\\b\\w/g, function (l) { return l.toUpperCase(); });\n      }\n\n      console.log('[BCO Grid] Extracted title for ' + handle + ': ' + productTitle);\n\n      var highestBidderName = '';\n\n      // Helper: reject strings that look like bid amounts (e.g. \"USD 54 (You)\", \"$50\")\n      function isValidBidderName(s) {\n        if (!s || s.length < 2) return false;\n        if (/^\\$/.test(s)) return false;            // starts with $\n        if (/^USD\\s/i.test(s)) return false;         // starts with \"USD \"\n        if (/^\\d/.test(s)) return false;             // starts with a digit\n        if (/\\(You\\)/i.test(s)) return false;        // Webkul \"(You)\" bid annotation\n        return true;\n      }\n\n      // 1. Try to fetch from explicit native class first\n      var nativeNameEl = gridItem.querySelector('.highest_bidder_name');\n      if (nativeNameEl && isValidBidderName(nativeNameEl.textContent.trim())) {\n        highestBidderName = nativeNameEl.textContent.trim();\n      } else {\n        // 2. Fallback to broad text search \u2014 but validate what we extract\n        gridItem.querySelectorAll('div, span, p').forEach(function (el) {\n          if (el.textContent && el.textContent.includes('Highest Bidder:') && !el.classList.contains('auction-card-info__highest-bidder-label')) {\n            var parts = el.textContent.split('Highest Bidder:');\n            if (parts.length > 1) {\n              var candidate = parts[1].trim();\n              if (isValidBidderName(candidate)) {\n                highestBidderName = candidate;\n              }\n            }\n          }\n        });\n      }\n\n      // \u2500\u2500 CREATE TOP IMAGE WRAPPER \u2500\u2500\n      var imgWrap = gridItem.querySelector('.wkcol-md-3 > a, .pa-col-md-3 > a, a:has(img)');\n      if (!imgWrap) imgWrap = gridItem.querySelector('.wkcol-md-3 a, a');\n\n      var topWrapper = document.createElement('div');\n      topWrapper.className = 'auction-product-top-image product-card__image-wrapper';\n      if (imgWrap) {\n        imgWrap.style.display = 'block';\n        imgWrap.style.width = '100%';\n        var img = imgWrap.querySelector('img');\n        if (img) {\n          img.style.width = '100%';\n          img.style.height = 'auto';\n          img.style.aspectRatio = '1/1';\n          img.style.objectFit = 'cover';\n          img.setAttribute('loading', 'lazy');\n          bcoShrinkGridImage(img); // v95: no-op if the grid watcher already resized it\n        }\n        topWrapper.appendChild(imgWrap);\n      }\n\n      // \u2500\u2500 CREATE STABLE TITLE CONTAINER (Outside auctionCard) \u2500\u2500\n      var titleContainer = document.createElement('div');\n      titleContainer.className = 'auction-card-info__title-header product-card__title-row';\n      titleContainer.style.padding = '10px 14px 4px';\n\n      var titleLink = document.createElement('a');\n      titleLink.href = href;\n      titleLink.className = 'auction-card-info__product-name product-card__title';\n      titleLink.textContent = productTitle;\n      titleLink.style.display = 'block';\n      titleLink.style.fontSize = '1.2rem';\n      titleLink.style.fontWeight = '700';\n      titleLink.style.textTransform = 'uppercase';\n      titleLink.style.letterSpacing = '0.05em';\n      titleLink.style.color = '#fff';\n\n      titleContainer.appendChild(titleLink);\n\n      // \u2500\u2500 PREPARE AUCTION CARD (Blueprint) \u2500\u2500\n      var auctionCard;\n      if (masterBlueprint) {\n        auctionCard = masterBlueprint.cloneNode(true);\n        auctionCard.removeAttribute('data-bid-widget-ready');\n        auctionCard.setAttribute('data-auction-handle', handle);\n        auctionCard.classList.add('auction-card-info--loading');\n      } else {\n        auctionCard = document.createElement('div');\n        auctionCard.className = 'auction-card-info auction-card-info--loading';\n        auctionCard.setAttribute('data-auction-handle', handle);\n        auctionCard.innerHTML =\n          '<div class=\"auction-card-info__meta-row auction-card-info__time-row\">' +\n          '<span class=\"auction-card-info__time-left\">Loading...</span>' +\n          '</div>' +\n          '<div class=\"auction-card-info__meta-row auction-card-info__bid-row\">' +\n          '<span class=\"auction-card-info__meta-label\">Current Bid:</span>' +\n          '<span class=\"auction-card-info__current-bid\">USD --.--</span>' +\n          '<span class=\"auction-card-info__divider\">|</span>' +\n          '<span class=\"auction-card-info__bid-count\">-- bids</span>' +\n          '</div>' +\n          '<div class=\"auction-card-info__meta-row auction-card-info__bidder-row\">' +\n          '<span class=\"auction-card-info__highest-bidder-label\">Highest Bidder:</span>' +\n          '<span class=\"auction-card-info__highest-bidder\"></span>' +\n          '</div>' +\n          '<div class=\"auction-card-info__meta-row auction-card-info__status-row\">' +\n          '<span class=\"auction-card-info__status\"></span>' +\n          '</div>' +\n          '<div class=\"auction-card-info__bid-form\">' +\n          '<div class=\"auction-card-info__stepper\">' +\n          '<button type=\"button\" class=\"auction-card-info__step-button auction-card-info__step-button--minus\" data-action=\"decrease\"></button>' +\n          '<div class=\"auction-card-info__input-container\">' +\n          '<span class=\"auction-card-info__currency-symbol\">$</span>' +\n          '<input type=\"number\" class=\"auction-card-info__input\" value=\"1\" min=\"1\" step=\"1\" inputmode=\"decimal\">' +\n          '</div>' +\n          '<button type=\"button\" class=\"auction-card-info__step-button auction-card-info__step-button--plus\" data-action=\"increase\"></button>' +\n          '</div>' +\n          '<button type=\"button\" class=\"auction-card-info__button auction-card-info__button--submit\">Bid Now</button>' +\n          '</div>';\n      }\n\n      // Ensure the blueprint title row is hidden if it exists (since we have a dedicated one)\n      var blueprintTitleRow = auctionCard.querySelector('.auction-card-info__name-row');\n      if (blueprintTitleRow) blueprintTitleRow.style.display = 'none';\n\n      var cardBidderEl = auctionCard.querySelector('.auction-card-info__highest-bidder');\n      if (cardBidderEl && highestBidderName) {\n        cardBidderEl.textContent = formatBidderName(highestBidderName);\n      }\n\n      if (auctionId) auctionCard.setAttribute('data-auction-id', auctionId);\n\n      // \u2500\u2500 ASSEMBLE NEW DOM \u2500\u2500\n      var nativeTimer = gridItem.querySelector('.pa-timer');\n      var hiddenTimerWrap = document.createElement('div');\n      hiddenTimerWrap.style.display = 'none';\n      if (nativeTimer) hiddenTimerWrap.appendChild(nativeTimer);\n\n      // Clear the grid item\n      while (gridItem.firstChild) {\n        gridItem.removeChild(gridItem.firstChild);\n      }\n\n      // Vertical Stack: Image -> Title -> (Hidden Timer) -> Auction Card\n      gridItem.appendChild(topWrapper);\n      gridItem.appendChild(titleContainer);\n      gridItem.appendChild(hiddenTimerWrap);\n      gridItem.appendChild(auctionCard);\n\n      // Standardize grid item style\n      gridItem.style.display = 'flex';\n      gridItem.style.flexDirection = 'column';\n      gridItem.style.height = 'auto';\n      gridItem.style.overflow = 'visible';\n      gridItem.classList.add('product-card', 'product-card--is-auction');\n      auctionCard.classList.add('product-card__details');\n\n      // \u2500\u2500 ASYNC REFINEMENT \u2500\u2500\n      (function (card, container, productHandle, aucId) {\n        fetch('/products/' + productHandle + '.js')\n          .then(function (resp) { return resp.json(); })\n          .then(function (product) {\n            if (product && product.id) {\n              var pid = String(product.id);\n              card.setAttribute('data-auction-product-id', pid);\n              card.setAttribute('data-product-id', pid);\n\n              // Update the title from official product data\n              if (product.title) {\n                var nameEl = container.querySelector('.auction-card-info__product-name');\n                if (nameEl) nameEl.textContent = product.title;\n              }\n\n              // v8 FIX: Update card image from Shopify product JSON.\n              // Cross-page cards may have empty/placeholder images because\n              // Shopify lazy-loads page 2+ with data-srcset instead of src.\n              if (product.featured_image) {\n                var gridParent = card.closest('.wkgrid, .wkcol-md-4, .product-card');\n                if (gridParent) {\n                  var cardImg = gridParent.querySelector('.auction-product-top-image img');\n                  // v8 FIX: Also catch {width} placeholder URLs that browsers can't load\n                  // v95 FIX: Removed the `!cardImg.naturalWidth` check. Lazy images below\n                  // the fold always have naturalWidth 0 until scrolled to, so every one of\n                  // them was being swapped for the full-size original upload \u2014 heavy on\n                  // iPhone memory, which makes Safari unload the tab in the background.\n                  // Only swap genuinely missing/placeholder images, and request 600px.\n                  if (cardImg && (!cardImg.src || cardImg.src.includes('no-image') || cardImg.src.includes('data:image') || cardImg.src.includes('{width}'))) {\n                    cardImg.src = bcoSizedImageUrl(product.featured_image, bcoTargetImgWidth(cardImg));\n                    cardImg.alt = product.title || '';\n                    console.log('[BCO Grid] Updated image for ' + productHandle + ' from product JSON');\n                  }\n                }\n              }\n\n              // Synthetic widget for polling\n              var synth = document.createElement('div');\n              synth.className = 'wk-category-auction';\n              synth.setAttribute('data-prod', pid);\n              synth.style.display = 'none';\n              card.appendChild(synth);\n\n              // Pre-inject bidder row if not present (homepage cards use stripped template)\n              if (!card.querySelector('.auction-card-info__bidder-row')) {\n                var preRow = document.createElement('div');\n                preRow.className = 'auction-card-info__meta-row auction-card-info__bidder-row';\n                var preLabel = document.createElement('span');\n                preLabel.className = 'auction-card-info__highest-bidder-label';\n                preLabel.textContent = 'Highest Bidder:';\n                var preSpan = document.createElement('span');\n                preSpan.className = 'auction-card-info__highest-bidder';\n                preRow.appendChild(preLabel);\n                preRow.appendChild(preSpan);\n                // Insert above status row or bid form\n                var statusRowEl = card.querySelector('.auction-card-info__status-row');\n                if (statusRowEl) card.insertBefore(preRow, statusRowEl);\n                else {\n                  var bidFormEl = card.querySelector('.auction-card-info__bid-form');\n                  if (bidFormEl) card.insertBefore(preRow, bidFormEl);\n                  else card.appendChild(preRow);\n                }\n              }\n\n              setupApiPoll();\n              if (typeof window._bcoBiddingformPoll === 'function') {\n                window._bcoBiddingformPoll(pid);\n              }\n              // Fix: sync bidder names after product ID is known on home-page cards\n              if (typeof window.bcpSyncBidderNames === 'function') {\n                setTimeout(window.bcpSyncBidderNames, 5000);\n                setTimeout(window.bcpSyncBidderNames, 10000);\n              }\n            }\n          })\n          .catch(function (err) {\n            console.warn('[BCO Grid] AJAX title fetch failed for ' + productHandle, err);\n          });\n      })(auctionCard, titleContainer, handle, auctionId);\n\n      // Hide Webkul's own details/buttons \u2014 but preserve structural containers\n      gridItem.querySelectorAll('div, button, a.pa-category-btn, .pa-theme-bg-imp').forEach(function (el) {\n        if (el.classList.contains('auction-card-info') || el.closest('.auction-card-info')) return;\n        if (el.classList.contains('wk-category-auction')) return; // preserve synthetic widget\n        // Guard: never hide structural Webkul grid containers\n        if (el.tagName === 'DIV' && (\n          el.className.match(/wkcol-|wkrow|wk_products_row|wkgrid/) ||\n          el.querySelector('.auction-card-info') ||\n          el.id === 'products_on_auction'\n        )) return;\n        var t = el.textContent || '';\n        if (t.includes('No. of Bids:') || t.includes('Current Bid:') || t.includes('Highest Bidder:') || t.includes('VIEW AUCTION') || t.includes('JOIN AUCTION')) {\n          el.style.setProperty('display', 'none', 'important');\n        }\n      });\n\n      // Strip inline height/overflow from ALL parent containers so CSS auto-height takes over\n      gridItem.querySelectorAll('[class*=\"wkcol-\"]').forEach(function (col) {\n        col.style.removeProperty('height');\n        col.style.removeProperty('max-height');\n        col.style.removeProperty('overflow');\n        col.style.setProperty('height', 'auto', 'important');\n        col.style.setProperty('overflow', 'visible', 'important');\n      });\n      // Also fix the .wkgrid itself\n      gridItem.style.removeProperty('height');\n      gridItem.style.setProperty('height', 'auto', 'important');\n      gridItem.style.setProperty('overflow', 'visible', 'important');\n    });\n\n    // V82 HOTFIX: iOS Safari Visibility Escape Hatch\n    // Native Safari ruthlessly overrides explicit child `visibility: visible` if its parent is `hidden`.\n    // Webkul wraps the pagination in `.wkcontainer` (which we heavily obscure to block duplicate grids).\n    // Extracting it ensures flawless render footprint natively on iPhones.\n    var pagination = target ? target.querySelector('.pagination') : document.querySelector('#products_on_auction .pagination');\n    if (pagination && pagination.parentElement) {\n      var paContainer = pagination.closest('#products_on_auction');\n      // If it is deeply nested inside a webkul div, yank it directly into the master container\n      if (paContainer && pagination.parentElement !== paContainer) {\n        paContainer.appendChild(pagination);\n        console.log('[BCO UI] Rescued pagination from deep nested visibility vortex');\n      }\n    }\n\n    if (wkRows.length > 0 && typeof setupBidWidgets === 'function') {\n      setupBidWidgets();\n      // Ensure live sync layers are running for newly-injected cards\n      setupLiveBidSync();\n      setupApiPoll();\n    }\n  }\n\n\n  /**\n   * v95: Auction page scroll memory (iPhone \"refresh at 3/4 down\" fix).\n   * iOS Safari unloads heavy background tabs and reloads them when the user\n   * comes back. The browser can't restore the scroll position because Webkul\n   * builds the auction grid a few seconds after load, so the visitor lands\n   * near the top and loses their place. We remember which card was on screen\n   * when the page was hidden, and scroll back to it once the grid is rebuilt.\n   * Also covers pressing Back from a product page.\n   */\n  function setupAuctionScrollMemory() {\n    var root = document.getElementById('products_on_auction');\n    if (!root) return;\n    var store;\n    try { store = window.sessionStorage; store.getItem('x'); } catch (e) { return; }\n\n    var KEY = 'bco_auction_scroll';\n    var MAX_AGE_MS = 30 * 60 * 1000;\n    var pageKey = location.pathname + location.search;\n\n    function cardHandle(grid) {\n      var a = grid.querySelector('a[href*=\"/products/\"]');\n      var m = a && (a.getAttribute('href') || '').match(/\\/products\\/([^/?#]+)/);\n      return m ? m[1] : '';\n    }\n\n    var restorePending = false;\n\n    // reason: 'hidden' = app/tab switch (iOS may unload the tab after this),\n    //         'pagehide' = leaving the page (link click, Back, close)\n    function save(reason) {\n      if (restorePending) return; // don't overwrite the spot we're restoring to\n      try {\n        var grids = root.querySelectorAll('.wkgrid');\n        for (var i = 0; i < grids.length; i++) {\n          var r = grids[i].getBoundingClientRect();\n          if (r.height > 0 && r.bottom > 0) {\n            var handle = cardHandle(grids[i]);\n            if (!handle) continue;\n            store.setItem(KEY, JSON.stringify({\n              page: pageKey, handle: handle, offset: Math.round(r.top),\n              reason: reason, ts: Date.now()\n            }));\n            return;\n          }\n        }\n        store.removeItem(KEY); // scrolled past the grid: nothing to restore\n      } catch (e) { /* storage full/blocked: skip */ }\n    }\n\n    document.addEventListener('visibilitychange', function () {\n      if (document.visibilityState === 'hidden') save('hidden');\n    });\n    window.addEventListener('pagehide', function () { save('pagehide'); });\n\n    // \u2500\u2500 Restore \u2500\u2500\n    var saved = null;\n    try { saved = JSON.parse(store.getItem(KEY) || 'null'); } catch (e) { saved = null; }\n    if (!saved || saved.page !== pageKey || !saved.handle || (Date.now() - saved.ts) > MAX_AGE_MS) return;\n\n    var navType = '';\n    try {\n      var nav = performance.getEntriesByType('navigation')[0];\n      navType = nav ? nav.type : '';\n    } catch (e) { /* older browsers */ }\n    // Restore after a reload, Back/Forward, or a tab the phone unloaded after an\n    // app switch. Skip when the visitor deliberately clicked through to the\n    // auction page again (fresh navigation after leaving it).\n    if (navType === 'navigate' && saved.reason !== 'hidden') return;\n\n    restorePending = true;\n    if ('scrollRestoration' in history) history.scrollRestoration = 'manual';\n\n    var selHandle = window.CSS && CSS.escape ? CSS.escape(saved.handle) : saved.handle;\n    var startedAt = Date.now();\n    var userMoved = false;\n    var restoredAt = 0;\n    var raf = 0;\n\n    function markMoved() { userMoved = true; }\n    ['touchstart', 'wheel', 'keydown'].forEach(function (ev) {\n      window.addEventListener(ev, markMoved, { passive: true, once: true });\n    });\n\n    var mo = new MutationObserver(function () {\n      if (raf) return;\n      raf = requestAnimationFrame(function () { raf = 0; tryRestore(); });\n    });\n    var iv = setInterval(tryRestore, 400);\n\n    function stop() {\n      mo.disconnect();\n      clearInterval(iv);\n      restorePending = false;\n      if ('scrollRestoration' in history) history.scrollRestoration = 'auto';\n    }\n\n    function tryRestore() {\n      // Give up if the visitor starts scrolling, or the card never appears\n      if (userMoved || Date.now() - startedAt > 20000) return stop();\n      // Keep correcting for ~2.5s after the first jump while cards above finish\n      // restyling (their height changes), then stop\n      if (restoredAt && Date.now() - restoredAt > 2500) return stop();\n      var link = root.querySelector('.wkgrid a[href*=\"/products/' + selHandle + '\"]');\n      var grid = link && link.closest('.wkgrid');\n      if (!grid || !grid.querySelector('.auction-card-info__title-header')) return; // not styled yet\n      var target = Math.max(0, Math.round(grid.getBoundingClientRect().top + window.scrollY - saved.offset));\n      if (Math.abs(window.scrollY - target) > 4) window.scrollTo(0, target);\n      if (!restoredAt) restoredAt = Date.now();\n    }\n\n    mo.observe(root, { childList: true, subtree: true });\n    tryRestore();\n  }\n\n  function init() {\n    // Expand parent containers for homepage auction cards (must run first)\n    expandAuctionCardParents();\n\n    setupEndingSoonButton();\n    setupMyBidsButton();\n\n    // V77 HOTFIX: Core Auction UI Subsystem Activation\n    // The homepage liquid slider cards are already present on page load.\n    // We unconditionally activate the polling, background sync, and timer layers regardless\n    // of whether the Webkul data widget has finished rendering yet.\n    if (typeof setupBidWidgets === 'function') setupBidWidgets();\n    if (typeof setupLiveBidSync === 'function') setupLiveBidSync();\n    if (typeof setupApiPoll === 'function') setupApiPoll();\n    if (typeof setupTimerSync === 'function') setupTimerSync();\n\n    // \u2500\u2500 v88 PDP FAST-PATH: Immediate biddingform call \u2500\u2500\n    // Fire the PDP biddingform poll IMMEDIATELY (no waitForWebkul gate)\n    // to get the current bid value as fast as possible. The normal path\n    // waits for Webkul to render (up to 8s), then staggers polls at 500ms/1000ms.\n    // This fast-path extracts the product ID from the Liquid-rendered DOM and\n    // fires the API call in parallel with Webkul's own initialization.\n    (function pdpFastPath() {\n      // v90: DISABLED \u2014 Don't inject loading placeholder into #wk-auction.\n      return;\n      var pdpEl = document.querySelector('#wk-auction[prod-id], .product-section[data-product-id]');\n      if (!pdpEl) return;\n      var pdpPid = pdpEl.getAttribute('prod-id') || pdpEl.getAttribute('data-product-id');\n      if (!pdpPid) return;\n\n      console.log('[BCO PDP FastPath] Firing immediate biddingform call for PID:', pdpPid);\n\n      // Inject a \"Loading\u2026\" placeholder into the auction widget to prevent blank state\n      var wkEl = document.querySelector('#wk-auction');\n      if (wkEl && wkEl.children.length < 2 && !wkEl.querySelector('.bco-pdp-loading')) {\n        var loadingEl = document.createElement('div');\n        loadingEl.className = 'bco-pdp-loading';\n        loadingEl.style.cssText = 'text-align:center;padding:20px 0;color:rgba(255,255,255,0.5);font-size:14px;letter-spacing:0.05em;';\n        loadingEl.textContent = 'Loading auction data\u2026';\n        wkEl.appendChild(loadingEl);\n        // Auto-remove after data arrives or 10s (whichever comes first)\n        setTimeout(function () { if (loadingEl.parentNode) loadingEl.remove(); }, 10000);\n      }\n\n      // Fire the biddingform poll immediately (bypasses normal 500ms/1s stagger)\n      if (typeof window._bcoBiddingformPoll === 'function') {\n        window._bcoBiddingformPoll(pdpPid, true); // forceBypassGuard = true\n      }\n    })();\n\n    const isAuctionCollection =\n      window.location.pathname.includes('/collections/auctions');\n    const isAppAuctionPage =\n      window.location.pathname.includes('/pages/products-on-auction');\n    const urlParams = new URLSearchParams(window.location.search);\n\n    // \u2500\u2500 Polling helper: run callback as soon as Webkul data is ready \u2500\u2500\n    // v10 PERF: Use wider intervals on mobile (2x) to reduce timer overhead\n    function waitForWebkul(checkFn, callback, interval, maxWait) {\n      var effectiveInterval = _isMobile ? Math.max(interval * 2, 500) : interval;\n      var elapsed = 0;\n      var timer = setInterval(function () {\n        elapsed += effectiveInterval;\n        if (checkFn() || elapsed >= maxWait) {\n          clearInterval(timer);\n          callback();\n        }\n      }, effectiveInterval);\n    }\n\n    // App Grid Injection - Use longer interval + check if needed\n    // v84 PERF: Self-clearing \u2014 stops after 30 seconds (6 checks)\n    // v105: Reduced from 6\u00D75s to 3\u00D78s to minimize unnecessary DOM traversal\n    var _lastGridCheck = 0;\n    var _gridCheckCount = 0;\n    var _gridCheckTimer = setInterval(function () {\n      _gridCheckCount++;\n      if (_gridCheckCount >= 3) { clearInterval(_gridCheckTimer); return; }\n      if (Date.now() - _lastGridCheck < 8000) return;\n      setupAppGridInjection();\n      _lastGridCheck = Date.now();\n    }, 8000);\n    setupAppGridInjection();\n\n    // v92 PERF: Inject cards as soon as Webkul renders (or re-renders) its grid.\n    // Before: injection ran at init (usually before Webkul's grid existed), then\n    // only every 8s \u2014 so after each page load / pagination click, the styled\n    // cards + bid buttons showed up to ~8s late. The 8s interval above stays as\n    // a backup. Loop-safe: injection only runs while some .wkgrid card is still\n    // un-injected, and text-only mutations (timer ticks) are ignored.\n    (function watchAppGrid() {\n      var gridRoot = document.querySelector('#products_on_auction');\n      if (!gridRoot || typeof MutationObserver === 'undefined') return;\n      var scheduled = false;\n\n      function hasUninjectedCards() {\n        var items = gridRoot.querySelectorAll('.wkgrid');\n        for (var i = 0; i < items.length; i++) {\n          var g = items[i];\n          if (g.classList.contains('bco-filter-processed') || g.querySelector('.bco-filter-processed')) continue;\n          if (!g.querySelector('.auction-card-info__title-header')) return true;\n        }\n        return false;\n      }\n\n      function addsElements(mutations) {\n        for (var i = 0; i < mutations.length; i++) {\n          var added = mutations[i].addedNodes;\n          for (var j = 0; j < added.length; j++) {\n            if (added[j].nodeType === 1) return true;\n          }\n        }\n        return false;\n      }\n\n      // v95: Resize grid images the moment Webkul inserts them, so the phone\n      // downloads and decodes a card-sized image instead of the 1200px original.\n      // Changing src is an attribute change, so it doesn't re-trigger this\n      // childList observer.\n      function shrinkAddedImages(mutations) {\n        for (var i = 0; i < mutations.length; i++) {\n          var added = mutations[i].addedNodes;\n          for (var j = 0; j < added.length; j++) {\n            var n = added[j];\n            if (n.nodeType !== 1) continue;\n            if (n.tagName === 'IMG') { bcoShrinkGridImage(n); continue; }\n            var imgs = n.getElementsByTagName('img');\n            for (var k = 0; k < imgs.length; k++) bcoShrinkGridImage(imgs[k]);\n          }\n        }\n      }\n\n      new MutationObserver(function (mutations) {\n        shrinkAddedImages(mutations);\n        if (scheduled || !addsElements(mutations)) return;\n        scheduled = true;\n        (window._bcoScrollAwareWrite || requestAnimationFrame)(function () {\n          scheduled = false;\n          if (hasUninjectedCards()) {\n            setupAppGridInjection();\n            _lastGridCheck = Date.now();\n          }\n        });\n      }).observe(gridRoot, { childList: true, subtree: true });\n    })();\n\n    // v95: Put the visitor back on the same card if iOS reloads the tab\n    setupAuctionScrollMemory();\n\n    // Setup Tabs\n    setupAuctionTabs();\n\n    // Auto-sort by \"Ending Soonest\" on the auctions collection page\n    // V83 FIX: Disabled auto-sort on page load. The Webkul server delivers products in a specific default indexed order.\n    // Sorting them client-side immediately upon a hard refresh causes a visual mismatch compared to the raw order\n    // injected during an AJAX `.pagination` navigation.\n    if (urlParams.get('sort_by') === 'Auction Ending Soon') {\n      // Server handles the sort; client-side re-sort as backup after Webkul renders\n      waitForWebkul(\n        function () { return !!document.querySelector('.wk-auction-timer, .timer_div'); },\n        sortProductsByEndingSoon, 250, 6000\n      );\n    }\n\n    // Auto-apply \"My Bids\" filter if URL param is present\n    if (urlParams.get('filter') === 'my-bids') {\n      waitForWebkul(\n        function () { return !!document.querySelector('#products_on_auction .wkgrid, #products_on_auction .wk-category-auction, .auction-card-info'); },\n        function () {\n          // Mark the button as active\n          document.querySelectorAll('#my-bids-filter-button, .my-bids-trigger')\n            .forEach(function (btn) { btn.classList.add('is-active'); });\n          // filterMyBids is called by fetchMyBidsFromAllPages.finishFetch after participation checks resolve.\n        }, 250, 6000\n      );\n    }\n\n    // Setup inline bid widgets after Webkul renders (needs auction data)\n    // Polls every 250ms, runs as soon as .wk-category-auction has bid data\n    const hasAuctionCards = document.querySelectorAll('.auction-card-info').length > 0 || isAppAuctionPage;\n    if (hasAuctionCards) {\n      waitForWebkul(\n        function () { return !!document.querySelector('.wk-category-auction .wk-current-bid') || !!document.querySelector('#products_on_auction .wkgrid'); },\n        function () {\n          seedBiddingRulesFromPage(); // Seed rules before hydrating widgets\n          setupBidWidgets();\n        }, 250, 8000\n      );\n    }\n\n    // Guard the native Webkul bid button on product detail pages\n    // Polls every 250ms for the auction widget to appear\n    waitForWebkul(\n      function () { return !!document.querySelector('#wk-auction, .wk-category-auction'); },\n      function () {\n        seedBiddingRulesFromPage();\n        setupProductPageGuard();\n        suppressWebkulModals();\n      }, 250, 8000\n    );\n\n    // Re-sort after Shopify AJAX filter updates\n    document.addEventListener('filter:update', () => {\n      setTimeout(() => {\n        const currentParams = new URLSearchParams(window.location.search);\n        const stillOnAuctions =\n          window.location.pathname.includes('/collections/auctions');\n        if (currentParams.get('sort_by') === 'Auction Ending Soon' || stillOnAuctions) {\n          sortProductsByEndingSoon();\n        }\n      }, 1000);\n    });\n\n    // \u2500\u2500 Live Bid Sync (WebSocket) \u2500\u2500\n    // Hooks into Webkul's existing socket to update cards in real-time\n    setupLiveBidSync();\n\n    // \u2500\u2500 Timer Sync (Moved to unconditional init above) \u2500\u2500\n\n    // \u2500\u2500 DOM Watcher (instant same-page sync) \u2500\u2500\n    // MutationObserver on Webkul's hidden widgets detects bid changes\n    if (hasAuctionCards) {\n      waitForWebkul(\n        function () { return !!document.querySelector('.auction-card-info[data-auction-id]'); },\n        setupDomWatcher, 500, 12000\n      );\n    }\n\n    // v73: Redundant 2s PDP sync interval REMOVED.\n    // Both doBiddingformPoll and applyBidUpdate already call renderPdpState\n    // with authoritative data. The interval was reading stale data-attributes\n    // which could regress fresher socket values.\n\n    // \u2500\u2500 Shopify Page Poll (cross-device fallback) \u2500\u2500\n    if (hasAuctionCards) {\n      waitForWebkul(\n        function () { return !!document.querySelector('#products_on_auction .wkgrid, #products_on_auction .wk-category-auction, .auction-card-info'); },\n        function () {\n          console.log('[BCO Init] Cards present \u2014 starting API poll');\n          setupApiPoll();\n\n          if (new URLSearchParams(window.location.search).get('filter') === 'my-bids') {\n            fetchMyBidsFromAllPages();\n          }\n        }, 500, 12000\n      );\n    }\n\n    // \u2500\u2500 PDP: Start API poll immediately for the main widget \u2500\u2500\n    if (document.querySelector('#wk-auction')) {\n      setupApiPoll();\n      // \u2500\u2500 PDP Bidder Name: smart retry with exponential backoff \u2500\u2500\n      // v84 PERF: Replaces 6 separate setTimeout + 1 setInterval with a single\n      // retry loop that stops when the name is found or after max attempts.\n      (function pdpBidderRetry() {\n        var attempts = [3000, 6000, 10000, 15000, 25000, 40000];\n        var idx = 0;\n        function tryNext() {\n          if (idx >= attempts.length) return; // max retries reached\n          setTimeout(function () {\n            applyPdpBidderName();\n            // Check if we found the name\n            var pdpNameEl = document.querySelector('.bco-pdp-bidder-name');\n            if (pdpNameEl && pdpNameEl.textContent.trim()) {\n              console.log('[BCO PDP] Bidder name found, stopping retry loop');\n              return; // Stop \u2014 name is populated\n            }\n            // Try page fetch as fallback on attempts 2 and 4\n            if (idx === 1 || idx === 3) fetchPdpBidderNameFromPage();\n            idx++;\n            tryNext();\n          }, idx === 0 ? attempts[0] : (attempts[idx] - attempts[idx - 1]));\n        }\n        tryNext();\n      })();\n    }\n\n    // \u2500\u2500 UNIVERSAL BIDDER NAME SYNCER \u2500\u2500\n    // Reads from Webkul's native .highest_bidder_name dom elements and syncs\n    // them to our .auction-card-info__highest-bidder display elements.\n    // Works on ALL pages: grid, homepage carousel, PDP.\n    function syncBidderNames() {\n      // 1. Grid page + homepage: find each .wk-category-auction and its associated auction-card-info\n      document.querySelectorAll('.wk-category-auction').forEach(function (wkWidget) {\n        var nameEl = wkWidget.querySelector('.highest_bidder_name, [class*=\"highest_bidder\"] span, .highest-bidder-name');\n        if (!nameEl) {\n          // Also try scanning surrounding DOM\n          var gridItem = wkWidget.closest('li, .product-card, .grid__item, .wkgrid');\n          if (gridItem) nameEl = gridItem.querySelector('.highest_bidder_name');\n        }\n        var name = nameEl ? nameEl.textContent.trim() : '';\n        var nameFromDom = !!name; // Track if name came from Webkul's native DOM (trusted source)\n\n        // SEARCH FALLBACK: If standard search fails, try scanning the parent card item\n        if (!name) {\n          var outerItem = wkWidget.closest('li, .product-card, .grid__item, .wkgrid, .swiper-slide');\n          if (outerItem) {\n            var fallbackEl = outerItem.querySelector('.highest_bidder_name, [class*=\"highest_bidder\"] span');\n            if (fallbackEl && fallbackEl.textContent.trim()) {\n              name = fallbackEl.textContent.trim();\n              nameFromDom = true;\n            }\n          }\n        }\n\n        // FIX: If the DOM produced no name (non-winning cards never get .highest_bidder_name rendered\n        // in the list/home page), fall back to the API-cache which the biddingform poll populates.\n        // This is what makes the name appear for ALL cards, not just the logged-in winner's card.\n        if (!name) {\n          var gridItem2 = wkWidget.closest('li, .product-card, .grid__item, .wkgrid, .wkcol-md-4, [class*=\"wkcol-\"], .swiper-slide');\n          var card2 = gridItem2 ? gridItem2.querySelector('.auction-card-info') : null;\n          if (card2) {\n            var pid2 = card2.getAttribute('data-product-id') || card2.getAttribute('data-auction-product-id');\n            if (pid2 && _minBidFromApi[pid2] && _minBidFromApi[pid2].highestBidderName) {\n              name = _minBidFromApi[pid2].highestBidderName;\n              nameFromDom = false; // came from API cache \u2014 needs 0-bid guard\n            }\n          }\n        }\n\n        if (!name) return;\n\n        // Reject bid-amount strings that Webkul sometimes puts in place of the name\n        if (/^USD\\s/i.test(name) || /^\\$/.test(name) || /^\\d/.test(name)) return;\n\n        // Find our display element in the closest auction-card-info\n        var gridItem = wkWidget.closest('li, .product-card, .grid__item, .wkgrid, .wkcol-md-4, [class*=\"wkcol-\"], .swiper-slide');\n        var card = gridItem ? gridItem.querySelector('.auction-card-info') : null;\n        if (card) {\n          // 0-BID GUARD: Only apply to API-cache-sourced names.\n          // DOM-sourced names are trusted \u2014 Webkul would never render .highest_bidder_name for 0-bid products.\n          // The DOM bid count text starts as \"0 bids\" before the API poll updates it, causing false positives.\n          if (!nameFromDom) {\n            var countEl = card.querySelector('.auction-card-info__bid-count');\n            var bidCountStr = countEl ? countEl.textContent.trim() : '';\n            var bidCountNum = parseInt(bidCountStr) || 0;\n            if (bidCountNum === 0) {\n              var pidCheck = card.getAttribute('data-product-id') || card.getAttribute('data-auction-product-id');\n              if (pidCheck && _minBidFromApi[pidCheck] && parseInt(_minBidFromApi[pidCheck].bidCount) > 0) {\n                bidCountNum = parseInt(_minBidFromApi[pidCheck].bidCount);\n              }\n            }\n            if (bidCountNum === 0) {\n              // Clear any existing bidder name text\n              var existingNameEl = card.querySelector('.auction-card-info__highest-bidder');\n              if (existingNameEl) existingNameEl.textContent = '';\n              var existingLabelEl = card.querySelector('.auction-card-info__highest-bidder-label');\n              if (existingLabelEl) existingLabelEl.textContent = '';\n              return;\n            }\n          }\n          var displayEl = card.querySelector('.auction-card-info__highest-bidder');\n          var rowEl = card.querySelector('.auction-card-info__bidder-row');\n          if (!displayEl) {\n            // Row doesn't exist \u2014 inject it now\n            var newRow = document.createElement('div');\n            newRow.className = 'auction-card-info__meta-row auction-card-info__bidder-row';\n            var lbl = document.createElement('span');\n            lbl.className = 'auction-card-info__highest-bidder-label';\n            lbl.textContent = 'Highest Bidder: ';\n            var sp = document.createElement('span');\n            sp.className = 'auction-card-info__highest-bidder';\n            newRow.appendChild(lbl);\n            newRow.appendChild(sp);\n            var srEl = card.querySelector('.auction-card-info__status-row, .auction-card-info__bid-form');\n            if (srEl) card.insertBefore(newRow, srEl);\n            else card.appendChild(newRow);\n            displayEl = sp;\n            rowEl = newRow;\n          }\n          // DETECT FIRST: If this card is winning, capture the user's Webkul name BEFORE formatting\n          var statusEl = card.querySelector('.auction-card-info__status');\n          if (statusEl && statusEl.classList.contains('is-winning') && name && !isLikelyBidAmount(name) && name !== 'You' && name !== '(You)') {\n            if (!_currentUserWebkulName) {\n              _currentUserWebkulName = name;\n              console.log('[BCO] Captured Webkul identity from winning card: \"' + name + '\"');\n            }\n          }\n          if (displayEl) { var _fn = formatBidderName(name); if (displayEl.textContent !== _fn) displayEl.textContent = _fn; }\n          if (rowEl && rowEl.style.display === 'none') rowEl.style.display = '';\n        }\n      });\n\n      // 1a-POST: If identity was captured during the loop above, retroactively fix any cards\n      // that were rendered BEFORE the identity was known (fixes \"one card late\" effect)\n      if (_currentUserWebkulName) {\n        document.querySelectorAll('.auction-card-info__highest-bidder').forEach(function(el) {\n          if (el.textContent.trim() && el.textContent.trim().toLowerCase() === _currentUserWebkulName.toLowerCase() && el.textContent.trim() !== 'You') {\n            el.textContent = 'You';\n          }\n        });\n      }\n\n      // 1b. SECOND PASS: Cards without .wk-category-auction widgets (e.g. home page carousel)\n      // These cards are never visited by the loop above. Pull name from _minBidFromApi cache.\n      document.querySelectorAll('.auction-card-info').forEach(function (card) {\n        var displayEl = card.querySelector('.auction-card-info__highest-bidder');\n        // Skip if already has a name\n        if (displayEl && displayEl.textContent.trim()) return;\n        var pid = card.getAttribute('data-product-id') || card.getAttribute('data-auction-product-id');\n        if (!pid) return;\n        var cached = _minBidFromApi[pid];\n        if (!cached || !cached.highestBidderName) return;\n        var name = cached.highestBidderName;\n        if (/^USD\\s/i.test(name) || /^\\$/.test(name) || /^\\d/.test(name)) return;\n\n        // v11 FIX: Don't show bidder name on 0-bid cards (second pass) \u2014 clear text\n        var countEl2 = card.querySelector('.auction-card-info__bid-count');\n        var bidCountStr2 = countEl2 ? countEl2.textContent.trim() : '';\n        var bidCountNum2 = parseInt(bidCountStr2) || 0;\n        if (bidCountNum2 === 0 && cached && (parseInt(cached.bidCount) || 0) === 0) {\n          var existingNameEl2 = card.querySelector('.auction-card-info__highest-bidder');\n          if (existingNameEl2) existingNameEl2.textContent = '';\n          var existingLabelEl2 = card.querySelector('.auction-card-info__highest-bidder-label');\n          if (existingLabelEl2) existingLabelEl2.textContent = '';\n          return;\n        }\n\n        var rowEl = card.querySelector('.auction-card-info__bidder-row');\n        if (!displayEl) {\n          var newRow = document.createElement('div');\n          newRow.className = 'auction-card-info__meta-row auction-card-info__bidder-row';\n          var lbl = document.createElement('span');\n          lbl.className = 'auction-card-info__highest-bidder-label';\n          lbl.textContent = 'Highest Bidder: ';\n          var sp = document.createElement('span');\n          sp.className = 'auction-card-info__highest-bidder';\n          newRow.appendChild(lbl);\n          newRow.appendChild(sp);\n          var srEl = card.querySelector('.auction-card-info__status-row, .auction-card-info__bid-form');\n          if (srEl) card.insertBefore(newRow, srEl);\n          else card.appendChild(newRow);\n          displayEl = sp;\n          rowEl = newRow;\n        }\n        if (displayEl) { var _fn2 = formatBidderName(name); if (displayEl.textContent !== _fn2) displayEl.textContent = _fn2; }\n        if (rowEl && rowEl.style.display === 'none') rowEl.style.display = '';\n      });\n\n      // 2. PDP: read from #wk-auction native element\n      var pdpWidget = document.querySelector('#wk-auction');\n      if (pdpWidget) {\n        var pdpNameEl = pdpWidget.querySelector('.highest_bidder_name, [class*=\"highest_bidder\"] span');\n        var pdpName = pdpNameEl ? pdpNameEl.textContent.trim() : '';\n        \n        // FALLBACK: If Webkul didn't render the name, pull from _minBidFromApi cache\n        if (!pdpName) {\n          var pdpProdWidget = document.querySelector('.wk-category-auction[data-prod]');\n          var pdpProdId = pdpProdWidget ? pdpProdWidget.getAttribute('data-prod') : '';\n          // Also try from .auction-card-info on PDP\n          if (!pdpProdId) {\n            var pdpCard = document.querySelector('.auction-card-info[data-auction-product-id]');\n            pdpProdId = pdpCard ? pdpCard.getAttribute('data-auction-product-id') : '';\n          }\n          // Also try from product-template data-product-id\n          if (!pdpProdId) {\n            var pdpTemplate = document.querySelector('[data-product-id]');\n            pdpProdId = pdpTemplate ? pdpTemplate.getAttribute('data-product-id') : '';\n          }\n          if (pdpProdId && _minBidFromApi[pdpProdId] && _minBidFromApi[pdpProdId].highestBidderName) {\n            pdpName = _minBidFromApi[pdpProdId].highestBidderName;\n            console.log('[BCO] PDP bidder name from API cache: \"' + pdpName + '\" for PID ' + pdpProdId);\n          }\n        }\n        \n        if (pdpName) {\n          // Reject bid-amount strings\n          if (/^USD\\s/i.test(pdpName) || /^\\$/.test(pdpName) || /^\\d/.test(pdpName)) pdpName = '';\n        }\n        if (pdpName) {\n          var pdpRow = pdpWidget.querySelector('.bco-pdp-bidder-row');\n          if (!pdpRow) {\n            pdpRow = document.createElement('div');\n            pdpRow.className = 'bco-pdp-bidder-row margin-top-15';\n            pdpRow.style.cssText = 'display:flex;align-items:center;gap:6px;font-size:13px;width:100%;flex-wrap:wrap;overflow:hidden;max-width:100%;box-sizing:border-box;';\n            var pdpLbl = document.createElement('span');\n            pdpLbl.className = 'bco-pdp-bidder-label';\n            pdpLbl.textContent = 'HIGHEST BIDDER:';\n            pdpLbl.style.cssText = 'font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:rgba(255,255,255,0.6);white-space:nowrap;';\n            var pdpSp = document.createElement('span');\n            pdpSp.className = 'bco-pdp-bidder-name';\n            pdpSp.style.cssText = 'font-size:13px;font-weight:600;color:#4fd1c5;word-break:break-word;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 130px);';\n            pdpRow.appendChild(pdpLbl);\n            pdpRow.appendChild(pdpSp);\n            var bidCountRow = null;\n            pdpWidget.querySelectorAll('.margin-top-15, .margin-btm-15').forEach(function (r) {\n              if ((r.textContent || '').includes('Bid(s)')) bidCountRow = r;\n            });\n            if (bidCountRow && bidCountRow.parentNode) bidCountRow.parentNode.insertBefore(pdpRow, bidCountRow.nextSibling);\n            else pdpWidget.appendChild(pdpRow);\n          }\n          var pdpNameDisplay = pdpRow.querySelector('.bco-pdp-bidder-name');\n          if (pdpNameDisplay) { var _fpn = formatBidderName(pdpName); if (pdpNameDisplay.textContent !== _fpn) pdpNameDisplay.textContent = _fpn; }\n        }\n      }\n    }\n\n    // Run syncer with smart retry + backoff (Webkul renders async)\n    // v84 PERF: Replaces 5 separate setTimeout + 1 forever setInterval\n    // with a retry loop that stops once names are populated.\n    (function bidderNameRetry() {\n      var delays = [3000, 6000, 10000, 15000, 25000];\n      var idx = 0;\n      function trySync() {\n        if (idx >= delays.length) return;\n        setTimeout(function () {\n          syncBidderNames();\n          idx++;\n          trySync();\n        }, idx === 0 ? delays[0] : (delays[idx] - delays[idx - 1]));\n      }\n      trySync();\n    })();\n    window.bcpSyncBidderNames = syncBidderNames; // expose for manual call\n\n    // \u2500\u2500 HOME PAGE BIDDER NAME FETCHER \u2500\u2500\n    // On pages with auction carousel cards (home page), calls getProductsOnAuction\n    // to populate _minBidFromApi with bidder names, which syncBidderNames then reads.\n    // v81: Removed one-shot guard \u2014 retries until handles are available.\n    //      Uses data-auction-handle directly (always set synchronously during card\n    //      injection) so it doesn't depend on async /products/{handle}.js resolving PIDs.\n    var _homeBidderFetchRunning = false;\n    var _homeBidderFetchSuccess = false; // true once at least 1 name was cached\n    function fetchHomepageBidderNames() {\n      if (_homeBidderFetchRunning || _homeBidderFetchSuccess) return;\n      // Only run on pages with carousel/grid cards (NOT on PDP or auction grid page\n      // where Webkul natively renders .highest_bidder_name)\n      if (document.querySelector('#wk-auction')) return; // PDP has its own Source 3\n      var cards = document.querySelectorAll('.auction-card-info');\n      if (cards.length === 0) return;\n      // If native Webkul bidder names already exist (grid page), skip\n      if (document.querySelectorAll('.highest_bidder_name').length > 5) return;\n\n      // Build handle \u2192 card map from home page DOM\n      // v81: Use data-auction-handle (set synchronously) instead of data-product-id\n      //      (set asynchronously). Also collect PIDs when available for cache.\n      var handleToCards = {}; // handle \u2192 [card, ...]\n      var handleToPid = {};   // handle \u2192 pid (when available)\n      cards.forEach(function (card) {\n        var handle = card.getAttribute('data-auction-handle');\n        if (!handle) {\n          // Fallback: find product link in parent container\n          var container = card.closest('.swiper-slide, .grid__item, li, .product-card, div');\n          if (container) {\n            var linkEl = container.querySelector('a[href*=\"/products/\"]');\n            if (linkEl) {\n              var href = linkEl.getAttribute('href') || '';\n              var handleMatch = href.match(/\\/products\\/([^?#\\/]+)/);\n              if (handleMatch) handle = handleMatch[1];\n            }\n          }\n        }\n        if (!handle) return;\n        handle = handle.toLowerCase();\n        if (!handleToCards[handle]) handleToCards[handle] = [];\n        handleToCards[handle].push(card);\n\n        var pid = card.getAttribute('data-product-id') || card.getAttribute('data-auction-product-id');\n        if (pid) handleToPid[handle] = pid;\n      });\n\n      var handleKeys = Object.keys(handleToCards);\n      console.log('[BCO Home] handle\u2192cards map has', handleKeys.length, 'entries');\n      if (handleKeys.length === 0) return;\n\n      _homeBidderFetchRunning = true;\n\n      var _spc = window.spcObj;\n      if (!_spc || !_spc.api_url || !_spc.shop_name) {\n        console.log('[BCO Home] spcObj missing, cannot fetch bidder names');\n        _homeBidderFetchRunning = false;\n        return;\n      }\n\n      var src3CustId = '0';\n      var wkCustEl = document.querySelector('[cust-id]');\n      if (wkCustEl) src3CustId = wkCustEl.getAttribute('cust-id') || '0';\n\n      // Helper: write a bidder name directly into auction-card-info cards by handle\n      function writeNameToCards(handle, name) {\n        var targetCards = handleToCards[handle] || [];\n        targetCards.forEach(function (card) {\n          var displayEl = card.querySelector('.auction-card-info__highest-bidder');\n          var rowEl = card.querySelector('.auction-card-info__bidder-row');\n          if (!displayEl) {\n            // Inject bidder row if missing\n            var newRow = document.createElement('div');\n            newRow.className = 'auction-card-info__meta-row auction-card-info__bidder-row';\n            var lbl = document.createElement('span');\n            lbl.className = 'auction-card-info__highest-bidder-label';\n            lbl.textContent = 'Highest Bidder: ';\n            var sp = document.createElement('span');\n            sp.className = 'auction-card-info__highest-bidder';\n            newRow.appendChild(lbl);\n            newRow.appendChild(sp);\n            var srEl = card.querySelector('.auction-card-info__status-row, .auction-card-info__bid-form');\n            if (srEl) card.insertBefore(newRow, srEl);\n            else card.appendChild(newRow);\n            displayEl = sp;\n            rowEl = newRow;\n          }\n          if (displayEl) { var _fn3 = formatBidderName(name); if (displayEl.textContent !== _fn3) displayEl.textContent = _fn3; }\n          if (rowEl && rowEl.style.display === 'none') rowEl.style.display = '';\n        });\n      }\n\n      function fetchPage(pageNum) {\n        if (pageNum > 5) {\n          console.log('[BCO Home] Finished fetching bidder names (pages 1-' + (pageNum - 1) + ')');\n          syncBidderNames();\n          _homeBidderFetchRunning = false;\n          return;\n        }\n\n        var params = new URLSearchParams();\n        params.append('p', 'wk_ajax_process');\n        params.append('callback', 'getProductsOnAuction');\n        params.append('shop_name', _spc.shop_name);\n        params.append('cust_id', src3CustId);\n        if (pageNum > 1) params.append('page', String(pageNum));\n        if (_spc.timediff !== undefined) params.append('timediff', String(_spc.timediff));\n        var gc = '', ac = '', tc = '';\n        try { gc = btoa(JSON.stringify(_spc.general_config || {})); } catch (e) { }\n        try { ac = btoa(JSON.stringify(_spc.auction_config || {})); } catch (e) { }\n        try { tc = btoa(JSON.stringify(_spc.theme_colors || {})); } catch (e) { }\n        if (gc) params.append('general_config', encodeURIComponent(gc));\n        if (ac) params.append('auction_config', encodeURIComponent(ac));\n        if (_spc.widget_config) params.append('widget_config', unescape(encodeURIComponent(_spc.widget_config)));\n        if (tc) params.append('theme_colors', encodeURIComponent(tc));\n        if (typeof Shopify !== 'undefined' && Shopify.currency) {\n          params.append('active_currency', typeof Shopify.currency === 'object' ? JSON.stringify(Shopify.currency) : String(Shopify.currency));\n        }\n        params.append('_t', String(Date.now()));\n\n        var url = _spc.api_url + 'index.php?' + params.toString();\n\n        fetch(url)\n          .then(function (r) { return r.text(); })\n          .then(function (text) {\n            if (!text || text.length < 50) {\n              console.log('[BCO Home] Empty response on page', pageNum, '\u2014 done');\n              syncBidderNames();\n              _homeBidderFetchRunning = false;\n              return;\n            }\n            var start = text.indexOf('(');\n            var end = text.lastIndexOf(')');\n            if (start === -1 || end <= start) { _homeBidderFetchRunning = false; return; }\n            var inner = text.substring(start + 1, end);\n\n            var html = inner;\n            try {\n              var parsed = JSON.parse(inner);\n              if (typeof parsed === 'string') html = parsed;\n            } catch (e) {\n              if (inner.charAt(0) === '\"' && inner.charAt(inner.length - 1) === '\"') {\n                try { html = JSON.parse(inner); } catch (e2) { html = inner.substring(1, inner.length - 1); }\n              }\n            }\n            if (!html || typeof html !== 'string') { _homeBidderFetchRunning = false; return; }\n            html = html.replace(/\\\\n/g, '\\n').replace(/\\\\r/g, '\\r').replace(/\\\\t/g, '\\t').replace(/\\\\\"/g, '\"').replace(/\\\\\\\\/g, '\\\\');\n\n            // v7 FIX: Use DOMParser instead of regex-window to extract bidder names.\n            // The old approach used a \u00B11500 char window around each product handle,\n            // which caused cross-contamination when products were close together in HTML.\n            // DOMParser guarantees each bidder name is extracted from the SAME card element.\n            var foundCount = 0;\n            try {\n              var homeParser = new DOMParser();\n              var homeDoc = homeParser.parseFromString(html, 'text/html');\n              // Each product card in Webkul's bulk response has an <a> with /products/{handle}\n              // and a .highest_bidder_name element within the same card container.\n              var allHomeLinks = homeDoc.querySelectorAll('a[href*=\"/products/\"]');\n              var processedHandles = {};\n              allHomeLinks.forEach(function (linkEl) {\n                var hrefVal = linkEl.getAttribute('href') || '';\n                var hMatch = hrefVal.match(/\\/products\\/([^?#\\/]+)/);\n                if (!hMatch) return;\n                var foundHandle = hMatch[1].toLowerCase();\n                if (processedHandles[foundHandle]) return;\n                processedHandles[foundHandle] = true;\n                if (!handleToCards[foundHandle]) return; // not one of our home page cards\n\n                var pid = handleToPid[foundHandle];\n                if (pid && _minBidFromApi[pid] && _minBidFromApi[pid].highestBidderName) return;\n\n                // Walk up to find the card container, then look for bidder name WITHIN it\n                var cardContainer = linkEl.closest('tr, div, li, td') || linkEl.parentElement;\n                // Try multiple levels up to find the highest_bidder_name within the same product block\n                var nameEl = null;\n                var searchEl = cardContainer;\n                for (var walk = 0; walk < 5 && searchEl && !nameEl; walk++) {\n                  nameEl = searchEl.querySelector('.highest_bidder_name');\n                  if (!nameEl) {\n                    // Also try broader text-based search within this container\n                    searchEl.querySelectorAll('div, span, td').forEach(function (el) {\n                      if (!nameEl && el.textContent && el.textContent.includes('Highest Bidder:')) {\n                        var parts = el.textContent.split('Highest Bidder:');\n                        if (parts[1] && parts[1].trim() && !parts[1].includes('{')) {\n                          nameEl = { textContent: parts[1].replace(/\\n/g, ' ').split(/[\\r\\n]/)[0].trim() };\n                        }\n                      }\n                    });\n                  }\n                  if (!nameEl) searchEl = searchEl.parentElement;\n                }\n\n                var name = nameEl ? nameEl.textContent.trim() : '';\n                if (!name || /^USD\\s/i.test(name) || /^\\$/.test(name) || /^\\d/.test(name)) return;\n\n                if (pid) {\n                  if (_minBidFromApi[pid]) _minBidFromApi[pid].highestBidderName = name;\n                  else _minBidFromApi[pid] = { highestBidderName: name };\n                }\n\n                writeNameToCards(foundHandle, name);\n                foundCount++;\n              });\n            } catch (domErr) {\n              console.warn('[BCO Home] DOMParser extraction failed:', domErr.message);\n            }\n\n            if (foundCount > 0) _homeBidderFetchSuccess = true;\n            console.log('[BCO Home] Page', pageNum, ':', foundCount, 'bidder names cached & written');\n            syncBidderNames();\n\n            // If this page had content, try the next page\n            if (html.length > 200) {\n              fetchPage(pageNum + 1);\n            } else {\n              _homeBidderFetchRunning = false;\n            }\n          })\n          .catch(function (err) {\n            console.log('[BCO Home] Page', pageNum, 'error:', err.message);\n            _homeBidderFetchRunning = false;\n          });\n      }\n\n      fetchPage(1);\n    }\n\n     // Start homepage bidder name fetch after cards are set up\n    // v84 PERF: Consolidated 4 separate setTimeout calls into a single\n    // retry loop. fetchHomepageBidderNames already has its own early-exit\n    // guard (_homeBidderFetchSuccess), so calling it multiple times is safe\n    // but we reduce from 4 outstanding timers to 1 active at a time.\n    if (hasAuctionCards) {\n      (function homeBidderRetry() {\n        var delays = [3000, 6000, 10000, 15000];\n        var idx = 0;\n        function tryNext() {\n          if (idx >= delays.length || _homeBidderFetchSuccess) return;\n          setTimeout(function () {\n            if (!_homeBidderFetchSuccess) fetchHomepageBidderNames();\n            idx++;\n            tryNext();\n          }, idx === 0 ? delays[0] : (delays[idx] - delays[idx - 1]));\n        }\n        tryNext();\n      })();\n    }\n\n    // Re-init on Shopify section events\n    ['facets:updated', 'collection:updated', 'shopify:section:load'].forEach(\n      event => document.addEventListener(event, () => {\n        setTimeout(() => {\n          setupEndingSoonButton();\n          setupMyBidsButton();\n          setupBidWidgets();\n        }, 500);\n      })\n    );\n\n    // \u2500\u2500 Product Recommendations: watch for async-loaded cards \u2500\u2500\n    // Shopify's <product-recommendations> element loads content via\n    // fetch() after initial DOMContentLoaded. By the time it renders,\n    // our init polling has already finished. This observer detects\n    // new .auction-card-info elements and re-hydrates them.\n    var recEls = document.querySelectorAll('product-recommendations');\n    recEls.forEach(function (recEl) {\n      var recObserver = new MutationObserver(function (mutations) {\n        var hasNewCards = false;\n        for (var i = 0; i < mutations.length; i++) {\n          var added = mutations[i].addedNodes;\n          for (var j = 0; j < added.length; j++) {\n            var node = added[j];\n            if (node.nodeType !== 1) continue;\n            if (node.classList && node.classList.contains('auction-card-info')) {\n              hasNewCards = true;\n              break;\n            }\n            if (node.querySelector && node.querySelector('.auction-card-info')) {\n              hasNewCards = true;\n              break;\n            }\n          }\n          if (hasNewCards) break;\n        }\n        if (hasNewCards) {\n          // Wait for Webkul to render auction data in the new cards\n          waitForWebkul(\n            function () {\n              return !!recEl.querySelector('.wk-category-auction .wk-current-bid, .wk-category-auction .pa-timer');\n            },\n            function () {\n              setupBidWidgets();\n              setupApiPoll(); // Start API poll if not already running\n            }, 250, 8000\n          );\n        }\n      });\n      recObserver.observe(recEl, { childList: true, subtree: true });\n    });\n\n    // \u2500\u2500 Topbar Glassmorphism (all pages) \u2500\u2500\n    // The topbar timer appears on every page; run glassmorphism globally\n    // so mobile single-line layout and styling apply everywhere.\n    waitForWebkul(\n      function () { return !!document.querySelector('.hc_cd.at_top'); },\n      function () {\n        setupPdpGlassmorphism();\n      }, 300, 10000\n    );\n    // Periodic re-application (Webkul can re-render the topbar)\n    // v84 PERF: Reduced from 5s to 15s, self-clearing after 60s.\n    // The initial waitForWebkul handles setup; this is only for re-renders.\n    var _glassCount = 0;\n    var _glassTimer = setInterval(function () {\n      _glassCount++;\n      if (_glassCount >= 4) { clearInterval(_glassTimer); return; } // 4 \u00D7 15s = 60s\n      if (document.hidden) return; // v84 PERF: skip when tab hidden\n      if (document.querySelector('.hc_cd.at_top')) setupPdpGlassmorphism();\n    }, 15000);\n\n    // \u2500\u2500 PDP-Only Refinements (Stepper) \u2500\u2500\n    if (window.location.pathname.includes('/products/')) {\n\n      // \u2500\u2500 Stepper: aggressive retry until #bid_amount is found & enhanced \u2500\u2500\n      var _stepperInstalled = false;\n      var _stepperAttempts = 0;\n      var _stepperInterval = setInterval(function () {\n        _stepperAttempts++;\n        if (_stepperInstalled || _stepperAttempts > 120) { // Give up after 30s\n          clearInterval(_stepperInterval);\n          return;\n        }\n        var bidInput = document.querySelector('#bid_amount, #wk_bid_amount');\n        if (bidInput && !bidInput.hasAttribute('data-enhanced')) {\n          setupPdpStepper();\n          // Check if it worked\n          if (document.querySelector('[data-enhanced=\"true\"]')) {\n            _stepperInstalled = true;\n            clearInterval(_stepperInterval);\n            console.log('[BCO PDP] Stepper installed successfully after ' + _stepperAttempts + ' attempts.');\n          }\n        }\n      }, 250);\n    }\n  }\n\n  // Force an initial poll on load to ensure data is fresh (fixes initial discrepancies)\n  setTimeout(function () {\n    if (typeof doPoll === 'function') doPoll();\n  }, 1000);\n\n  // Start when DOM is ready\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', init);\n  } else {\n    setTimeout(init, 100);\n  }\n})();\n\n// \u2500\u2500\u2500 ROUND 22 FIX: Enforce Two-Line Mobile Layout via Observer \u2500\u2500\u2500\nfunction enforceMobileActionBarLayout() {\n  if (window.innerWidth > 768) return; // Only process on mobile\n\n  var actionRow = document.querySelector('.collection-filter__item--auction-actions');\n  if (!actionRow) return;\n\n  var searchGroup = document.querySelector('.bco-search-group');\n  var sortGroup = document.querySelector('.bco-sort-group');\n\n  if (searchGroup && sortGroup) {\n    var wrapper = document.getElementById('bco-mobile-search-sort-wrapper');\n    if (!wrapper) {\n      wrapper = document.createElement('div');\n      wrapper.id = 'bco-mobile-search-sort-wrapper';\n      // Force 100% width, flexbox for inline elements\n      wrapper.style.cssText = 'width: 100%; display: flex; justify-content: space-between; align-items: stretch; gap: 10px; margin-top: 15px; margin-bottom: 5px; flex-wrap: nowrap; box-sizing: border-box; clear: both; overflow: hidden; position: relative;';\n\n      // We insert the wrapper AFTER the actionRow itself, completely escaping the parent flex container\n      actionRow.parentNode.insertBefore(wrapper, actionRow.nextSibling);\n    }\n\n    // Move search and sort OUT of actionRow into the new wrapper below it\n    if (searchGroup.parentNode !== wrapper) wrapper.appendChild(searchGroup);\n    if (sortGroup.parentNode !== wrapper) wrapper.appendChild(sortGroup);\n\n    // CRITICAL FIX: Webkul uses absolute positioning on mobile for search, which causes the overlap.\n    // We must nuke their absolute positioning and force static/relative flow.\n    searchGroup.style.setProperty('position', 'relative', 'important');\n    searchGroup.style.setProperty('width', 'calc(55% - 8px)', 'important');\n    searchGroup.style.setProperty('flex', '0 0 auto', 'important');\n    searchGroup.style.setProperty('min-width', '0', 'important');\n    searchGroup.style.setProperty('display', 'block', 'important');\n    searchGroup.style.setProperty('overflow', 'hidden', 'important');\n\n    // Nuke absolute positioning on forms/wrappers inside search group\n    var searchForm = searchGroup.querySelector('form, .wk_search_div');\n    if (searchForm) {\n      searchForm.style.position = 'relative';\n      searchForm.style.width = '100%';\n      searchForm.style.display = 'block';\n      searchForm.style.top = 'auto';\n      searchForm.style.left = 'auto';\n      searchForm.style.right = 'auto';\n    }\n\n    var input = searchGroup.querySelector('input');\n    if (input) {\n      input.style.width = '100%';\n      input.style.minWidth = '0';\n      input.style.height = '40px';\n      input.style.boxSizing = 'border-box';\n    }\n\n    // Fix sort dropdown spacing\n    sortGroup.style.setProperty('position', 'relative', 'important');\n    sortGroup.style.setProperty('width', 'calc(45% - 8px)', 'important');\n    sortGroup.style.setProperty('flex', '0 0 auto', 'important');\n    sortGroup.style.setProperty('display', 'block', 'important');\n    // REMOVED 'overflow: hidden' to prevent cutting off the dropdown text/arrows\n    sortGroup.style.setProperty('overflow', 'visible', 'important');\n\n    var sortDiv = sortGroup.querySelector('.wk_sort_div');\n    if (sortDiv) {\n      sortDiv.style.position = 'relative';\n      sortDiv.style.width = '100%';\n      sortDiv.style.top = 'auto';\n      sortDiv.style.right = 'auto';\n    }\n\n    var select = sortGroup.querySelector('select');\n    if (select) {\n      select.style.setProperty('width', '100%', 'important');\n      select.style.setProperty('min-width', '0', 'important');\n      select.style.setProperty('max-width', '100%', 'important');\n      select.style.setProperty('height', '40px', 'important');\n\n      // Add typography guards to elegantly display \"Select Sort By\"\n      select.style.setProperty('text-overflow', 'ellipsis', 'important');\n      select.style.setProperty('white-space', 'nowrap', 'important');\n      select.style.setProperty('padding-right', '15px', 'important'); // Space for dropdown arrow\n    }\n  }\n}\n\n// Ensure it runs once\nenforceMobileActionBarLayout();\n\n// Ensure it runs dynamically as Webkul updates the DOM\nvar filterContainer = document.querySelector('.collection-filter');\nif (filterContainer) {\n  var actionBarObserver = new MutationObserver(function (mutations) {\n    if (window.innerWidth <= 768) {\n      enforceMobileActionBarLayout();\n    }\n  });\n  actionBarObserver.observe(filterContainer, { childList: true, subtree: true });\n}\n\nwindow.addEventListener('resize', function () {\n  if (window.innerWidth <= 768) {\n    enforceMobileActionBarLayout();\n  } else {\n    // Desktop cleanup could go here, but a page reload is assumed standard for major viewport shifts in this theme\n  }\n});\n\n// \u2500\u2500\u2500 FAILSAFE: Webkul DOM-Watcher for Highest Bidder Name \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Webkul injects .highest_bidder_name elements into its own widgets after\n// async rendering. On collection pages this works fine. On home page slider\n// and PDP the timing/structure differs. This MutationObserver catches every\n// .highest_bidder_name insertion anywhere in the document and immediately\n// propagates the name to our display rows \u2014 regardless of API timing.\n(function () {\n  'use strict';\n\n  function applyBidderName(nameEl) {\n    var name = nameEl ? nameEl.textContent.trim() : '';\n    if (!name || name.length < 2 || name === 'undefined' || name === '-') return;\n\n    // \u2500\u2500 Case 1: Grid / Home-page slider card \u2500\u2500\n    // Walk up to find the nearest .auction-card-info\n    var card = nameEl.closest && nameEl.closest('.auction-card-info');\n    if (!card) {\n      var gridItem = nameEl.closest &&\n        nameEl.closest('li, .product-card, product-card, .grid__item, .slider-item, .swiper-slide, .wkgrid, [class*=\"wkcol-\"]');\n      if (gridItem) card = gridItem.querySelector('.auction-card-info');\n    }\n    if (!card) {\n      var wkParent = nameEl.closest && nameEl.closest('.wk-category-auction');\n      if (wkParent && wkParent.parentElement) {\n        card = wkParent.parentElement.querySelector('.auction-card-info');\n      }\n    }\n\n    if (card) {\n      var displayEl = card.querySelector('.auction-card-info__highest-bidder');\n      var rowEl = card.querySelector('.auction-card-info__bidder-row');\n      if (!displayEl) {\n        var newRow = document.createElement('div');\n        newRow.className = 'auction-card-info__meta-row auction-card-info__bidder-row';\n        var lbl = document.createElement('span');\n        lbl.className = 'auction-card-info__highest-bidder-label';\n        lbl.textContent = 'Highest Bidder: ';\n        var sp = document.createElement('span');\n        sp.className = 'auction-card-info__highest-bidder';\n        newRow.appendChild(lbl);\n        newRow.appendChild(sp);\n        var anchor = card.querySelector('.auction-card-info__status-row, .auction-card-info__bid-form');\n        if (anchor) card.insertBefore(newRow, anchor);\n        else card.appendChild(newRow);\n        displayEl = sp;\n        rowEl = newRow;\n      }\n      { var _fn4 = formatBidderName(name); if (displayEl.textContent !== _fn4) displayEl.textContent = _fn4; }\n      if (rowEl && rowEl.style.display === 'none') rowEl.style.display = '';\n      return;\n    }\n\n    // \u2500\u2500 Case 2: PDP \u2500\u2500\n    var pdpWidget = document.querySelector('#wk-auction');\n    if (pdpWidget) {\n      var pdpRow = pdpWidget.querySelector('.bco-pdp-bidder-row');\n      if (!pdpRow) {\n        pdpRow = document.createElement('div');\n        pdpRow.className = 'bco-pdp-bidder-row';\n        pdpRow.style.cssText = 'display:flex;align-items:center;gap:6px;font-size:13px;margin-top:10px;overflow:hidden;max-width:100%;box-sizing:border-box;';\n        var pdpLbl = document.createElement('span');\n        pdpLbl.textContent = 'HIGHEST BIDDER:';\n        pdpLbl.style.cssText = 'font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:rgba(255,255,255,0.6);white-space:nowrap;';\n        var pdpSp = document.createElement('span');\n        pdpSp.className = 'bco-pdp-bidder-name';\n        pdpSp.style.cssText = 'font-size:13px;font-weight:600;color:#4fd1c5;word-break:break-word;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 130px);';\n        pdpRow.appendChild(pdpLbl);\n        pdpRow.appendChild(pdpSp);\n        var bidCountRow = null;\n        pdpWidget.querySelectorAll('*').forEach(function (el) {\n          if (!bidCountRow && /\\d+\\s*Bid/.test(el.textContent || '') && el.children.length === 0) {\n            bidCountRow = el.parentElement;\n          }\n        });\n        if (bidCountRow && bidCountRow.parentNode) {\n          bidCountRow.parentNode.insertBefore(pdpRow, bidCountRow.nextSibling);\n        } else {\n          pdpWidget.appendChild(pdpRow);\n        }\n      }\n      var pdpNameEl = pdpRow.querySelector('.bco-pdp-bidder-name');\n      if (pdpNameEl) { var _fpn2 = formatBidderName(name); if (pdpNameEl.textContent !== _fpn2) pdpNameEl.textContent = _fpn2; }\n    }\n  }\n\n  function scanExisting() {\n    document.querySelectorAll('.highest_bidder_name').forEach(applyBidderName);\n  }\n\n  // Watch for Webkul DOM insertions\n  // v84 PERF: Scope to auction containers when available, with debounce.\n  // Watching document.body with subtree:true fires hundreds of times/sec on\n  // the auction page. We scope to #products_on_auction or .wkcontainer if\n  // possible, falling back to document.body only when neither exists.\n  var _bidderDomWatcherPending = false;\n  var domWatcher = new MutationObserver(function (mutations) {\n    if (_bidderDomWatcherPending) return; // debounce\n    _bidderDomWatcherPending = true;\n    setTimeout(function () {\n      _bidderDomWatcherPending = false;\n      for (var i = 0; i < mutations.length; i++) {\n        var added = mutations[i].addedNodes;\n        for (var j = 0; j < added.length; j++) {\n          var node = added[j];\n          if (node.nodeType !== 1) continue;\n          if (node.classList && node.classList.contains('highest_bidder_name')) {\n            applyBidderName(node);\n          } else if (node.querySelectorAll) {\n            node.querySelectorAll('.highest_bidder_name').forEach(applyBidderName);\n          }\n        }\n      }\n    }, 200);\n  });\n\n  function startBidderDomWatcher() {\n    // Try scoped containers first (much less noise than document.body)\n    var scope = document.querySelector('#products_on_auction') ||\n                document.querySelector('.wkcontainer') ||\n                document.querySelector('#wk-auction');\n    var target = scope || document.body;\n    domWatcher.observe(target, { childList: true, subtree: true });\n    if (scope) {\n      console.log('[BCO v84] Bidder DOM watcher scoped to:', scope.id || scope.className);\n    }\n  }\n\n  if (document.body) {\n    startBidderDomWatcher();\n  } else {\n    document.addEventListener('DOMContentLoaded', startBidderDomWatcher);\n  }\n\n  // Boot scan with backoff to catch late Webkul renders\n  // v84 PERF: Single retry loop instead of 4 separate setTimeout calls\n  function bootScan() {\n    scanExisting();\n    var bootDelays = [3000, 7000, 12000];\n    var bootIdx = 0;\n    function bootNext() {\n      if (bootIdx >= bootDelays.length) return;\n      setTimeout(function () {\n        scanExisting();\n        bootIdx++;\n        bootNext();\n      }, bootIdx === 0 ? bootDelays[0] : (bootDelays[bootIdx] - bootDelays[bootIdx - 1]));\n    }\n    bootNext();\n  }\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', bootScan);\n  } else {\n    bootScan();\n  }\n})();\n\n\n  /**\n   * Popcorn Bid Animation\n   * Creates a burst of \"popcorn\" particles over the target card.\n   */\n  function triggerPopcornAnimation(container, isLastMinute) {\n    if (!container) return;\n\n    // 1. Create Canvas Element\n    var canvas = document.createElement('canvas');\n    canvas.className = 'bco-popcorn-canvas';\n    if (isLastMinute) canvas.classList.add('is-last-minute');\n    \n    // Position absolute covering the entire card\n    canvas.style.position = 'absolute';\n    canvas.style.top = '0';\n    canvas.style.left = '0';\n    canvas.style.width = '100%';\n    canvas.style.height = '100%';\n    canvas.style.pointerEvents = 'none';\n    canvas.style.zIndex = '100';\n    \n    container.style.position = 'relative'; // Ensure parent is relative\n    container.appendChild(canvas);\n\n    var ctx = canvas.getContext('2d');\n    var rect = canvas.getBoundingClientRect();\n    canvas.width = rect.width;\n    canvas.height = rect.height;\n\n    // 2. Particle System\n    var particles = [];\n    var particleCount = isLastMinute ? 40 : 25;\n    var colors = isLastMinute ? ['#ff4fd1', '#4fd1c5', '#ffffff', '#ffd700'] : ['#4fd1c5', '#ffffff', '#27a8e0'];\n    \n    function createParticle() {\n      return {\n        x: canvas.width / 2,\n        y: canvas.height / 2,\n        vx: (Math.random() - 0.5) * 10,\n        vy: (Math.random() - 0.5) * 10 - 2,\n        radius: Math.random() * 4 + 2,\n        color: colors[Math.floor(Math.random() * colors.length)],\n        alpha: 1,\n        life: 1.0,\n        decay: Math.random() * 0.02 + 0.015\n      };\n    }\n\n    for (var i = 0; i < particleCount; i++) {\n      particles.push(createParticle());\n    }\n\n    // 3. Animation Loop\n    function animate() {\n      if (particles.length === 0) {\n        canvas.remove();\n        return;\n      }\n\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n      \n      for (var i = particles.length - 1; i >= 0; i--) {\n        var p = particles[i];\n        p.x += p.vx;\n        p.y += p.vy;\n        p.vy += 0.2; // Gravity\n        p.life -= p.decay;\n        p.alpha = Math.max(0, p.life);\n\n        if (p.alpha <= 0) {\n          particles.splice(i, 1);\n          continue;\n        }\n\n        ctx.beginPath();\n        ctx.arc(p.x, p.y, p.radius, 0, Math.PI * 2);\n        ctx.fillStyle = p.color;\n        ctx.globalAlpha = p.alpha;\n        ctx.fill();\n        ctx.closePath();\n      }\n\n      requestAnimationFrame(animate);\n    }\n\n    // High performance hint: Use CSS transition for a secondary flash\n    container.classList.add('auction-card-info--popcorn-active');\n    setTimeout(function() {\n      container.classList.remove('auction-card-info--popcorn-active');\n    }, 1500);\n\n    animate();\n  }\n\n  // Set the function globally so PDP can also use it\n  window.triggerPopcornAnimation = triggerPopcornAnimation;\n"],
  "mappings": "CAcC,UAA2B,CAC1B,GAAI,CAAC,OAAO,SAAS,SAAS,SAAS,YAAY,EAAG,OAEtD,IAAI,UAAY,GAEhB,SAAS,oBAAqB,CAE5B,IAAI,WAAa,SAAS,iBAAiB,gFAAgF,EAC3H,WAAW,QAAQ,SAAS,MAAO,CAC7B,MAAM,YACV,MAAM,UAAY,GAClB,MAAM,MAAM,YAAY,aAAc,4BAA6B,WAAW,EAC9E,MAAM,MAAM,YAAY,kBAAmB,aAAc,WAAW,EACpE,MAAM,MAAM,YAAY,0BAA2B,aAAc,WAAW,EAC5E,MAAM,MAAM,YAAY,SAAU,sCAAuC,WAAW,EACpF,MAAM,MAAM,YAAY,gBAAiB,OAAQ,WAAW,EAC5D,MAAM,MAAM,YAAY,UAAW,OAAQ,WAAW,EACtD,MAAM,MAAM,YAAY,aAAc,OAAQ,WAAW,EACzD,MAAM,MAAM,YAAY,aAAc,mEAAoE,WAAW,EACrH,MAAM,MAAM,YAAY,QAAS,UAAW,WAAW,EACzD,CAAC,EAGD,IAAI,UAAY,S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AAU,CACjB,GAAI,UAAU,SAAW,EAAG,CAC1B,OAAO,OAAO,EACd,MACF,CAEA,IAAI,UAAU,EAAG,EAAG,OAAO,MAAO,OAAO,MAAM,EAE/C,QAASM,GAAI,UAAU,OAAS,EAAGA,IAAK,EAAGA,KAAK,CAC9C,IAAI,EAAI,UAAUA,EAAC,EAOnB,GANA,EAAE,GAAK,EAAE,GACT,EAAE,GAAK,EAAE,GACT,EAAE,IAAM,GACR,EAAE,MAAQ,EAAE,MACZ,EAAE,MAAQ,KAAK,IAAI,EAAG,EAAE,IAAI,EAExB,EAAE,OAAS,EAAG,CAChB,UAAU,OAAOA,GAAG,CAAC,EACrB,QACF,CAEA,IAAI,UAAU,EACd,IAAI,IAAI,EAAE,EAAG,EAAE,EAAG,EAAE,OAAQ,EAAG,KAAK,GAAK,CAAC,EAC1C,IAAI,UAAY,EAAE,MAClB,IAAI,YAAc,EAAE,MACpB,IAAI,KAAK,EACT,IAAI,UAAU,CAChB,CAEA,sBAAsB,OAAO,CAC/B,CAGA,UAAU,UAAU,IAAI,mCAAmC,EAC3D,WAAW,UAAW,CACpB,UAAU,UAAU,OAAO,mCAAmC,CAChE,EAAG,IAAI,EAEP,QAAQ,CACV,CAGA,OAAO,wBAA0B",
  "names": ["formatBidderName", "masterContainer", "seenProductIds", "fragment", "pageNum", "nextMin", "pdpWidget", "pid", "doPoll", "c", "currentCustId", "s", "i"]
}
