/* Galería del producto. Especificidad baja: los controles de Elementor ({{WRAPPER}}) siempre ganan.
   La posición de las miniaturas llega como variables CSS desde el control (ver selectors_dictionary). */

.wzpy-gallery {
	--wzpy-thumb: 72px;
	--wzpy-zoom: 2;
	display: flex;
	flex-direction: var(--wzpy-dir, column);
	gap: 12px;
}

.wzpy-gallery__main {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	border: 0 solid transparent;
}

.wzpy-gallery__link {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
}

a.wzpy-gallery__link {
	cursor: zoom-in;
}

.wzpy-gallery__main .wzpy-gallery__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
	transition: transform .2s ease;
}

/* Zoom: el JS mueve transform-origin con el mouse. Solo en dispositivos con hover real. */
@media (hover: hover) {
	.wzpy-gallery--zoom-yes .wzpy-gallery__link:hover .wzpy-gallery__img {
		transform: scale(var(--wzpy-zoom));
	}
}

/* ---------- Miniaturas ---------- */

.wzpy-gallery__thumbs {
	position: relative; /* offsetLeft/Top de las miniaturas relativos a la lista (scroll en JS) */
	display: var(--wzpy-thumbs, flex);
	flex-direction: var(--wzpy-tdir, row);
	flex-shrink: 0;
	gap: 8px;
	width: var(--wzpy-tw, auto);
	/* Vertical: contain:size hace que la columna tome el alto de la imagen principal y haga scroll. */
	contain: var(--wzpy-tcontain, none);
	overflow: auto;
	scrollbar-width: thin;
}

.wzpy-gallery .wzpy-gallery__thumb {
	flex: none;
	width: var(--wzpy-thumb);
	min-height: var(--wzpy-thumb); /* el tema fuerza "button { height: inherit !important }" */
	margin: 0;
	padding: 2px;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	background: #fff;
	box-sizing: border-box;
	cursor: pointer;
	opacity: .6;
	transition: all .2s;
}

.wzpy-gallery .wzpy-gallery__thumb:hover,
.wzpy-gallery .wzpy-gallery__thumb[aria-current="true"] {
	opacity: 1;
}

.wzpy-gallery .wzpy-gallery__thumb[aria-current="true"] {
	border-color: #ff6500;
}

.wzpy-gallery__thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: contain;
}

/* ---------- Flechas ---------- */

.wzpy-gallery .wzpy-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	min-height: 36px; /* min-height: el tema fuerza "button { height: inherit !important }" */
	margin: 0;
	padding: 0;
	border: 1px solid #e5e5e5;
	border-radius: 50%;
	background: #fff;
	color: #333;
	font-size: 14px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
	cursor: pointer;
	transform: translateY(-50%);
	transition: all .2s;
}

.wzpy-gallery__arrow svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.wzpy-gallery .wzpy-gallery__arrow:hover {
	border-color: #ff6500;
	background: #ff6500;
	color: #fff;
}

.wzpy-gallery__arrow--prev { left: 8px; }
.wzpy-gallery__arrow--next { right: 8px; }

.wzpy-gallery__empty {
	margin: 0;
	padding: 20px;
	color: #777;
	text-align: center;
}
