/*
 * Estetikos studija – prekės video: kortelė po pirkimo mygtukais ir peržiūros langas.
 */

.es-pvideo,
.es-pvideo-langas {
	--v-ink: var(--es-ink, #232221);
	--v-text: var(--es-text, #55534f);
	--v-muted: var(--es-muted, #8b8985);
	--v-line: var(--es-line, #e6e5e2);
	--v-surface: var(--es-surface, #f5f5f3);
	--v-radius: var(--es-radius, 10px);
	--v-ease: var(--es-ease, cubic-bezier(.16, 1, .3, 1));
}

.es-pvideo {
	margin: 20px 0 6px;
}

.es-pvideo__antraste {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--v-muted);
}

.es-pvideo__sarasas {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Kortelė (mygtukas) – atšaukiamas temos mygtukų stilius */
.es-pvideo button.es-pvideo__kortele {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	height: auto !important;
	min-height: 0 !important;
	margin: 0;
	padding: 12px !important;
	border: 1px solid var(--v-line) !important;
	border-radius: var(--v-radius) !important;
	background: #fff !important;
	color: var(--v-ink) !important;
	box-shadow: none !important;
	font: inherit;
	line-height: 1.4 !important;
	letter-spacing: 0;
	text-align: left;
	text-transform: none !important;
	white-space: normal;
	cursor: pointer;
	transition: border-color .25s var(--v-ease), background-color .25s var(--v-ease);
}

.es-pvideo button.es-pvideo__kortele:hover {
	border-color: var(--v-ink) !important;
}

.es-pvideo button.es-pvideo__kortele:focus-visible {
	outline: 2px solid var(--v-ink);
	outline-offset: 3px;
}

.es-pvideo__kadras {
	position: relative;
	flex: 0 0 auto;
	display: block;
	width: 108px;
	aspect-ratio: 9 / 16;
	border-radius: 8px;
	overflow: hidden;
	background: var(--v-surface);
}

.es-pvideo__kadras video,
.es-pvideo__kadras img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 1 !important;
}

.es-pvideo__groti {
	position: absolute;
	left: 8px;
	bottom: 8px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding-left: 2px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .94);
	color: var(--v-ink);
	transition: transform .3s var(--v-ease);
}

.es-pvideo__kortele:hover .es-pvideo__groti {
	transform: scale(1.1);
}

.es-pvideo__tekstas {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.es-pvideo__zyma {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--v-muted);
}

.es-pvideo__pavadinimas {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--v-ink);
}

.es-pvideo__nuoroda {
	margin-top: 4px;
	font-size: 14px;
	color: var(--v-ink);
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Keli video – vertikalios kortelės vienoje eilėje */
.es-pvideo--keli button.es-pvideo__kortele {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	width: 150px;
	padding: 8px !important;
}

.es-pvideo--keli .es-pvideo__kadras {
	width: 100%;
}

.es-pvideo--keli .es-pvideo__pavadinimas {
	font-size: 14px;
}

.es-pvideo--keli .es-pvideo__nuoroda {
	display: none;
}

/* ---------- Peržiūros langas ---------- */

.es-pvideo-langas {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(20, 18, 16, .78);
	opacity: 0;
	transition: opacity .25s var(--v-ease);
}

.es-pvideo-langas.yra-atidarytas {
	opacity: 1;
}

.es-pvideo-langas__vidus {
	position: relative;
	width: min(100%, calc((100svh - 40px) * 9 / 16));
	max-height: calc(100svh - 40px);
	border-radius: 14px;
	overflow: hidden;
	background: #000;
	transform: translateY(8px) scale(.985);
	transition: transform .35s var(--v-ease);
}

.es-pvideo-langas.yra-atidarytas .es-pvideo-langas__vidus {
	transform: none;
}

.es-pvideo-langas video {
	display: block;
	width: 100%;
	max-height: calc(100svh - 40px);
	background: #000;
}

.es-pvideo-langas button.es-pvideo-langas__uzdaryti {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px !important;
	height: 40px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: rgba(255, 255, 255, .94) !important;
	color: var(--v-ink) !important;
	box-shadow: none !important;
	line-height: 1 !important;
	cursor: pointer;
}

.es-pvideo-langas button.es-pvideo-langas__uzdaryti:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

html.es-pvideo-atidarytas {
	overflow: hidden;
}

@media (max-width: 480px) {
	.es-pvideo__kadras {
		width: 92px;
	}

	.es-pvideo__pavadinimas {
		font-size: 16px;
	}

	.es-pvideo-langas {
		padding: 10px;
	}

	.es-pvideo-langas__vidus {
		width: min(100%, calc((100svh - 20px) * 9 / 16));
		max-height: calc(100svh - 20px);
	}

	.es-pvideo-langas video {
		max-height: calc(100svh - 20px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.es-pvideo *,
	.es-pvideo-langas,
	.es-pvideo-langas * {
		transition-duration: .01ms !important;
	}
}
