/* ==========================================================================
   Video Reels Shopping — Frontend
   ========================================================================== */

.vrs-carousel-wrap {
	--vrs-accent: #8B5CF6;
	--vrs-radius: 18px;
	--vrs-gap: 14px;
	--vrs-card-w: 200px;
	box-sizing: border-box;
	max-width: 100%;
	margin: 8px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.vrs-carousel-wrap *,
.vrs-carousel-wrap *::before,
.vrs-carousel-wrap *::after {
	box-sizing: border-box;
}

.vrs-heading {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 16px;
	color: #1b1523;
}

.vrs-carousel-shell {
	position: relative;
	padding: 0px 3px 0px !important;
}

/* ---------------- Track ---------------- */
.vrs-track {
	display: flex;
	align-items: flex-start;
	gap: var(--vrs-gap);
	overflow-x: auto;
	overflow-y: visible;
	scroll-snap-type: x proximity;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding: 6px 4px 6px;
	outline: none;
}
.vrs-track::-webkit-scrollbar {
	display: none;
}
.vrs-track {
	scrollbar-width: none;
}

.vrs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 var(--vrs-card-w);
	width: var(--vrs-card-w);
	scroll-snap-align: start;
	cursor: pointer;
}
.vrs-card:hover {
	transform: translateY(-4px);
}
.vrs-card:hover .vrs-card-media {
	box-shadow: 0 16px 32px rgba(80, 40, 130, 0.22);
}
.vrs-card {
	transition: transform .25s ease;
}
.vrs-card:focus-visible {
	outline: 3px solid var(--vrs-accent);
	outline-offset: 3px;
	border-radius: var(--vrs-radius);
}

.vrs-card-media {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 15;
	border-radius: var(--vrs-radius);
	overflow: hidden;
	background: #111;
	box-shadow: 0 10px 24px rgba(80, 40, 130, 0.14);
	transition: box-shadow .25s ease;
}

.vrs-card-thumb,
.vrs-card-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.vrs-card-video {
	opacity: 0;
	transition: opacity .25s ease;
}
.vrs-card.is-playing .vrs-card-video {
	opacity: 1;
}
.vrs-card.is-playing .vrs-card-thumb {
	opacity: 0;
}

.vrs-card-yt {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
}
.vrs-card-yt iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	min-width: 220%;
	min-height: 220%;
	transform: translate(-50%, -50%);
	border: 0;
}
.vrs-card.is-playing .vrs-card-yt {
	opacity: 1;
}
.vrs-card.is-playing .vrs-card-thumb {
	opacity: 0;
}

.vrs-card-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
	pointer-events: none;
}

.vrs-badge-views {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(20, 12, 28, 0.55);
	backdrop-filter: blur(4px);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 5px 9px;
	border-radius: 999px;
}

.vrs-play-btn {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(1);
	z-index: 3;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #1b1523;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0,0,0,.25);
	transition: opacity .2s ease, transform .2s ease;
}
.vrs-play-btn svg {
	margin-left: 2px;
}
.vrs-card:hover .vrs-play-btn {
	transform: translate(-50%, -50%) scale(1.08);
}
.vrs-card.is-playing .vrs-play-btn {
	opacity: 0;
}

.vrs-card-product-chip {
	position: relative;
	z-index: 3;
	margin-top: -40px;
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border-radius: 999px;
	padding: 4px 12px 4px 4px;
	box-shadow: 0 6px 16px rgba(60, 20, 90, .25);
	max-width: 92%;
	white-space: nowrap;
}
.vrs-card-product-chip img {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
}
.vrs-card-product-chip span {
	font-size: 11px;
	font-weight: 600;
	color: #1b1523;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------------- Nav arrows ---------------- */
.vrs-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	color: #1b1523;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(60, 20, 90, .2);
	transition: background .15s ease, transform .15s ease;
}
.vrs-nav:hover {
	background: #fff;
	transform: translateY(-50%) scale(1.06);
}
.vrs-nav-prev { left: -2px; }
.vrs-nav-next { right: -2px; }
.vrs-nav[disabled] {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 640px) {
	.vrs-nav { display: none; }
	.vrs-carousel-shell { padding: 4px 14px 6px; }
}

.vrs-empty-notice {
	background: #fff8e5;
	border: 1px solid #f0d98c;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
}

/* ==========================================================================
   Popup player (click-to-watch, sound on)
   ========================================================================== */

