.cgb-vp-block {
	position: relative;
}

.cgb-vp-visual {
	position: relative;
	overflow: hidden;
	background: #111;
	border-radius: var(--cgb-vp-radius, 4px);
}

.cgb-vp-block.ratio-16-9 .cgb-vp-visual {
	aspect-ratio: 16 / 9;
}
.cgb-vp-block.ratio-4-3 .cgb-vp-visual {
	aspect-ratio: 4 / 3;
}
.cgb-vp-block.ratio-1-1 .cgb-vp-visual {
	aspect-ratio: 1 / 1;
}
.cgb-vp-block.ratio-21-9 .cgb-vp-visual {
	aspect-ratio: 21 / 9;
}
.cgb-vp-block.ratio-9-16 .cgb-vp-visual {
	aspect-ratio: 9 / 16;
}
.cgb-vp-block.ratio-original .cgb-vp-visual {
	aspect-ratio: var(--cgb-vp-media-ratio, 16 / 9);
}

.cgb-vp-thumbnail {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	z-index: 1;
}

.cgb-vp-embed-wrap {
	position: relative;
	width: 100%;
	height: 100%;
}
.cgb-vp-embed-wrap iframe,
.cgb-vp-embed-wrap video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.cgb-vp-visual .cgb-vp-embed-wrap {
	position: absolute;
	inset: 0;
	z-index: 3;
}

/* ---------------- Muted looping preview ---------------- */
.cgb-vp-loop-layer {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	overflow: hidden;
}
.cgb-vp-loop-layer .cgb-vp-embed-wrap {
	position: absolute;
	inset: 0;
}

/* ---------------- Play button ---------------- */
.cgb-vp-play-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 4;
	width: var(--cgb-vp-btn-size, 72px);
	height: var(--cgb-vp-btn-size, 72px);
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--cgb-vp-btn-color, #fff);
	background: transparent;
	color: var(--cgb-vp-btn-icon-color, #111);
	cursor: pointer;
	padding: 0;
	opacity: var(--cgb-vp-btn-opacity, 1);
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.cgb-vp-play-button:hover {
	transform: translate(-50%, -50%) scale(1.08);
}

.cgb-vp-play-button.shape-circle {
	border-radius: 50%;
}
.cgb-vp-play-button.shape-rounded {
	border-radius: 12px;
}
.cgb-vp-play-button.shape-square {
	border-radius: 0;
}

.cgb-vp-play-button.variant-filled {
	background: var(--cgb-vp-btn-color, #fff);
	color: var(--cgb-vp-btn-icon-color, #111);
}
.cgb-vp-play-button.variant-outline {
	background: rgba(0, 0, 0, 0.15);
	color: var(--cgb-vp-btn-color, #fff);
	border-color: var(--cgb-vp-btn-color, #fff);
}
.cgb-vp-play-button.variant-outline svg path {
	fill: var(--cgb-vp-btn-color, #fff);
}
.cgb-vp-play-button.variant-filled svg path {
	fill: var(--cgb-vp-btn-icon-color, #111);
}

.cgb-vp-play-button.variant-none {
	background: transparent;
	border: none;
}
.cgb-vp-play-button.variant-none svg path {
	fill: var(--cgb-vp-btn-icon-color, #fff);
}

.cgb-vp-play-button svg {
	display: block;
}

/* ---------------- Lightbox ---------------- */
.cgb-vp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.85);
	padding: 24px;
	box-sizing: border-box;
}
.cgb-vp-lightbox.is-open {
	display: flex;
}
.cgb-vp-lightbox-inner {
	position: relative;
	width: 100%;
	max-width: 960px;
}
.cgb-vp-lightbox-content {
	position: relative;
	width: 100%;
}
.cgb-vp-lightbox-content .cgb-vp-embed-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: var(--cgb-vp-embed-ratio, 16 / 9);
	height: auto;
}
.cgb-vp-lightbox-content .cgb-vp-embed-wrap iframe,
.cgb-vp-lightbox-content .cgb-vp-embed-wrap video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}
.cgb-vp-lightbox-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

/* ================= Custom player skin ================= */
.cgb-vp-custom-player {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000;
}
.cgb-vp-c-stage {
	position: absolute;
	inset: 0;
}

.cgb-vp-c-controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: var(--cgb-vp-skin-bg, rgba(0, 0, 0, 0.6));
	color: var(--cgb-vp-skin-icon, #fff);
	box-sizing: border-box;
	opacity: 1;
	transition: opacity 0.25s ease;
}
.cgb-vp-custom-player.auto-hide .cgb-vp-c-controls.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.cgb-vp-c-btn {
	background: transparent;
	border: none;
	color: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	flex: 0 0 auto;
}
.cgb-vp-c-btn svg {
	display: block;
	fill: currentColor;
}

.cgb-vp-c-time {
	font-size: 12px;
	min-width: 38px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	flex: 0 0 auto;
	color: inherit;
}

.cgb-vp-c-progress {
	position: relative;
	flex: 1 1 auto;
	height: 16px;
	display: flex;
	align-items: center;
	cursor: pointer;
}
.cgb-vp-c-progress-track {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	height: 4px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	pointer-events: none;
}
.cgb-vp-c-progress-fill {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 0%;
	background: var(--cgb-vp-skin-accent, #ff4d4d);
	border-radius: 2px;
	pointer-events: none;
}
.cgb-vp-c-scrubber {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.cgb-vp-c-volume {
	width: 70px;
	flex: 0 0 auto;
	accent-color: var(--cgb-vp-skin-accent, #ff4d4d);
}

@media (max-width: 480px) {
	.cgb-vp-c-volume {
		display: none; /* keep the bar usable on narrow screens */
	}
}
