/**
 * AXN Video Product Gallery – Frontend styles
 *
 * Reproductor de vídeo embebido en la galería de producto (estilo
 * AliExpress/Amazon): barra de controles al pasar el mouse con
 * play/pausa, tiempo, línea de reproducción, sonido y volumen.
 * Badge de vídeo en miniaturas y lightbox de respaldo para otros temas.
 */

/* ------------------------------------------------------------------ */
/* Slide con el reproductor                                            */
/* ------------------------------------------------------------------ */

.axn-vpg-slide {
	position: relative;
	width: 100%;
}

.axn-vpg-frame {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #000;
	line-height: 0; /* evita huecos por whitespace inline */
}

.axn-vpg-video {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	outline: none;
}

/* ------------------------------------------------------------------ */
/* Barra de controles                                                  */
/* ------------------------------------------------------------------ */

.axn-vpg-controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 26px 12px 10px;
	direction: ltr; /* la barra siempre se dibuja igual aunque el sitio sea RTL */
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
	/* Siempre visible: el control del vídeo no depende del hover ni del JS */
}

/* ------------------------------------------------------------------ */
/* Botones (play/pausa y sonido)                                       */
/* ------------------------------------------------------------------ */

.axn-vpg-btn {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
}

.axn-vpg-btn:hover,
.axn-vpg-btn:focus-visible {
	background: rgba(255, 255, 255, 0.18);
}

.axn-vpg-btn:active {
	transform: scale(0.92);
}

.axn-vpg-btn svg {
	width: 19px;
	height: 19px;
	display: block;
}

/* Icono del botón play/pausa */
.axn-vpg-play .axn-icon-pause {
	display: none;
}

.axn-vpg-play.is-playing .axn-icon-pause {
	display: block;
}

.axn-vpg-play.is-playing .axn-icon-play {
	display: none;
}

/* Icono del botón de sonido */
.axn-vpg-sound .axn-icon-on {
	display: none;
}

.axn-vpg-sound .axn-icon-off {
	display: block;
}

.axn-vpg-sound:not(.is-muted) .axn-icon-on {
	display: block;
}

.axn-vpg-sound:not(.is-muted) .axn-icon-off {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Tiempo y deslizadores (seek / volumen)                              */
/* ------------------------------------------------------------------ */

.axn-vpg-time {
	flex: 0 0 auto;
	color: #ffffff;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.axn-vpg-slider {
	-webkit-appearance: none;
	appearance: none;
	height: 4px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(
		to right,
		#ffffff 0%,
		#ffffff var(--fill, 0%),
		rgba(255, 255, 255, 0.3) var(--fill, 0%),
		rgba(255, 255, 255, 0.3) 100%
	);
	cursor: pointer;
	outline: none;
}

.axn-vpg-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ffffff;
	border: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
	transition: transform 0.15s ease;
}

.axn-vpg-slider::-webkit-slider-thumb:hover {
	transform: scale(1.2);
}

.axn-vpg-slider::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ffffff;
	border: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Línea de reproducción: ocupa el espacio disponible */
.axn-vpg-seek {
	flex: 1 1 auto;
	width: auto;
	min-width: 40px;
}

/* Volumen: ancho fijo */
.axn-vpg-volume {
	flex: 0 0 72px;
	width: 72px;
}

/* Duración desconocida (streaming): sin seek ni tiempo */
.axn-vpg-no-duration .axn-vpg-seek,
.axn-vpg-no-duration .axn-vpg-time {
	display: none;
}

/* iOS no permite cambiar el volumen por JS: se oculta el deslizador */
.axn-vpg-ios .axn-vpg-volume {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Preview del primer cuadro (inyectado por WooCommerce en la miniatura)*/
/* ------------------------------------------------------------------ */

/* WC atenúa el preview al 50% vía estilo inline cuando el slide no está
   activo: se fuerza a opacidad plena para que la miniatura muestre el
   primer cuadro real del vídeo y no una versión oscurecida. */
.flex-control-thumbs .woocommerce-product-gallery__video-thumbnail-preview {
	opacity: 1 !important;
}

/* ------------------------------------------------------------------ */
/* Flash de play/pausa al hacer click en el vídeo                      */
/* ------------------------------------------------------------------ */

.axn-vpg-flash {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.axn-vpg-flash.axn-show {
	opacity: 1;
}

.axn-vpg-flash span {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.axn-vpg-flash svg {
	width: 30px;
	height: 30px;
	display: block;
}

.axn-vpg-flash .axn-icon-pause {
	display: none;
}

.axn-vpg-flash[data-icon="pause"] .axn-icon-pause {
	display: block;
}

.axn-vpg-flash[data-icon="pause"] .axn-icon-play {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Badge de vídeo en las miniaturas                                    */
/* ------------------------------------------------------------------ */

/* Funciona igual en .col (Flatsome clásico) y en li (flexslider WC) */
.axn-vpg-thumb {
	position: relative;
	display: block;
}

a.axn-vpg-link {
	position: relative;
	display: block;
}

.axn-vpg-thumb::after,
a.axn-vpg-link::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.45);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px;
	pointer-events: none;
	z-index: 2;
}

/* Etiqueta pequeña "VÍDEO" bajo el badge de la miniatura */
.axn-vpg-thumb::before {
	content: "VÍDEO";
	position: absolute;
	bottom: 6px;
	left: 6px;
	z-index: 2;
	padding: 2px 6px;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.6);
	color: #ffffff;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.4;
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Lightbox de respaldo (temas no Flatsome)                            */
/* ------------------------------------------------------------------ */

.axn-vpg-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	animation: axn-vpg-fade-in 0.2s ease;
}

.axn-vpg-overlay-video {
	max-width: 92vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	background: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.axn-vpg-overlay-close {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.axn-vpg-overlay-close:hover,
.axn-vpg-overlay-close:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}

html.axn-vpg-no-scroll,
html.axn-vpg-no-scroll body {
	overflow: hidden !important;
}

@keyframes axn-vpg-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* ------------------------------------------------------------------ */
/* Accesibilidad                                                       */
/* ------------------------------------------------------------------ */

.axn-vpg-btn:focus-visible,
.axn-vpg-slider:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.9);
	outline-offset: 2px;
}
