←
<!--
►
Rice Water & Niacinamide Serum (30ml)
-->
►
Under eye roll on serum
►
COMBO OFFER – BUY 2 CREME X
►
Vitamin C Gel Face Wash
→
#wbWatchBuy {
max-width: 1300px;
margin: 0 auto;
padding: 40px 20px;
font-family: inherit;
box-sizing: border-box;
}
#wbWatchBuy * {
box-sizing: border-box;
}
.wb-title {
text-align: center;
font-size: 42px;
font-weight: 400;
color: #333;
margin: 0 0 30px;
}
.wb-carousel-wrap {
position: relative;
display: flex;
align-items: center;
}
.wb-track {
display: flex;
gap: 18px;
overflow-x: auto;
scroll-behavior: smooth;
padding: 6px;
scrollbar-width: none;
}
.wb-track::-webkit-scrollbar {
display: none;
}
.wb-card {
position: relative;
flex: 0 0 auto;
width: 220px;
aspect-ratio: 9/16;
border-radius: 14px;
overflow: hidden;
cursor: pointer;
background: #eee;
box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
transition: transform .25s ease;
}
.wb-card:hover {
transform: translateY(-4px);
}
.wb-thumb {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.wb-thumb-wrap {
position: relative;
width: 100%;
height: 100%;
}
.wb-thumb-wrap iframe {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 177.78%;
min-height: 100%;
min-width: 56.25%;
transform: translate(-50%, -50%);
pointer-events: none;
border: 0;
}
.wb-thumb-wrap .wb-thumb {
position: absolute;
inset: 0;
z-index: 1;
transition: opacity .25s ease;
}
.wb-thumb-wrap.wb-preview-playing .wb-thumb {
opacity: 0;
}
.wb-play-badge {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 46px;
height: 46px;
border-radius: 50%;
background: rgba(0, 0, 0, .45);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
opacity: 0;
transition: opacity .2s ease;
pointer-events: none;
}
.wb-card:hover .wb-play-badge {
opacity: 1;
}
.wb-card-label {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 10px 12px 12px;
background: linear-gradient(to top, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0));
color: #fff;
font-size: 14px;
font-weight: 500;
line-height: 1.25;
}
.wb-arrow {
flex: 0 0 auto;
width: 42px;
height: 42px;
border-radius: 100%;
border: none;
background: #e8007000;
color: #e80071;
box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
font-size: 18px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
padding: 0!important;
}
/* .wb-arrow-prev {
margin-right: -21px;
}
.wb-arrow-next {
margin-left: -21px;
} */
/* Lightbox */
.wb-lightbox {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, .92);
z-index: 99999;
align-items: center;
justify-content: center;
}
.wb-lightbox.wb-open {
display: flex;
}
.wb-close {
position: absolute;
top: 18px;
right: 24px;
color: #fff;
font-size: 34px;
cursor: pointer;
line-height: 1;
z-index: 3;
}
.wb-lb-stage {
display: flex;
align-items: center;
justify-content: center;
gap: 18px;
height: 92vh;
max-height: 92vh;
width: 100%;
}
.wb-lb-card {
border-radius: 14px;
overflow: hidden;
background: #111;
flex: 0 0 auto;
}
.wb-lb-side {
width: 260px;
height: 90%;
opacity: .35;
filter: blur(1px);
display: none;
}
.wb-lb-side img {
width: 100%;
height: 100%;
object-fit: cover;
}
@media(min-width:1100px) {
.wb-lb-side {
display: block;
}
}
.wb-lb-main {
position: relative;
width: min(420px, 92vw);
height: 100%;
display: flex;
flex-direction: column;
background: #000;
}
.wb-player-hover-zone {
position: relative;
flex: 1 1 auto;
min-height: 0;
}
.wb-player-hover-zone iframe,
#wbPlayer {
width: 100%;
height: 100%;
display: block;
}
.wb-pp-btn {
position: absolute;
top: 14px;
left: 14px;
width: 38px;
height: 38px;
border-radius: 50%;
border: none;
background: rgba(0, 0, 0, .55);
color: #fff;
font-size: 14px;
cursor: pointer;
opacity: 0;
transition: opacity .2s ease;
z-index: 4;
}
.wb-player-hover-zone:hover .wb-pp-btn {
opacity: 1;
}
.wb-product-box {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 12px;
background: #fff;
padding: 14px;
}
.wb-product-thumb {
flex: 0 0 auto;
width: 56px;
height: 72px;
border-radius: 6px;
overflow: hidden;
display: block;
border: 1px solid #eee;
}
.wb-product-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}
.wb-product-info {
flex: 1 1 auto;
min-width: 0;
}
.wb-product-name {
font-size: 14px;
font-weight: 600;
color: #222;
line-height: 1.3;
margin-bottom: 4px;
}
.wb-price-row {
font-size: 14px;
}
.wb-price-new {
font-weight: 700;
color: #222;
margin-right: 8px;
}
.wb-price-old {
color: #999;
text-decoration: line-through;
}
.wb-add-cart-btn {
flex: 0 0 auto;
background: #111;
color: #fff;
text-decoration: none;
font-size: 13px;
font-weight: 600;
letter-spacing: .5px;
padding: 12px 16px;
border-radius: 6px;
white-space: nowrap;
}
.wb-add-cart-btn:hover {
background: #333;
color: #fff;
}
.wb-lb-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 44px;
height: 44px;
border-radius: 50%;
border: none;
background: #fff;
color: #e80071;
font-size: 18px;
cursor: pointer;
z-index: 3;
padding: 0!important;
}
.wb-lb-prev {
left: 18px;
}
.wb-lb-next {
right: 18px;
}
.wb-powered {
position: absolute;
bottom: 10px;
left: 0;
right: 0;
text-align: center;
color: #aaa;
font-size: 12px;
}
@media(max-width:768px) {
.wb-title {
font-size: 28px;
}
.wb-card {
width: 150px;
}
.wb-lb-main {
width: 100vw;
height: 90vh;
border-radius: 10px;
}
.wb-lb-stage {
height: 100vh;
max-height: 100vh;
}
.wb-arrow {
width: 34px;
height: 34px;
}
.lightbox-media{
height: calc(100dvh - 88px); /* Adjust according to product box height */
}
}
(function () {
var cards = Array.prototype.slice.call(document.querySelectorAll('#wbTrack .wb-card'));
// ----- Autoplay looping previews inside the carousel cards -----
function buildPreviewIframe(videoId) {
var f = document.createElement('iframe');
f.src = "https://www.youtube.com/embed/" + videoId +
"?autoplay=1&mute=1&loop=1&playlist=" + videoId +
"&controls=0&playsinline=1&modestbranding=1&rel=0&showinfo=0";
f.allow = "autoplay; encrypted-media";
f.frameBorder = "0";
return f;
}
function loadPreview(card) {
var wrap = card.querySelector('.wb-thumb-wrap');
if (!wrap || wrap.dataset.loaded) return;
wrap.dataset.loaded = "1";
var iframe = buildPreviewIframe(card.dataset.video);
wrap.appendChild(iframe);
wrap.classList.add('wb-preview-playing');
}
function unloadPreview(card) {
var wrap = card.querySelector('.wb-thumb-wrap');
if (!wrap) return;
var iframe = wrap.querySelector('iframe');
if (iframe) iframe.remove();
wrap.dataset.loaded = "";
wrap.classList.remove('wb-preview-playing');
}
// Only run autoplaying previews for cards currently scrolled into view,
// so we don't try to autoplay every video in the row at once.
if ('IntersectionObserver' in window) {
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
if (entry.isIntersecting) {
loadPreview(entry.target);
} else {
unloadPreview(entry.target);
}
});
}, { root: document.querySelector('#wbTrack'), threshold: 0.6 });
cards.forEach(function (card) { io.observe(card); });
} else {
// Fallback: just load the first few
cards.slice(0, 4).forEach(loadPreview);
}
// Hover to pause/resume the preview (reload without autoplay vs reload with autoplay)
cards.forEach(function (card) {
var wrap = card.querySelector('.wb-thumb-wrap');
card.addEventListener('mouseenter', function () {
var iframe = wrap.querySelector('iframe');
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
}
});
card.addEventListener('mouseleave', function () {
var iframe = wrap.querySelector('iframe');
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
}
});
});
// ----- Lightbox (full popup player) -----
var lightbox = document.getElementById('wbLightbox');
var track = document.getElementById('wbTrack');
var currentIndex = 0;
var player = null;
var apiReady = false;
var pendingOpen = false;
function loadYTApi() {
if (window.YT && window.YT.Player) { apiReady = true; return; }
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
document.head.appendChild(tag);
window.onYouTubeIframeAPIReady = function () {
apiReady = true;
if (pendingOpen) { openSlide(currentIndex); pendingOpen = false; }
};
}
loadYTApi();
function setProductInfo(card) {
document.getElementById('wbProductName').textContent = card.dataset.name || '';
document.getElementById('wbPriceNew').textContent = card.dataset.price ? '₹' + card.dataset.price : '';
document.getElementById('wbPriceOld').textContent = card.dataset.oldPrice ? '₹' + card.dataset.oldPrice : '';
document.getElementById('wbProductImg').src = card.dataset.productImg || '';
document.getElementById('wbProductLink').href = card.dataset.cartUrl || '#';
var addBtn = document.getElementById('wbAddToCart');
var newCartUrl = card.dataset.cartUrl || '#';
var newProductId = card.dataset.productId || '';
// Reset state left over from a previous "Add to cart" click on this same reused button
addBtn.classList.remove('added', 'loading');
addBtn.href = newCartUrl;
addBtn.setAttribute('data-product_id', newProductId);
// Remove any "View cart" link WooCommerce injected next to the button last time
var viewCartLink = addBtn.parentNode.querySelector('a.added_to_cart');
if (viewCartLink) viewCartLink.remove();
// WooCommerce's add-to-cart.js reads product_id through jQuery's cached .data(),
// which does NOT auto-refresh just because we changed the data-* attribute above.
// Force the jQuery cache to update so the next click adds the correct product.
if (window.jQuery) {
var $btn = window.jQuery(addBtn);
$btn.data('product_id', newProductId);
$btn.removeData('added_to_cart');
}
}
function setSideCards() {
var prevCard = cards[currentIndex - 1];
var nextCard = cards[currentIndex + 1];
var prevImg = document.getElementById('wbSidePrevImg');
var nextImg = document.getElementById('wbSideNextImg');
document.getElementById('wbSidePrevCard').style.visibility = prevCard ? 'visible' : 'hidden';
document.getElementById('wbSideNextCard').style.visibility = nextCard ? 'visible' : 'hidden';
if (prevCard) prevImg.src = prevCard.querySelector('.wb-thumb').src;
if (nextCard) nextImg.src = nextCard.querySelector('.wb-thumb').src;
}
function openSlide(index) {
if (index = cards.length) return;
currentIndex = index;
var card = cards[index];
setProductInfo(card);
setSideCards();
if (!apiReady) { pendingOpen = true; lightbox.classList.add('wb-open'); document.body.style.overflow = 'hidden'; return; }
var videoId = card.dataset.video;
if (player) {
player.loadVideoById(videoId);
} else {
player = new YT.Player('wbPlayer', {
videoId: videoId,
playerVars: { autoplay: 1, controls: 1, rel: 0, modestbranding: 1, playsinline: 1 },
events: {
'onStateChange': onPlayerStateChange,
'onReady': function (e) { e.target.playVideo(); }
}
});
}
lightbox.classList.add('wb-open');
document.body.style.overflow = 'hidden';
}
function onPlayerStateChange(e) {
if (e.data === YT.PlayerState.ENDED) {
if (currentIndex < cards.length - 1) {
openSlide(currentIndex + 1);
} else {
closeLightbox();
}
}
}
function closeLightbox() {
lightbox.classList.remove('wb-open');
document.body.style.overflow = '';
if (player && player.stopVideo) { player.stopVideo(); }
}
cards.forEach(function (card, idx) {
card.addEventListener('click', function () { openSlide(idx); });
});
document.getElementById('wbClose').addEventListener('click', closeLightbox);
lightbox.addEventListener('click', function (e) { if (e.target === lightbox) closeLightbox(); });
document.getElementById('wbLbPrev').addEventListener('click', function () { openSlide(currentIndex - 1); });
document.getElementById('wbLbNext').addEventListener('click', function () { openSlide(currentIndex + 1); });
document.querySelector('.wb-arrow-prev').addEventListener('click', function () { track.scrollBy({ left: -300, behavior: 'smooth' }); });
document.querySelector('.wb-arrow-next').addEventListener('click', function () { track.scrollBy({ left: 300, behavior: 'smooth' }); });
document.getElementById('wbPlayPause').addEventListener('click', function () {
if (!player) return;
var state = player.getPlayerState();
if (state === YT.PlayerState.PLAYING) { player.pauseVideo(); }
else { player.playVideo(); }
});
document.addEventListener('keydown', function (e) {
if (!lightbox.classList.contains('wb-open')) return;
if (e.key === 'Escape') closeLightbox();
if (e.key === 'ArrowRight') openSlide(currentIndex + 1);
if (e.key === 'ArrowLeft') openSlide(currentIndex - 1);
});
})();
/* =========================================================
GLOBAL
========================================================= */
#wabWatchBuy,
#wabModalBackdrop {
box-sizing: border-box;
font-family: inherit;
}
#wabWatchBuy *,
#wabModalBackdrop * {
box-sizing: border-box;
}
/* =========================================================
MAIN SECTION
========================================================= */
#wabWatchBuy {
width: 100%;
max-width: 100%;
margin: 0 auto;
padding: 20px 40px 40px;
overflow: hidden;
}
/* =========================================================
HEADING
========================================================= */
.wab-heading {
text-align: center;
margin-bottom: 28px;
}
.wab-heading h2 {
margin: 0;
color: #333;
font-size: clamp(
32px,
4vw,
52px
);
line-height: 1.1;
font-weight: 400;
}
/* =========================================================
CAROUSEL WRAPPER
========================================================= */
.wab-carousel-wrap {
width: 100%;
display: flex;
align-items: center;
gap: 12px;
}
/* =========================================================
CAROUSEL
========================================================= */
#wabCarousel {
width: 100%;
min-width: 0;
display: flex;
gap: 24px;
overflow-x: auto;
overflow-y: hidden;
padding: 5px 4px 12px;
scroll-behavior: smooth;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
}
#wabCarousel::-webkit-scrollbar {
display: none;
}
/* =========================================================
CARD
========================================================= */
.wab-card {
position: relative;
flex: 0 0 270px;
width: 270px;
height: 480px;
overflow: hidden;
border-radius: 9px;
background: #eee;
cursor: pointer;
box-shadow:
0 3px 14px rgba(
0,
0,
0,
.15
);
transform: translateZ(0);
transition:
transform .25s ease,
box-shadow .25s ease;
}
.wab-card:hover {
transform: translateY(-5px);
box-shadow:
0 10px 28px rgba(
0,
0,
0,
.22
);
}
/* =========================================================
VIDEO CARD
========================================================= */
.wab-card-video {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #111;
}
/*
IMPORTANT:
Vertical reel ratio.
*/
.wab-card-video iframe {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 177.78%;
min-width: 56.25%;
min-height: 100%;
border: 0;
transform:
translate(
-50%,
-50%
);
pointer-events: none;
}
/* =========================================================
IMAGE FALLBACK
========================================================= */
.wab-card-image {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
/* =========================================================
CARD GRADIENT
========================================================= */
.wab-card-gradient {
position: absolute;
inset: 0;
z-index: 2;
pointer-events: none;
background:
linear-gradient(
to top,
rgba(0,0,0,.78) 0%,
rgba(0,0,0,.28) 30%,
rgba(0,0,0,0) 65%
);
}
/* =========================================================
CARD PLAY BUTTON
========================================================= */
.wab-play {
position: absolute;
top: 50%;
left: 50%;
z-index: 5;
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background:
rgba(
0,
0,
0,
.5
);
color: #fff;
font-size: 20px;
transform:
translate(
-50%,
-50%
);
}
/* =========================================================
CARD PRODUCT INFO
========================================================= */
.wab-card-info {
position: absolute;
left: 12px;
right: 12px;
bottom: 12px;
z-index: 10;
display: flex;
align-items: center;
gap: 10px;
}
/* PRODUCT IMAGE */
.wab-card-product-image {
flex: 0 0 72px;
width: 72px;
height: 80px;
object-fit: cover;
border-radius: 7px;
border: 1px solid rgba(
255,
255,
255,
.7
);
background: #fff;
box-shadow:
0 2px 8px rgba(
0,
0,
0,
.3
);
}
/* PRODUCT NAME */
.wab-card-name {
min-width: 0;
color: #fff;
font-size: 17px;
font-weight: 500;
line-height: 1.15;
text-shadow:
0 1px 4px rgba(
0,
0,
0,
.6
);
}
/* =========================================================
CAROUSEL ARROWS
========================================================= */
.wab-arrow {
flex: 0 0 auto;
width: 56px;
height: 56px;
padding: 0;
border: 1px solid #111;
border-radius: 50%;
background: #fff;
color: #111;
font-size: 23px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
z-index: 20;
transition:
background .2s ease,
color .2s ease,
transform .2s ease;
}
.wab-arrow:hover {
background: #111;
color: #fff;
transform: scale(1.05);
}
/* =========================================================
MODAL BACKDROP
========================================================= */
.wab-modal-backdrop {
position: fixed;
inset: 0;
z-index: 999999;
display: none;
align-items: center;
justify-content: center;
padding: 20px;
background:
rgba(
0,
0,
0,
.9
);
}
.wab-modal-backdrop.active {
display: flex;
}
/* =========================================================
MODAL
========================================================= */
.wab-modal {
position: relative;
width: min(
430px,
94vw
);
height: min(
850px,
94vh
);
max-height: 94vh;
display: flex;
flex-direction: column;
overflow: hidden;
border-radius: 12px;
background: #000;
box-shadow:
0 20px 70px rgba(
0,
0,
0,
.6
);
}
/* =========================================================
VIDEO AREA
========================================================= */
.wab-video-area {
position: relative;
flex: 1 1 auto;
min-height: 0;
width: 100%;
overflow: hidden;
background: #111;
}
/* =========================================================
MODAL YOUTUBE VIDEO
========================================================= */
#wabVideoContainer {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
background:
#111;
}
#wabVideoContainer iframe {
display: block;
width: 100%;
height: 100%;
border: 0;
}
/* =========================================================
CLOSE
========================================================= */
.wab-close {
position: absolute;
top: 12px;
right: 12px;
z-index: 100;
width: 40px;
height: 40px;
padding: 0;
border: 0;
border-radius: 50%;
background:
rgba(
0,
0,
0,
.45
);
color: #fff;
font-size: 30px;
line-height: 1;
cursor: pointer;
}
/* =========================================================
MUTE
========================================================= */
.wab-mute {
position: absolute;
top: 12px;
left: 12px;
z-index: 100;
width: 44px;
height: 44px;
padding: 0;
border: 0;
border-radius: 50%;
background:
rgba(
0,
0,
0,
.48
);
color: #fff;
cursor: pointer;
font-size: 19px;
}
/* =========================================================
RIGHT ACTIONS
========================================================= */
.wab-actions {
position: absolute;
right: 10px;
bottom: 105px;
z-index: 50;
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}
.wab-action {
width: 48px;
min-height: 52px;
padding: 3px 0;
border: 0;
background: transparent;
color: #fff;
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 3px;
text-shadow:
0 1px 4px #000;
}
.wab-action-icon {
font-size: 27px;
line-height: 1;
}
.wab-action-label {
font-size: 11px;
}
.wab-like-count {
font-size: 10px;
}
/* =========================================================
VIDEO NAVIGATION
========================================================= */
.wab-video-nav {
position: absolute;
top: 50%;
z-index: 50;
width: 42px;
height: 42px;
padding: 0;
border: 0;
border-radius: 50%;
background:
rgba(
255,
255,
255,
.9
);
color: #111;
font-size: 18px;
cursor: pointer;
transform:
translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.wab-video-prev {
left: 10px;
}
.wab-video-next {
right: 10px;
}
/* =========================================================
PRODUCT BAR
========================================================= */
.wab-product-bar {
position: relative;
z-index: 100;
flex: 0 0 auto;
width: 100%;
min-height: 96px;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
background: #fff;
}
/* =========================================================
PRODUCT INFORMATION
========================================================= */
.wab-product-info {
flex: 1 1 auto;
min-width: 0;
display: flex;
align-items: center;
gap: 10px;
}
/* =========================================================
PRODUCT IMAGE
========================================================= */
.wab-product-image-link {
position: relative;
flex: 0 0 70px;
width: 70px;
height: 74px;
overflow: hidden;
display: block;
border-radius: 6px;
background: #f3f3f3;
}
#wabProductImage {
width: 100%;
height: 100%;
display: block;
object-fit: cover;
}
.wab-external {
position: absolute;
top: 4px;
right: 4px;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
background:
rgba(
255,
255,
255,
.9
);
color: #111;
font-size: 13px;
}
/* =========================================================
PRODUCT DETAILS
========================================================= */
.wab-product-details {
min-width: 0;
flex: 1 1 auto;
}
.wab-product-name {
margin-bottom: 6px;
color: #222;
font-size: 14px;
font-weight: 600;
line-height: 1.2;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.wab-price-row {
display: flex;
align-items: center;
gap: 8px;
}
.wab-current-price {
color: #222;
font-size: 14px;
font-weight: 700;
}
.wab-old-price {
color: #999;
font-size: 12px;
text-decoration: line-through;
}
/* =========================================================
ADD TO CART
========================================================= */
.wab-add-cart {
flex: 0 0 auto;
min-width: 145px;
min-height: 46px;
padding: 13px 18px;
border-radius: 5px;
background: #111;
color: #fff !important;
text-decoration: none !important;
font-size: 13px;
font-weight: 600;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
white-space: nowrap;
cursor: pointer;
}
.wab-add-cart:hover {
background: #333;
color: #fff !important;
}
/* =========================================================
POWERED
========================================================= */
.wab-powered {
flex: 0 0 auto;
width: 100%;
padding: 7px;
background: #000;
color: #fff;
text-align: center;
font-size: 11px;
}
/* =========================================================
TABLET
========================================================= */
@media (max-width: 1000px) {
#wabWatchBuy {
padding-left: 25px;
padding-right: 25px;
}
.wab-card {
flex-basis: 225px;
width: 225px;
height: 400px;
}
#wabCarousel {
gap: 16px;
}
.wab-arrow {
width: 45px;
height: 45px;
}
}
/* =========================================================
MOBILE
========================================================= */
@media (max-width: 767px) {
#wabWatchBuy {
padding:
15px
8px
25px;
}
.wab-heading {
margin-bottom: 18px;
}
.wab-heading h2 {
font-size: 32px;
}
.wab-carousel-wrap {
gap: 5px;
}
#wabCarousel {
gap: 12px;
padding:
3px
2px
10px;
}
/* MOBILE CARD */
.wab-card {
flex: 0 0 155px;
width: 155px;
height: 276px;
border-radius: 8px;
}
.wab-card-info {
left: 8px;
right: 8px;
bottom: 8px;
gap: 7px;
}
.wab-card-product-image {
flex-basis: 48px;
width: 48px;
height: 55px;
border-radius: 5px;
}
.wab-card-name {
font-size: 12px;
}
.wab-arrow {
width: 34px;
height: 34px;
font-size: 15px;
}
/* =====================================================
FULLSCREEN MOBILE MODAL
================================================== */
.wab-modal-backdrop {
padding: 0;
align-items: stretch;
justify-content: stretch;
}
.wab-modal {
width: 100vw;
max-width: 100vw;
height: 100dvh;
max-height: 100dvh;
border-radius: 0;
}
.wab-video-area {
flex: 1 1 auto;
min-height: 0;
}
/* =====================================================
STICKY BOTTOM PURCHASE AREA
================================================== */
.wab-product-bar {
flex: 0 0 auto;
width: 100%;
min-height: 112px;
padding:
8px
10px;
display: flex;
flex-direction: column;
align-items: stretch;
gap: 8px;
background: #fff;
}
.wab-product-info {
width: 100%;
min-height: 53px;
}
.wab-product-image-link {
flex-basis: 52px;
width: 52px;
height: 58px;
}
.wab-product-name {
font-size: 13px;
margin-bottom: 4px;
}
.wab-current-price {
font-size: 13px;
}
.wab-old-price {
font-size: 11px;
}
/* FULL WIDTH STICKY BUTTON */
.wab-add-cart {
width: 100%;
min-width: 0;
min-height: 42px;
padding: 12px;
font-size: 13px;
}
/* =====================================================
ACTION BUTTONS
================================================== */
.wab-actions {
right: 7px;
bottom: 125px;
gap: 8px;
}
.wab-action {
width: 42px;
min-height: 45px;
}
.wab-action-icon {
font-size: 24px;
}
.wab-action-label {
font-size: 10px;
}
/* =====================================================
MOBILE VIDEO ARROWS
================================================== */
.wab-video-nav {
width: 35px;
height: 35px;
font-size: 14px;
}
.wab-video-prev {
left: 6px;
}
.wab-video-next {
right: 6px;
}
/* =====================================================
CLOSE / MUTE
================================================== */
.wab-close {
top: 9px;
right: 9px;
width: 38px;
height: 38px;
}
.wab-mute {
top: 9px;
left: 9px;
width: 40px;
height: 40px;
}
.wab-powered {
display: none;
}
}
/* =========================================================
SMALL MOBILE
========================================================= */
@media (max-width: 400px) {
.wab-card {
flex-basis: 140px;
width: 140px;
height: 249px;
}
.wab-heading h2 {
font-size: 29px;
}
.wab-product-bar {
min-height: 108px;
}
.wab-product-image-link {
flex-basis: 46px;
width: 46px;
height: 52px;
}
}
/* =========================================================
REDUCE MOTION
========================================================= */
@media (prefers-reduced-motion: reduce) {
#wabCarousel {
scroll-behavior: auto;
}
}
(function () {
"use strict";
/* =====================================================
PRODUCT DATA
EXACT DATA FROM YOUR EXISTING JS
===================================================== */
var PRODUCTS = [
{
id: 1,
name: "Under Eye-Roll On Serum",
price: "₹499",
originalPrice: "₹649",
thumbnail:
"https://cxecosmetics.com/wp-content/uploads/2026/06/eyeroll.jpg-1.jpeg",
productImage:
"https://cxecosmetics.com/wp-content/uploads/2026/06/eyeroll.jpg-1.jpeg",
youtubeId:
"b3Knb_ctHNs",
buyNowUrl:
"https://cxecosmetics.com/product/under-eye-roll-on-serum/",
likes: 5
},
{
id: 2,
name: "Bright pro face wash",
price: "₹499",
originalPrice: "₹599",
thumbnail:
"https://cxecosmetics.com/wp-content/uploads/2026/06/thumboar2.avif",
productImage:
"https://cxecosmetics.com/wp-content/uploads/2026/06/3-EDITED-scaled.png",
youtubeId:
"dvgngizNh0M",
buyNowUrl:
"https://cxecosmetics.com/?add-to-cart=1650",
likes: 8
},
{
id: 3,
name: "Moisture Vitamin C Serum (30ml)",
price: "₹549",
originalPrice: "₹699",
thumbnail:
"https://cxecosmetics.com/wp-content/uploads/2026/06/thumbnail-vit-c.png",
productImage:
"https://cxecosmetics.com/wp-content/uploads/2026/06/VITAMINE-C-GEL-FACE-WASH-1-1.png",
youtubeId:
"9Kt0_Jj__pM",
buyNowUrl:
"https://cxcosmetics.com/product/vitamin-c-face-serum/",
likes: 12
},
{
id: 4,
name: "Body Whitening Lotion (200ml)",
price: "₹599",
originalPrice: "₹649",
thumbnail:
"https://cxcosmetics.com/wp-content/uploads/2026/06/body-lotion.jpg",
productImage:
"https://cxcosmetics.com/wp-content/uploads/2026/06/body-lotion.jpg",
youtubeId:
"",
buyNowUrl:
"https://cxcosmetics.com/product/body-whitening-lotion/",
likes: 2
},
{
id: 5,
name: "Hyaluronic Acid Moisturizer (50ml)",
price: "₹449",
originalPrice: "₹599",
thumbnail:
"https://cxcosmetics.com/wp-content/uploads/2026/06/hyaluronic.jpg",
productImage:
"https://cxcosmetics.com/wp-content/uploads/2026/06/hyaluronic.jpg",
youtubeId:
"",
buyNowUrl:
"https://cxcosmetics.com/product/hyaluronic-acid-moisturizer/",
likes: 7
},
{
id: 6,
name: "SPF 50 Sunscreen (60ml)",
price: "₹399",
originalPrice: "₹499",
thumbnail:
"https://cxcosmetics.com/wp-content/uploads/2026/06/sunscreen.jpg",
productImage:
"https://cxcosmetics.com/wp-content/uploads/2026/06/sunscreen.jpg",
youtubeId:
"",
buyNowUrl:
"https://cxcosmetics.com/product/spf-50-sunscreen/",
likes: 15
},
{
id: 7,
name: "Rice Water & Niacinamide Serum (30ml)",
price: "₹499",
originalPrice: "₹649",
thumbnail:
"https://cxcosmetics.com/wp-content/uploads/2026/06/rice-water.jpg",
productImage:
"https://cxcosmetics.com/wp-content/uploads/2026/06/rice-water.jpg",
youtubeId:
"b3Knb_ctHNs",
buyNowUrl:
"https://cxcosmetics.com/product/rice-water-niacinamide-serum/",
likes: 5
}
];
/* =====================================================
VARIABLES
===================================================== */
var currentIndex = 0;
var muted = true;
var liked = {};
var player = null;
var carouselTimer = null;
var modalTimer = null;
var youtubeReady = false;
/* =====================================================
ELEMENTS
===================================================== */
var carousel =
document.getElementById(
"wabCarousel"
);
var backdrop =
document.getElementById(
"wabModalBackdrop"
);
var videoContainer =
document.getElementById(
"wabVideoContainer"
);
/* =====================================================
BUILD CARDS
===================================================== */
function buildCards() {
if (!carousel) {
return;
}
carousel.innerHTML = "";
PRODUCTS.forEach(
function (product, index) {
var card =
document.createElement(
"div"
);
card.className =
"wab-card";
/* ================================
VIDEO
================================= */
var media;
if (product.youtubeId) {
media =
'
' +
'' +
'' +
'
';
} else {
media =
'
';
}
/* ================================
PLAY ICON
================================= */
var playIcon =
product.youtubeId
?
'
►
'
:
'';
/* ================================
HTML
================================= */
card.innerHTML =
media +
'
' +
playIcon +
'
' +
'
' +
'
' +
escapeHTML(
product.name
) +
'
' +
'
';
/* ================================
CLICK
================================= */
card.addEventListener(
"click",
function () {
openModal(index);
}
);
carousel.appendChild(card);
}
);
}
/* =====================================================
ESCAPE HTML
===================================================== */
function escapeHTML(text) {
return String(text)
.replace(
/&/g,
"&"
)
.replace(
//g,
">"
)
.replace(
/"/g,
"""
)
.replace(
/'/g,
"'"
);
}
/* =====================================================
LOAD YOUTUBE API
===================================================== */
function loadYouTubeAPI() {
if (
window.YT &&
window.YT.Player
) {
youtubeReady = true;
return;
}
var existing =
document.querySelector(
'script[src="https://www.youtube.com/iframe_api"]'
);
if (existing) {
return;
}
var script =
document.createElement(
"script"
);
script.src =
"https://www.youtube.com/iframe_api";
document.head.appendChild(
script
);
window.onYouTubeIframeAPIReady =
function () {
youtubeReady = true;
};
}
loadYouTubeAPI();
/* =====================================================
OPEN MODAL
===================================================== */
function openModal(index) {
if (
index = PRODUCTS.length
) {
return;
}
currentIndex = index;
renderModal();
backdrop.classList.add(
"active"
);
backdrop.setAttribute(
"aria-hidden",
"false"
);
document.body.style.overflow =
"hidden";
startModalAutoPlay();
}
/* =====================================================
CLOSE MODAL
===================================================== */
function closeModal() {
clearInterval(
modalTimer
);
backdrop.classList.remove(
"active"
);
backdrop.setAttribute(
"aria-hidden",
"true"
);
document.body.style.overflow =
"";
if (player) {
try {
player.stopVideo();
} catch (error) {}
}
player = null;
videoContainer.innerHTML =
"";
}
/* =====================================================
RENDER MODAL
===================================================== */
function renderModal() {
var product =
PRODUCTS[currentIndex];
/* PRODUCT */
document.getElementById(
"wabProductImage"
).src =
product.productImage;
document.getElementById(
"wabProductImage"
).alt =
product.name;
document.getElementById(
"wabProductName"
).textContent =
product.name;
document.getElementById(
"wabCurrentPrice"
).textContent =
product.price;
document.getElementById(
"wabOldPrice"
).textContent =
product.originalPrice;
document.getElementById(
"wabProductLink"
).href =
product.buyNowUrl;
document.getElementById(
"wabAddToCart"
).href =
product.buyNowUrl;
/* LIKE */
var isLiked =
liked[product.id] === true;
document.getElementById(
"wabLikeCount"
).textContent =
isLiked
?
product.likes + 1
:
product.likes;
var likeButton =
document.getElementById(
"wabLike"
);
likeButton
.querySelector(
".wab-action-icon"
)
.textContent =
isLiked
?
"♥"
:
"♡";
/* VIDEO */
loadVideo(
product.youtubeId,
product.thumbnail
);
}
/* =====================================================
LOAD VIDEO
===================================================== */
function loadVideo(
videoId,
fallbackImage
) {
videoContainer.innerHTML =
"";
/* ================================
NO VIDEO
================================= */
if (!videoId) {
videoContainer.style
.backgroundImage =
'url("' +
fallbackImage +
'")';
videoContainer.style
.backgroundSize =
"cover";
videoContainer.style
.backgroundPosition =
"center";
return;
}
videoContainer.style
.backgroundImage =
"none";
/* ================================
YOUTUBE IFRAME
================================= */
var iframe =
document.createElement(
"iframe"
);
iframe.src =
"https://www.youtube.com/embed/" +
encodeURIComponent(
videoId
) +
"?autoplay=1" +
"&mute=" +
(
muted
?
"1"
:
"0"
) +
"&loop=1" +
"&playlist=" +
encodeURIComponent(
videoId
) +
"&controls=1" +
"&rel=0" +
"&modestbranding=1" +
"&playsinline=1" +
"&enablejsapi=1";
iframe.allow =
"autoplay; encrypted-media; picture-in-picture";
iframe.setAttribute(
"allowfullscreen",
""
);
videoContainer.appendChild(
iframe
);
/* =================================================
CREATE YOUTUBE PLAYER
================================================= */
if (
window.YT &&
window.YT.Player
) {
createPlayer();
} else {
setTimeout(
function () {
if (
window.YT &&
window.YT.Player
) {
createPlayer();
}
},
1000
);
}
}
/* =====================================================
CREATE YOUTUBE PLAYER
===================================================== */
function createPlayer() {
var iframe =
videoContainer.querySelector(
"iframe"
);
if (!iframe) {
return;
}
try {
player =
new YT.Player(
iframe,
{
events: {
onReady:
function (event) {
if (muted) {
event.target
.mute();
} else {
event.target
.unMute();
}
event.target
.playVideo();
}
}
}
);
} catch (error) {
console.log(
"YouTube player error:",
error
);
}
}
/* =====================================================
MUTE
===================================================== */
document
.getElementById(
"wabMute"
)
.addEventListener(
"click",
function () {
muted =
!muted;
if (player) {
try {
if (muted) {
player.mute();
} else {
player.unMute();
}
} catch (error) {}
}
document.getElementById(
"wabMuteIcon"
).textContent =
muted
?
"🔇"
:
"🔊";
}
);
/* =====================================================
LIKE
===================================================== */
document
.getElementById(
"wabLike"
)
.addEventListener(
"click",
function () {
var product =
PRODUCTS[currentIndex];
liked[product.id] =
!liked[product.id];
var active =
liked[product.id];
document.getElementById(
"wabLikeCount"
).textContent =
active
?
product.likes + 1
:
product.likes;
document
.querySelector(
"#wabLike .wab-action-icon"
)
.textContent =
active
?
"♥"
:
"♡";
}
);
/* =====================================================
SHARE
===================================================== */
document
.getElementById(
"wabShare"
)
.addEventListener(
"click",
function () {
var product =
PRODUCTS[currentIndex];
if (
navigator.share
) {
navigator.share({
title:
product.name,
url:
product.buyNowUrl
}).catch(
function () {}
);
} else if (
navigator.clipboard
) {
navigator.clipboard
.writeText(
product.buyNowUrl
)
.then(
function () {
alert(
"Product link copied!"
);
}
);
}
}
);
/* =====================================================
PREVIOUS VIDEO
===================================================== */
document
.getElementById(
"wabVideoPrev"
)
.addEventListener(
"click",
function () {
currentIndex =
(
currentIndex -
1 +
PRODUCTS.length
) %
PRODUCTS.length;
renderModal();
startModalAutoPlay();
}
);
/* =====================================================
NEXT VIDEO
===================================================== */
document
.getElementById(
"wabVideoNext"
)
.addEventListener(
"click",
function () {
currentIndex =
(
currentIndex +
1
) %
PRODUCTS.length;
renderModal();
startModalAutoPlay();
}
);
/* =====================================================
MODAL AUTO ADVANCE
===================================================== */
function startModalAutoPlay() {
clearInterval(
modalTimer
);
modalTimer =
setInterval(
function () {
currentIndex =
(
currentIndex +
1
) %
PRODUCTS.length;
renderModal();
},
10000
);
}
/* =====================================================
CAROUSEL AUTO SCROLL
===================================================== */
function startCarouselAuto() {
clearInterval(
carouselTimer
);
carouselTimer =
setInterval(
function () {
if (!carousel) {
return;
}
var maxScroll =
carousel.scrollWidth -
carousel.clientWidth;
if (
carousel.scrollLeft >=
maxScroll - 5
) {
carousel.scrollTo({
left: 0,
behavior: "smooth"
});
} else {
carousel.scrollBy({
left: 290,
behavior: "smooth"
});
}
},
8000
);
}
/* =====================================================
CAROUSEL ARROWS
===================================================== */
document
.querySelector(
".wab-arrow-prev"
)
.addEventListener(
"click",
function () {
clearInterval(
carouselTimer
);
carousel.scrollBy({
left: -300,
behavior: "smooth"
});
startCarouselAuto();
}
);
document
.querySelector(
".wab-arrow-next"
)
.addEventListener(
"click",
function () {
clearInterval(
carouselTimer
);
carousel.scrollBy({
left: 300,
behavior: "smooth"
});
startCarouselAuto();
}
);
/* =====================================================
CLOSE BUTTON
===================================================== */
document
.getElementById(
"wabClose"
)
.addEventListener(
"click",
closeModal
);
/* =====================================================
BACKDROP CLICK
===================================================== */
backdrop.addEventListener(
"click",
function (event) {
if (
event.target ===
backdrop
) {
closeModal();
}
}
);
/* =====================================================
KEYBOARD
===================================================== */
document.addEventListener(
"keydown",
function (event) {
if (
!backdrop.classList
.contains(
"active"
)
) {
return;
}
if (
event.key ===
"Escape"
) {
closeModal();
}
if (
event.key ===
"ArrowRight"
) {
document
.getElementById(
"wabVideoNext"
)
.click();
}
if (
event.key ===
"ArrowLeft"
) {
document
.getElementById(
"wabVideoPrev"
)
.click();
}
}
);
/* =====================================================
PAUSE CAROUSEL ON HOVER
===================================================== */
carousel.addEventListener(
"mouseenter",
function () {
clearInterval(
carouselTimer
);
}
);
carousel.addEventListener(
"mouseleave",
function () {
startCarouselAuto();
}
);
/* =====================================================
TOUCH
===================================================== */
carousel.addEventListener(
"touchstart",
function () {
clearInterval(
carouselTimer
);
},
{
passive: true
}
);
carousel.addEventListener(
"touchend",
function () {
startCarouselAuto();
},
{
passive: true
}
);
/* =====================================================
INITIALIZE
===================================================== */
buildCards();
startCarouselAuto();
})();