/**
 * Ella Product Gallery styles.
 * Version: 3.0.0
 */

.woocommerce-product-gallery__image a {
	cursor: pointer !important;
	pointer-events: auto !important;
}

.woocommerce-product-gallery__image a:hover {
	text-decoration: none !important;
}

.woocommerce-product-gallery {
	position: relative !important;
}

.woocommerce-product-gallery.flexslider,
.woocommerce-product-gallery .flexslider,
.woocommerce-product-gallery .flexslider .slides,
.woocommerce-product-gallery .flexslider .slides > li,
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery .flex-viewport {
	transition: transform .35s cubic-bezier(.25, .46, .45, .94) !important;
}

.woocommerce-product-gallery .flexslider .slides > li img,
.woocommerce-product-gallery__image {
	transition: opacity .35s ease-out !important;
}

/* The custom arrows replace WooCommerce's thumbnail navigation. */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
	display: none !important;
}

.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery__wrapper *,
.ella-gallery-clickable-area,
.ella-gallery-clickable-area *,
.ella-gallery-arrow,
.ella-gallery-arrow * {
	-webkit-tap-highlight-color: transparent !important;
	-webkit-user-select: none !important;
	user-select: none !important;
}

.woocommerce-product-gallery__wrapper::selection,
.ella-gallery-clickable-area::selection,
.ella-gallery-arrow::selection {
	background: transparent !important;
}

.ella-gallery-arrow:focus-visible {
	outline: 2px solid #2271b1 !important;
	outline-offset: 2px !important;
}

/* Invisible hit targets protect the image link from missed arrow taps. */
.ella-gallery-clickable-area {
	position: absolute !important;
	top: 20% !important;
	z-index: 998 !important;
	width: 60px !important;
	height: 60% !important;
	background: transparent !important;
	cursor: pointer !important;
	opacity: 1 !important;
	pointer-events: auto !important;
	touch-action: pan-y !important;
}

.ella-gallery-clickable-area[hidden] {
	opacity: 0 !important;
	pointer-events: none !important;
}

.ella-gallery-clickable-area-left {
	left: 0 !important;
	right: auto !important;
}

.ella-gallery-clickable-area-right {
	right: 0 !important;
	left: auto !important;
}

[dir="rtl"] .ella-gallery-clickable-area-left,
.ella-gallery-rtl .ella-gallery-clickable-area-left {
	right: 0 !important;
	left: auto !important;
}

[dir="rtl"] .ella-gallery-clickable-area-right,
.ella-gallery-rtl .ella-gallery-clickable-area-right {
	left: 0 !important;
	right: auto !important;
}

.ella-gallery-arrow,
.ella-gallery-arrow-prev,
.ella-gallery-arrow-next {
	position: absolute !important;
	top: 50% !important;
	z-index: 999 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 36px !important;
	height: 36px !important;
	margin: 0 !important;
	padding: 0 !important;
	color: #1a1a1a !important;
	font: 400 20px/1 Arial, sans-serif !important;
	background: rgb(255 255 255 / 95%) !important;
	border: 1px solid #e3e3e3 !important;
	border-radius: 50% !important;
	box-shadow: 0 1px 3px rgb(0 0 0 / 10%) !important;
	cursor: pointer !important;
	opacity: .8 !important;
	pointer-events: auto !important;
	transform: translateY(-50%) !important;
	transition: all .2s ease !important;
	appearance: none !important;
}

.ella-gallery-arrow:hover,
.ella-gallery-arrow-prev:hover,
.ella-gallery-arrow-next:hover {
	background: #fff !important;
	border-color: #e3e3e3 !important;
	box-shadow: 0 2px 6px rgb(0 0 0 / 15%) !important;
	opacity: 1 !important;
}

.ella-gallery-arrow:active,
.ella-gallery-arrow-prev:active,
.ella-gallery-arrow-next:active {
	border-color: #e3e3e3 !important;
	transform: translateY(-50%) scale(.95) !important;
}

.ella-gallery-arrow.disabled,
.ella-gallery-arrow.disabled:hover,
.ella-gallery-arrow-prev.disabled,
.ella-gallery-arrow-prev.disabled:hover,
.ella-gallery-arrow-next.disabled,
.ella-gallery-arrow-next.disabled:hover {
	background: rgb(255 255 255 / 50%) !important;
	border-color: #e3e3e3 !important;
	box-shadow: 0 1px 3px rgb(0 0 0 / 10%) !important;
	cursor: not-allowed !important;
	opacity: .25 !important;
	pointer-events: none !important;
}

.ella-gallery-arrow-prev {
	left: 15px !important;
	right: auto !important;
}

.ella-gallery-arrow-next {
	right: 15px !important;
	left: auto !important;
}

[dir="rtl"] .ella-gallery-arrow-prev,
.ella-gallery-rtl .ella-gallery-arrow-prev {
	right: 15px !important;
	left: auto !important;
}

