/* WooCommerce Video Stories Commerce — Frontend Styles */

.wcvs-stories-row, .wcvs-grid, .wcvs-carousel, .wcvs-reels, .wcvs-story-viewer {
	--wcvs-primary: #7c3aed;
	--wcvs-primary-dark: #5b21b6;
	--wcvs-bg: #0b0b0f;
	--wcvs-radius: 16px;
	box-sizing: border-box;
}
.wcvs-stories-row *, .wcvs-grid *, .wcvs-carousel *, .wcvs-reels *, .wcvs-story-viewer * { box-sizing: border-box; }

/* ---------- Stories Row ---------- */
.wcvs-stories-row {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	padding: 12px 4px;
	scrollbar-width: thin;
}
.wcvs-story-bubble {
	background: none;
	border: none;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	width: 76px;
}
.wcvs-story-ring {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	padding: 3px;
	background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);
	display: flex;
}
.wcvs-story-ring img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
}
.wcvs-story-bubble.wcvs-seen .wcvs-story-ring { background: #d4d4d8; }
.wcvs-story-label {
	font-size: 12px;
	color: #1d2327;
	max-width: 76px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- Full screen viewer ---------- */
.wcvs-story-viewer {
	position: fixed;
	inset: 0;
	background: var(--wcvs-bg);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wcvs-story-viewer[hidden] { display: none; }

.wcvs-viewer-stage {
	position: relative;
	width: 100%;
	max-width: 420px;
	height: 100%;
	max-height: 100vh;
	background: #000;
	overflow: hidden;
}
@media (min-width: 600px) {
	.wcvs-viewer-stage { max-height: 90vh; border-radius: var(--wcvs-radius); }
}

.wcvs-viewer-progress {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	gap: 4px;
	z-index: 5;
}
.wcvs-progress-bar { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 4px; overflow: hidden; }
.wcvs-progress-fill { height: 100%; width: 0%; background: #fff; }

.wcvs-viewer-header {
	position: absolute;
	top: 22px;
	left: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	z-index: 5;
	color: #fff;
}
.wcvs-viewer-header-title { font-size: 13px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.wcvs-viewer-controls { display: flex; gap: 10px; }
.wcvs-icon-btn {
	background: rgba(0,0,0,.35);
	border: none;
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
}

.wcvs-viewer-media { width: 100%; height: 100%; object-fit: contain; background: #000; }
.wcvs-viewer-tap-zone { position: absolute; top: 0; bottom: 0; width: 35%; z-index: 4; }
.wcvs-viewer-tap-zone.left { left: 0; }
.wcvs-viewer-tap-zone.right { right: 0; }

/* ---------- Product overlay (glassmorphism) ---------- */
.wcvs-overlay {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 16px;
	z-index: 6;
	background: rgba(255, 255, 255, 0.14);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 18px;
	padding: 12px;
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.wcvs-overlay-top { display: flex; gap: 10px; align-items: center; }
.wcvs-overlay-top img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #fff; }
.wcvs-overlay-info { flex: 1; min-width: 0; }
.wcvs-overlay-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcvs-overlay-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 2px; flex-wrap: wrap; }
.wcvs-price { font-weight: 700; }
.wcvs-price del { opacity: .6; font-weight: 400; margin-right: 4px; }
.wcvs-discount-badge { background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.wcvs-rating { color: #facc15; font-size: 12px; }
.wcvs-stock { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.2); }
.wcvs-stock.out { background: #ef4444; }

.wcvs-overlay-actions { display: flex; gap: 8px; }
.wcvs-btn {
	flex: 1;
	border: none;
	border-radius: 12px;
	padding: 11px 10px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: transform .1s ease, opacity .15s ease;
}
.wcvs-btn:active { transform: scale(.97); }
.wcvs-btn-primary { background: var(--wcvs-primary); color: #fff; }
.wcvs-btn-secondary { background: rgba(255,255,255,.92); color: #18181b; }
.wcvs-btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; }
.wcvs-btn[disabled] { opacity: .5; cursor: not-allowed; }

.wcvs-toast {
	position: absolute;
	top: 70px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0,0,0,.85);
	color: #fff;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 13px;
	z-index: 10;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}
.wcvs-toast.show { opacity: 1; }

/* ---------- Recommendations panel ---------- */
.wcvs-reco-panel {
	position: absolute;
	inset: 0;
	background: rgba(10,10,14,.92);
	z-index: 7;
	display: flex;
	flex-direction: column;
	padding: 20px 16px;
	color: #fff;
	overflow-y: auto;
}
.wcvs-reco-panel h3 { margin: 0 0 12px; font-size: 16px; }
.wcvs-reco-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wcvs-reco-card { background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px; }
.wcvs-reco-card img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; }
.wcvs-reco-card-name { font-size: 12px; margin: 6px 0 2px; }
.wcvs-reco-card-price { font-size: 12px; font-weight: 700; color: #facc15; }
.wcvs-reco-close { align-self: flex-end; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

/* ---------- Grid (Pinterest/Reels-style) ---------- */
.wcvs-grid {
	display: grid;
	grid-template-columns: repeat(var(--wcvs-grid-cols, 3), 1fr);
	gap: 10px;
}
.wcvs-grid-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 9/16; cursor: pointer; background: #111; }
.wcvs-grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wcvs-grid-overlay {
	position: absolute; inset: 0;
	background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,.65));
	display: flex; align-items: flex-end; justify-content: space-between;
	padding: 8px;
	color: #fff;
}
.wcvs-grid-play { font-size: 12px; }
.wcvs-grid-price { font-size: 11px; font-weight: 700; }

/* ---------- Carousel ---------- */
.wcvs-carousel { overflow: hidden; padding: 8px 0; }
.wcvs-carousel-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	cursor: grab;
	scrollbar-width: thin;
}
.wcvs-carousel-track:active { cursor: grabbing; }
.wcvs-carousel-item {
	flex: 0 0 160px;
	scroll-snap-align: start;
	border-radius: 12px;
	overflow: hidden;
	position: relative;
	background: #111;
	aspect-ratio: 9/16;
	cursor: pointer;
}
.wcvs-carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.wcvs-carousel-title {
	position: absolute; left: 0; right: 0; bottom: 0;
	background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
	color: #fff; font-size: 12px; padding: 8px;
}

/* ---------- Reels (TikTok-style vertical feed) ---------- */
.wcvs-reels {
	height: 100vh;
	max-height: 90vh;
	overflow-y: auto;
	scroll-snap-type: y mandatory;
	border-radius: var(--wcvs-radius);
	background: #000;
}
.wcvs-reel-slide {
	position: relative;
	height: 100%;
	scroll-snap-align: start;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wcvs-reel-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.wcvs-reel-actions {
	position: absolute;
	right: 12px;
	bottom: 140px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	z-index: 5;
}
.wcvs-reel-action {
	background: rgba(0,0,0,.4);
	border: none;
	color: #fff;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 16px;
	cursor: pointer;
}
.wcvs-reel-product.glass {
	position: absolute;
	left: 12px;
	right: 64px;
	bottom: 20px;
	background: rgba(255,255,255,0.14);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border: 1px solid rgba(255,255,255,.25);
	border-radius: 16px;
	padding: 10px;
	color: #fff;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.wcvs-reel-product img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.wcvs-reel-product-info { flex: 1; min-width: 90px; }
.wcvs-reel-product-name { font-size: 13px; font-weight: 600; }
.wcvs-reel-product-price { font-size: 12px; }
.wcvs-reel-product-actions { display: flex; gap: 6px; width: 100%; }
.wcvs-reel-product-actions .wcvs-btn { padding: 8px; font-size: 12px; }

.wcvs-empty { color: #6b7280; font-size: 13px; }

@media (max-width: 480px) {
	.wcvs-carousel-item { flex-basis: 130px; }
}