.vrs-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.vrs-modal.is-open {
	display: flex;
}
.vrs-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 6, 14, 0.85);
	backdrop-filter: blur(6px);
}

.vrs-modal-inner {
	position: relative;
	z-index: 2;
	width: min(420px, 92vw);
	height: min(90vh, 860px);
	border-radius: 20px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 30px 80px rgba(0,0,0,.5);
}

.vrs-modal-progress {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	z-index: 6;
	display: flex;
	gap: 4px;
}
.vrs-modal-progress span {
	flex: 1;
	height: 3px;
	border-radius: 999px;
	background: rgba(255,255,255,0.3);
	overflow: hidden;
}
.vrs-modal-progress span i {
	display: block;
	height: 100%;
	width: 0%;
	background: #fff;
	border-radius: inherit;
}
.vrs-modal-progress span.is-complete i {
	width: 100% !important;
}

.vrs-modal-topbar {
	position: absolute;
	top: 22px;
	left: 12px;
	right: 12px;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: #fff;
}
.vrs-modal-brand {
	font-size: 13px;
	font-weight: 600;
	text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.vrs-modal-controls {
	display: flex;
	gap: 8px;
}
.vrs-modal-icon-btn {
	width: 32px;
	height: 32px;
	border-radius: 10% !important;
	border: none;
	background: rgba(255,255,255,0.16) !important;
	color: #fff;
	display: flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	backdrop-filter: blur(3px);
	transition: background .15s ease !important;
}
.vrs-modal-icon-btn:hover {
	background: rgba(255,255,255,0.3);
}

/* Defensive overrides: some themes/page builders ship a global
   `svg { display:none }` (or a desktop-only media query) meant for their
   own icon system, which can accidentally swallow our popup icons on
   desktop while leaving them fine on mobile. Force them visible here. */
.vrs-modal svg {
	display: inline-block !important;
	visibility: visible !important;
	opacity: 1 !important;
	pointer-events: none;
	flex-shrink: 0;
}
.vrs-modal-icon-btn svg,
.vrs-modal-step svg,
.vrs-modal-cta svg {
	width: 18px !important;
	height: 18px !important;
	color: currentColor;
}
.vrs-nav svg,
.vrs-play-btn svg {
	display: inline-block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.vrs-modal-stage {
	position: absolute;
	inset: 0;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}
.vrs-modal-stage video,
.vrs-modal-stage iframe {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

.vrs-modal-step {
	position: absolute;
	right: 12px;
	z-index: 6;
	width: 34px;
	height: 34px;
	border-radius: 50% !important;
	border: none;
	background: rgba(255,255,255,0.16) !important;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	backdrop-filter: blur(3px);
}
.vrs-modal-step:hover {
	background: rgba(255,255,255,0.3);
}
.vrs-modal-step-up { top: 44%; transform: translateY(-46px); }
.vrs-modal-step-down { top: 44%; transform: translateY(10px); }
.vrs-modal-step[disabled] {
	opacity: 0.3;
	pointer-events: none;
}

.vrs-modal-product {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 14px;
	z-index: 6;
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(255,255,255,0.97);
	border-radius: 16px;
	padding: 10px;
	box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.vrs-modal-product-img {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	object-fit: cover;
	flex: none;
	background: #eee;
}
.vrs-modal-product-info {
	flex: 1;
	min-width: 0;
}
.vrs-modal-product-title {
	font-size: 12.5px;
	font-weight: 700;
	color: #1b1523;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.vrs-modal-product-price {
	font-size: 12px;
	color: #6d28d9;
	font-weight: 600;
	margin-top: 1px;
}
.vrs-modal-cta {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: linear-gradient(135deg, #2563EB, #1D4ED8) !important;
	color: #fff;
	border: none;
	padding: 10px 14px;
	border-radius: 999px !important;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: transform .15s ease, opacity .15s ease;
}
.vrs-modal-cta:hover {
	transform: translateY(-1px);
}
.vrs-modal-cta[disabled] {
	opacity: 0.7;
	cursor: default;
}
.vrs-modal-cta.is-added {
	background: #16a34a;
}

@media (max-width: 480px) {
	.vrs-modal-inner {
		width: calc(100vw - 16px);
		width: calc(100dvw - 16px);
		height: calc(100vh - 32px);
		height: calc(100dvh - 32px);
		max-height: 760px;
		border-radius: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vrs-card,
	.vrs-nav,
	.vrs-play-btn,
	.vrs-modal-cta {
		transition: none !important;
	}
}