[dir="rtl"] .ella-gallery-arrow-next,
.ella-gallery-rtl .ella-gallery-arrow-next {
	left: 15px !important;
	right: auto !important;
}

@media (hover: none) and (pointer: coarse) {
	.ella-gallery-clickable-area,
	.ella-gallery-arrow {
		pointer-events: auto !important;
	}

	.ella-gallery-arrow.disabled {
		pointer-events: none !important;
	}
}

@media (max-width: 768px) {
	.ella-gallery-arrow,
	.ella-gallery-arrow-prev,
	.ella-gallery-arrow-next {
		width: 32px !important;
		height: 32px !important;
		font-size: 18px !important;
		border: 1px solid #e3e3e3 !important;
		box-shadow: 0 1px 3px rgb(0 0 0 / 10%) !important;
	}

	.ella-gallery-arrow-prev {
		left: 10px !important;
		right: auto !important;
	}

	.ella-gallery-arrow-next {
		right: 10px !important;
		left: auto !important;
	}

	[dir="rtl"] .ella-gallery-arrow-prev {
		right: 10px !important;
		left: auto !important;
	}

	[dir="rtl"] .ella-gallery-arrow-next {
		left: 10px !important;
		right: auto !important;
	}
}

/* White product-image lightbox. */
.ella-gallery-lightbox-overlay {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999999;
	display: none;
	width: 100%;
	height: 100%;
	background: #fff;
	opacity: 0;
	transition: opacity .35s cubic-bezier(.25, .46, .45, .94);
	scrollbar-width: none !important;
	-ms-overflow-style: none !important;
}

.ella-gallery-lightbox-overlay::-webkit-scrollbar,
.ella-gallery-lightbox-thumbnails::-webkit-scrollbar {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
}

.ella-gallery-lightbox-overlay.active {
	display: block;
	opacity: 1;
}

.ella-gallery-lightbox-overlay[hidden] {
	display: none !important;
}

.ella-gallery-lightbox-container {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 40px;
	background: #fff;
}

.ella-gallery-lightbox-image {
	max-width: 90%;
	max-height: 90%;
	object-fit: contain;
	background: #fff;
	transition: opacity .35s ease-out;
}

.ella-gallery-lightbox-overlay .ella-gallery-lightbox-close {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1000001;
	display: block;
	width: 50px;
	height: 50px;
	margin: 0;
	padding: 0;
	color: #000;
	font: 400 40px/50px Arial, sans-serif;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	appearance: none;
}

.ella-gallery-lightbox-overlay .ella-gallery-lightbox-close:hover,
.ella-gallery-lightbox-overlay .ella-gallery-lightbox-close:focus {
	color: #000;
	background: transparent;
	box-shadow: none;
	opacity: .7;
}

.ella-gallery-lightbox-overlay .ella-gallery-lightbox-close:focus-visible,
.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

@media (min-width: 769px) {
	.ella-gallery-lightbox-overlay {
		overflow-x: auto !important;
		overflow-y: hidden !important;
		scroll-behavior: smooth;
		scroll-snap-type: x mandatory;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
	}

	.ella-gallery-lightbox-container {
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		width: auto;
		min-width: 100%;
		height: 100%;
		padding: 0;
	}

	.ella-gallery-lightbox-image {
		display: block;
		flex-shrink: 0;
		width: 100vw;
		min-width: 100vw;
		max-width: 100vw;
		height: 100vh;
		max-height: 100vh;
		object-fit: contain;
		object-position: center;
		scroll-snap-align: center;
		scroll-snap-stop: always;
		transition: opacity .35s ease-out;
	}
}

@media (max-width: 768px) {
	.ella-gallery-lightbox-overlay {
		overflow-x: hidden;
		overflow-y: auto;
		scroll-behavior: smooth;
		scroll-snap-type: y mandatory;
		overscroll-behavior: contain;
		touch-action: pan-y;
		-webkit-overflow-scrolling: touch;
	}

	.ella-gallery-lightbox-container {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		min-height: 100vh;
		padding: 0;
	}

	.ella-gallery-lightbox-image-wrapper {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		width: 100%;
		height: 100vh;
		min-height: 100vh;
		overflow: hidden;
		scroll-snap-align: start;
		scroll-snap-stop: always;
		touch-action: auto;
	}

	.ella-gallery-lightbox-image-wrapper.zooming,
	.ella-gallery-lightbox-image-wrapper.panning,
	.ella-gallery-lightbox-image-wrapper.zoomed,
	.ella-gallery-lightbox-image-wrapper.zoom-animating {
		touch-action: none !important;
	}

	.ella-gallery-lightbox-image-wrapper.zooming .ella-gallery-lightbox-image,
	.ella-gallery-lightbox-image-wrapper.panning .ella-gallery-lightbox-image,
	.ella-gallery-lightbox-image-wrapper.zoomed .ella-gallery-lightbox-image,
	.ella-gallery-lightbox-image-wrapper.zoom-animating .ella-gallery-lightbox-image {
		will-change: transform;
	}

	.ella-gallery-lightbox-image-wrapper.zoom-animating .ella-gallery-lightbox-image {
		transition: transform .26s cubic-bezier(.25, .46, .45, .94);
	}

	.ella-gallery-lightbox-image-wrapper.zooming .ella-gallery-lightbox-image,
	.ella-gallery-lightbox-image-wrapper.panning .ella-gallery-lightbox-image {
		transition: none;
	}

	.ella-gallery-lightbox-image {
		display: block;
		width: 100%;
		max-width: 100%;
		height: 100vh;
		min-height: 100vh;
		max-height: 100vh;
		object-fit: contain;
		object-position: center;
		user-select: none;
		transform-origin: center;
		backface-visibility: hidden;
	}

	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-close {
		top: 15px;
		right: 15px;
		font-size: 35px;
	}
}

