/* VAST Preroll — оверлей рекламы поверх заглушки плеера.
   Заглушка шаблона (.click-for-video) уже position:relative с aspect-ratio 16/9,
   поэтому оверлею достаточно растянуться по ней. Для шаблонов без своей заглушки
   модуль создаёт .vastad-stub — ей пропорции задаём сами. */

.vastad-overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 20;
	background: #000;
	overflow: hidden;
	border-radius: inherit;
}

.vastad-overlay .vastad-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
}

/* Спиннер на время запроса VAST и буферизации ролика */
.vastad-overlay .vastad-loader {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	pointer-events: none;
}

.vastad-overlay .vastad-loader span {
	display: block;
	width: 100%;
	height: 100%;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vastad-spin .8s linear infinite;
}

@keyframes vastad-spin {
	to { transform: rotate(360deg); }
}

/* Полоса прогресса ролика */
.vastad-overlay .vastad-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(255, 255, 255, .18);
}

.vastad-overlay .vastad-progress i {
	display: block;
	width: 0;
	height: 100%;
	background: #ffb300;
	transition: width .2s linear;
}

/* Нижняя панель: метка «Реклама» и кнопка пропуска */
.vastad-overlay .vastad-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 3px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	background: linear-gradient(to top, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0));
	pointer-events: none;
}

.vastad-overlay .vastad-label {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	background: rgba(0, 0, 0, .6);
	color: #ffd54f;
	font: 600 12px/1.2 Arial, Helvetica, sans-serif;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.vastad-overlay .vastad-skip {
	pointer-events: auto;
	margin: 0;
	padding: 8px 14px;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 3px;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font: 600 13px/1.2 Arial, Helvetica, sans-serif;
	cursor: default;
	opacity: .75;
	transition: background-color .15s ease, opacity .15s ease;
}

.vastad-overlay .vastad-skip.can-skip {
	cursor: pointer;
	opacity: 1;
	border-color: #fff;
}

.vastad-overlay .vastad-skip.can-skip:hover {
	background: rgba(255, 255, 255, .18);
}

/* Пока идёт реклама, кнопка play самой заглушки не должна просвечивать */
.vastad-active::before,
.vastad-active::after {
	display: none !important;
}

/* Заглушка, которую модуль создаёт сам, если в шаблоне её нет */
.vastad-stub {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 220px;
	cursor: pointer;
	background: #101010 radial-gradient(60% 60% at 50% 50%, rgba(255, 47, 82, .16), transparent 70%);
	border-radius: 6px;
	overflow: hidden;
}

.vastad-stub::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 78px;
	height: 78px;
	margin: -39px 0 0 -39px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .25) inset;
	transition: transform .2s ease;
}

.vastad-stub::before {
	content: '';
	position: absolute;
	z-index: 2;
	top: 50%;
	left: 50%;
	width: 26px;
	height: 26px;
	margin: -13px 0 0 -9px;
	background: #fff;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 4.5v15l14-7.5z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 4.5v15l14-7.5z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform .2s ease;
}

.vastad-stub:hover::after,
.vastad-stub:hover::before {
	transform: scale(1.08);
}

@media (max-width: 640px) {
	.vastad-overlay .vastad-bar { padding: 8px; }
	.vastad-overlay .vastad-skip { padding: 7px 10px; font-size: 12px; }
	.vastad-overlay .vastad-label { font-size: 11px; }
}
