= 0 && formButtonRect.bottom <= window.innerHeight);
// Check if color swatches are visible on mobile/tablet
const colourSwatches = document.getElementById('colourSwatches');
const swatchesVisible = colourSwatches &&
window.innerWidth <= 915 &&
colourSwatches.getBoundingClientRect().top >= 0 &&
colourSwatches.getBoundingClientRect().bottom <= window.innerHeight &&
colourSwatches.getBoundingClientRect().top < (window.innerHeight / 2);
// Handle header visibility with threshold
if (!scrollUp && currentScrollPosition > scrollThreshold && showAtc && (variantAvailable || allowStickyWhenSoldOut || !showBackInStock)) {
document.body.classList.add('hide-sticky-header');
} else if (swatchesVisible) {
document.body.classList.add('hide-sticky-header');
} else {
document.body.classList.remove('hide-sticky-header');
}
"
>
Extend Protection Plan
Extend Protection Plan
Extend Protection Plan