:root {
	--scale-factor: 1;
}

.video-wrapper {
	transition: all 0.3s;
	padding: 8px;
	margin: 0 2px;
	border-radius: 22px;
	background: #00000000;
	max-height: 466px;
	max-width: 252px !important;
}

.overlay .reel-title {
	font-weight: 600;
	font-size: 16px;
	line-height: 1;
	letter-spacing: -0.04em;
}

.overlay .reel-views {
	font-weight: 400;
	font-size: 16px;
	line-height: 120%;
	letter-spacing: -0.04em;
}

.reel-logo {
	position: absolute;
	top: 16px;
	left: 16px;
}

#video-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.8);
	z-index: 1000;
	justify-content: center;
	align-items: center;
	grid-template-columns: repeat(3, 1fr);
}
#video-overlay.opened {
	overflow: hidden;
	display: grid;
}
#video-container {
	position: relative;
	/*width: 33%;*/
	max-height: 95vh;
	max-width: 56.25vh;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;

	/* height: auto; */
	aspect-ratio: 9 / 16;
	border-radius: 12px;
	justify-self: center;
}
#overlay-video {
	position: absolute;
	inset: 0;
	height: 100%;
	width: 100%;
	object-fit: cover;
	background: #000;
	border-radius: 12px;
}

.reel-ui {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.reel-top {
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.reel-progress {
	height: 6px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 3px;
	overflow: hidden;
	cursor: pointer;
	pointer-events: auto;
}
.reel-progress-bar {
	display: block;
	height: 100%;
	background: var(--color-accent);
	width: 0;
	transition: width 0.05s linear;
}
.reel-header img {
	height: 30px;
	filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.7));
}
.reel-footer {
	padding: 20px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
	color: #fff;
	font-size: 16px;
	border-radius: 0 0 12px 12px;
}
.reel-title {
	font-weight: bold;
	display: block;
	margin-bottom: 4px;
}

.reel-prev,
.reel-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	border: none;
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	pointer-events: auto;
	border-radius: 50%;
	opacity: 0.8;
	transition: all 0.3s ease;
	/*display: none;*/
}
@media (hover: hover) {
	.reel-prev:hover,
	.reel-next:hover {
		opacity: 1;
	}
}
.reel-next svg {
	border-bottom-right-radius: 100px;
	border-top-right-radius: 100px;
}

.reel-prev svg {
	border-bottom-left-radius: 100px;
	border-top-left-radius: 100px;
}
.reel-prev.disabled,
.reel-next.disabled {
	opacity: 0.3;
	pointer-events: none;
}
.reel-prev {
	left: -90px;
}
.reel-next {
	right: -90px;
}

#close-overlay,
#close-overlay-mob {
	position: absolute;
	top: 20px;
	right: 20px;
	background: var(--color-accent);
	border: none;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	pointer-events: auto;
	padding: 10px 14px;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
@media (hover: hover) {
	#close-overlay:hover,
	#close-overlay-mob:hover {
		background: #be1431;
	}
}
#close-overlay-mob {
	display: none;
}

.play-pause-indicator {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 60px;
	color: white;
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
	z-index: 1001;
	/* background: rgba(0, 0, 0, 0.5); */
	width: 45px;
	height: 45px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Контейнеры для превью */
.previews-container {
	/*position: absolute;*/
	/*top: 50%;*/
	/*transform: translateY(-50%);*/
	display: flex;
	gap: 10px;
	z-index: 999;
	pointer-events: none;
}

.previews-prev {
	/*left: 20px;*/
	margin-right: 100px;
	justify-content: flex-end;
}

.previews-next {
	/*right: 20px;*/
	margin-left: 100px;
}

.preview-video {
	width: 120px;
	height: 180px;
	object-fit: cover;
	border-radius: 8px;
	transition: all 0.3s;
	pointer-events: auto;
	cursor: pointer;
	padding: 5px;
}

.preview-video::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(45deg, rgba(0, 0, 0, 0.3), transparent);
	border-radius: 8px;
}

.reels-nav-mob {
	width: 98%;
	position: absolute;
	top: 50%;
	z-index: 1;
	height: 0;
}

.reels-nav {
	display: flex;
	justify-content: space-between;
	height: 0;
}

.reels-next svg {
	border-bottom-right-radius: 100px;
	border-top-right-radius: 100px;
}

.reels-prev svg {
	border-bottom-left-radius: 100px;
	border-top-left-radius: 100px;
}

.reels-bg {
	position: absolute;
	top: 80px;
	left: 50%;
	transform: translateX(-50%);
}

