/* Nexvio Product Images: main image + gallery. Same box for every image, never cropped. */
.elementor-widget-nexvio_product_images,
.elementor-widget-nexvio_product_images > .elementor-widget-container {
	width: 100%;
	max-width: 100%;
	min-width: 0
}

.nexvio-pi {
	--nexvio-pi-thumb: 64px;
	--nexvio-pi-gap: 10px;
	--nexvio-pi-below: 84px;
	--nexvio-pi-below-gap: 10px;
	--nexvio-pi-wrap-gap: 12px;
	position: relative;
	isolation: isolate; /* the arrows / thumbnails never paint over the next section */
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box
}

.nexvio-pi *,
.nexvio-pi *::before,
.nexvio-pi *::after {
	box-sizing: border-box
}

.nexvio-pi--empty {
	padding: 24px;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	color: #64748b;
	font-size: 14px;
	text-align: center
}

.nexvio-pi__wrap {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--nexvio-pi-wrap-gap);
	align-items: stretch
}

/* ---------- main image ---------- */
.nexvio-pi__stage {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f3f4f6
}

.nexvio-pi__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain; /* the whole picture is visible */
	transition: opacity .2s ease;
	user-select: none;
	-webkit-user-drag: none
}

.nexvio-pi__img.is-swap {
	opacity: 0
}

/* ---------- thumbnails inside the image, at the bottom, centred ---------- */
.nexvio-pi__thumbs-wrap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	pointer-events: none
}

.nexvio-pi__thumbs {
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-start;
	gap: var(--nexvio-pi-gap);
	padding: 28px 10px 10px;
	overflow-x: auto;
	overflow-y: hidden;
	background: linear-gradient(to top, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
	pointer-events: none;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch
}

.nexvio-pi__thumbs::-webkit-scrollbar {
	display: none
}

.nexvio-pi__thumb {
	flex: 0 0 auto;
	width: min(var(--nexvio-pi-thumb), 48px);
	height: min(var(--nexvio-pi-thumb), 48px);
	padding: 0;
	margin: 0;
	border: 2px solid rgba(255, 255, 255, .7);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	cursor: pointer;
	line-height: 0;
	pointer-events: auto;
	transition: border-color .2s, opacity .2s, transform .2s
}

.nexvio-pi__thumb:first-child {
	margin-left: auto /* centred, and still scrollable when there are many */
}

.nexvio-pi__thumb:last-child {
	margin-right: auto
}

.nexvio-pi__thumb:hover {
	opacity: 1 !important
}

.nexvio-pi__thumb.is-active {
	border-color: #fff
}

.nexvio-pi__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain
}

/* ---------- gallery images outside the main image (position: top / bottom / left / right) ---------- */
.nexvio-pi__below {
	flex: 0 0 auto;
	min-width: 0
}

.nexvio-pi__below-list {
	max-width: 100%;
	display: flex;
	flex-wrap: nowrap;
	gap: var(--nexvio-pi-below-gap);
	padding: 2px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch
}

.nexvio-pi__bthumb {
	flex: 0 0 auto;
	width: var(--nexvio-pi-below);
	height: var(--nexvio-pi-below);
	padding: 0;
	margin: 0;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	cursor: pointer;
	line-height: 0;
	transition: border-color .2s, transform .2s
}

.nexvio-pi__bthumb:hover {
	transform: translateY(-2px)
}

.nexvio-pi__bthumb.is-active {
	border-color: #111827
}

.nexvio-pi__bthumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain
}

.nexvio-pi__thumb:focus-visible,
.nexvio-pi__bthumb:focus-visible,
.nexvio-pi__nav:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px
}

/* ---------- arrows ---------- */
.nexvio-pi__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	margin: -19px 0 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: #111827;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	opacity: 0;
	transition: opacity .2s, transform .2s
}

.nexvio-pi__nav svg {
	width: 55%;
	height: 55%
}

.nexvio-pi__nav--prev {
	left: 10px
}

.nexvio-pi__nav--next {
	right: 10px
}

.nexvio-pi__stage:hover .nexvio-pi__nav,
.nexvio-pi__nav:focus-visible {
	opacity: 1
}

.nexvio-pi__nav:hover {
	transform: scale(1.08)
}

@media (hover: none) {
	.nexvio-pi__nav {
		opacity: 1
	}
}

/* ---------- position of the gallery images: desktop / tablet ---------- */
@media (min-width: 768px) {
	.nexvio-pi--pos-top .nexvio-pi__wrap {
		flex-direction: column-reverse
	}

	.nexvio-pi--pos-bottom .nexvio-pi__wrap {
		flex-direction: column
	}

	.nexvio-pi--pos-left .nexvio-pi__wrap {
		flex-direction: row-reverse
	}

	.nexvio-pi--pos-right .nexvio-pi__wrap {
		flex-direction: row
	}

	.nexvio-pi--pos-left .nexvio-pi__stage,
	.nexvio-pi--pos-right .nexvio-pi__stage {
		width: auto;
		flex: 1 1 0
	}

	/* vertical row: as tall as the main image, scrolls when there are many images */
	.nexvio-pi--pos-left .nexvio-pi__below,
	.nexvio-pi--pos-right .nexvio-pi__below {
		position: relative;
		width: calc(var(--nexvio-pi-below) + 4px)
	}

	.nexvio-pi--pos-left .nexvio-pi__below-list,
	.nexvio-pi--pos-right .nexvio-pi__below-list {
		position: absolute;
		inset: 0;
		flex-direction: column;
		overflow-x: hidden;
		overflow-y: auto
	}
}

/* ---------- position of the gallery images: phones ---------- */
@media (max-width: 767px) {
	.nexvio-pi--mpos-top .nexvio-pi__wrap {
		flex-direction: column-reverse
	}

	.nexvio-pi--mpos-bottom .nexvio-pi__wrap {
		flex-direction: column
	}

	.nexvio-pi--mpos-left .nexvio-pi__wrap {
		flex-direction: row-reverse
	}

	.nexvio-pi--mpos-right .nexvio-pi__wrap {
		flex-direction: row
	}

	.nexvio-pi--mpos-left .nexvio-pi__stage,
	.nexvio-pi--mpos-right .nexvio-pi__stage {
		width: auto;
		flex: 1 1 0
	}

	/* vertical row: as tall as the main image, scrolls when there are many images */
	.nexvio-pi--mpos-left .nexvio-pi__below,
	.nexvio-pi--mpos-right .nexvio-pi__below {
		position: relative;
		width: calc(var(--nexvio-pi-below) + 4px)
	}

	.nexvio-pi--mpos-left .nexvio-pi__below-list,
	.nexvio-pi--mpos-right .nexvio-pi__below-list {
		position: absolute;
		inset: 0;
		flex-direction: column;
		overflow-x: hidden;
		overflow-y: auto
	}
}

@media (prefers-reduced-motion: reduce) {

	.nexvio-pi__img,
	.nexvio-pi__thumb,
	.nexvio-pi__bthumb,
	.nexvio-pi__nav {
		transition-duration: .01ms !important
	}
}