html.ella-gallery-lightbox-open,
body.ella-gallery-lightbox-open {
	position: fixed !important;
	width: 100% !important;
	height: 100% !important;
	overflow: hidden !important;
	scrollbar-width: none !important;
	-ms-overflow-style: none !important;
}

html.ella-gallery-lightbox-open::-webkit-scrollbar,
body.ella-gallery-lightbox-open::-webkit-scrollbar {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
}

.ella-gallery-lightbox-thumbnails {
	position: fixed;
	z-index: 1000002;
	box-sizing: border-box;
	padding: 10px;
	background: rgb(255 255 255 / 95%);
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail {
	display: block;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 2px solid transparent;
	box-shadow: none;
	cursor: pointer;
	opacity: .6;
	transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
	appearance: none;
}

.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail:hover {
	background: #fff;
	opacity: .9;
	transform: scale(1.05);
}

.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail.active {
	background: #fff;
	border-color: #000;
	opacity: 1;
	transform: scale(1.1);
}

.ella-gallery-lightbox-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 2px;
}

@media (min-width: 769px) {
	.ella-gallery-lightbox-thumbnails {
		bottom: 30px;
		left: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		width: auto;
		min-width: 300px;
		max-width: calc(100% - 40px);
		height: 120px;
		min-height: 120px;
		max-height: 120px;
		padding: 15px 20px;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 12px;
		background: rgb(255 255 255 / 95%);
		border-radius: 12px;
		box-shadow: 0 4px 16px rgb(0 0 0 / 20%);
		transform: translateX(-50%);
		scroll-snap-type: x proximity;
	}

	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail {
		flex-shrink: 0;
		width: 90px;
		min-width: 90px;
		height: 90px;
		min-height: 90px;
		overflow: hidden;
		border-radius: 6px;
		scroll-snap-align: center;
	}

	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail:hover {
		transform: scale(1.08);
	}

	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail.active {
		transform: scale(1.15);
	}
}

@media (max-width: 768px) {
	.ella-gallery-lightbox-thumbnails {
		top: 50%;
		left: 15px;
		display: flex;
		align-items: center;
		justify-content: flex-start;
		flex-direction: column;
		box-sizing: border-box;
		width: 76px;
		min-width: 76px;
		max-width: 76px;
		height: auto;
		min-height: 200px;
		max-height: calc(100vh - 40px);
		padding: 10px 6px;
		overflow-x: hidden !important;
		overflow-y: auto;
		gap: 10px;
		border-radius: 12px;
		box-shadow: 0 4px 16px rgb(0 0 0 / 20%);
		transform: translateY(-50%);
		scroll-snap-type: y proximity;
	}

	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail {
		position: relative;
		display: block;
		contain: layout style paint;
		flex-shrink: 0;
		width: 64px;
		min-width: 64px;
		max-width: 64px;
		height: 64px;
		min-height: 64px;
		max-height: 64px;
		overflow: hidden;
		border-radius: 6px;
		scroll-snap-align: center;
	}

	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail:hover {
		transform: scale(1.08);
	}

	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail.active {
		transform: scale(1.15);
	}

	.ella-gallery-lightbox-thumbnail img {
		width: 100% !important;
		min-width: 100% !important;
		max-width: 100% !important;
		height: 100% !important;
		min-height: 100% !important;
		max-height: 100% !important;
		border-radius: 4px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.woocommerce-product-gallery.flexslider,
	.woocommerce-product-gallery .flexslider,
	.woocommerce-product-gallery .flexslider .slides,
	.woocommerce-product-gallery .flexslider .slides > li,
	.woocommerce-product-gallery__wrapper,
	.woocommerce-product-gallery .flex-viewport,
	.woocommerce-product-gallery__image,
	.ella-gallery-arrow,
	.ella-gallery-lightbox-overlay,
	.ella-gallery-lightbox-image,
	.ella-gallery-lightbox-thumbnail {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
	}
}

@media (forced-colors: active) {
	.ella-gallery-arrow,
	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-close,
	.ella-gallery-lightbox-overlay .ella-gallery-lightbox-thumbnail.active {
		border: 2px solid ButtonText !important;
	}
}