@media (max-width: 1600px) {
	.video-wrapper {
		max-height: 419px;
		max-width: 240px !important;
	}
	.reels-nav-mob {
		top: auto;
		bottom: -35px;
	}
	.reels-nav {
		justify-content: center;
		gap: 20px;
	}
}

/* @media (max-width: 992px) {
	#video-container {
		width: 100%;
	}

	#video-overlay {
		grid-template-columns: repeat(1, 1fr);
	}
	.reel-prev,
	.reel-next {
		display: none;
	}
	.preview-video {
		display: none;
	}

	.reels-nav-mob {
		display: flex;
		height: max-content;
		justify-content: space-between;
		align-items: center;
	}
	.reels-pagination .swiper-pagination-bullet {
		width: 4px;
		height: 4px;
		background: #979797;
		opacity: 1;
		transition: all 0.3s;
	}

	.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next {
		transform: scale(1) !important;
	}

	.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next {
		transform: scale(0.77) !important;
	}

	.reels-pagination {
		position: relative;
		left: auto !important;
		transform: none !important;
		bottom: auto !important;
		top: auto !important;
		width: max-content !important;
	}

	.reels-pagination .swiper-pagination-bullet-active {
		width: 20px;
		height: 4px;
		background: #979797;
		opacity: 1;
		border-radius: 30px;
	}

	.video-wrapper {
		height: 359px;
		max-width: 100% !important;
		width: 170px;
		padding: 0;
		margin: 0 8px;
		border: none;
	}

	.video-wrapper:hover {
		border: none;
	}

	.reels-nav-mob.desc-hide {
		display: flex;
		bottom: auto;
		top: 432px;
	}

	.reels-phone {
		position: absolute;
		top: 27.5px;
		left: 50%;
		transform: translateX(-50%);
		width: 249px;
		z-index: 1;
		pointer-events: none;
	}

	.sound-toggle {
		position: absolute;
		top: 10px;
		right: 10px;
		z-index: 5;
		background: rgba(0, 0, 0, 0.6);
		border: none;
		color: #fff;
		font-size: 18px;
		border-radius: 50%;
		width: 40px;
		height: 40px;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}

	.overlay .reel-title {
		font-size: 11px;
		margin-bottom: 0;
	}
} */

@media (max-width: 992px) {
	:root {
		--scale-factor: calc(100 / 360 * 1vw); /* масштаб относительно 360px */
	}

	#video-container {
		width: 100%;
		height: 90svh;
		width: 96vw;
	}

	#video-overlay {
		grid-template-columns: repeat(1, 1fr);
	}

	.reel-prev,
	.reel-next {
		display: none;
	}

	.preview-video {
		display: none;
	}

	.reels-nav-mob {
		display: flex;
		height: max-content;
		justify-content: space-between;
		align-items: center;
	}

	.reels-pagination .swiper-pagination-bullet {
		width: 4px;
		height: 4px;
		background: #979797;
		opacity: 1;
		transition: all 0.3s;
	}

	.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next {
		transform: scale(1) !important;
	}

	.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next {
		transform: scale(0.77) !important;
	}

	.reels-pagination {
		position: relative;
		left: auto !important;
		transform: none !important;
		bottom: auto !important;
		top: auto !important;
		width: max-content !important;
	}

	.reels-pagination .swiper-pagination-bullet-active {
		width: 20px;
		height: 4px;
		background: #979797;
		opacity: 1;
		border-radius: 30px;
	}

	.video-wrapper {
		width: calc(170 * var(--scale-factor));
		height: calc(363 * var(--scale-factor));
		max-width: 100% !important;
		max-height: 100%;
		padding: 0;
		margin: 0 calc(8 * var(--scale-factor));
		border: none;
	}

	@media (hover: hover) {
		.video-wrapper:hover {
			border: none;
		}
	}

	.reels-nav-mob.desc-hide {
		display: flex !important;
		bottom: auto;
		top: calc(464 * var(--scale-factor));
		padding: 0 16px;
	}

	.reels-phone {
		position: absolute;
		top: 46.5px;
		left: 50%;
		transform: translateX(-50%);
		width: calc(249 * var(--scale-factor));
		z-index: 1;
		pointer-events: none;
	}

	.sound-toggle {
		display: none;
	}

	.overlay .reel-title {
		font-size: calc(11 * var(--scale-factor));
		margin-bottom: 0;
	}

	.video-poster {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		border-radius: 16px;
		pointer-events: none;
		display: block;
		z-index: 1;
	}

	.sound-toggle {
		display: none;
	}

	.reels-nav {
		justify-content: center;
		gap: 8px;
		width: fit-content;
	}
}
