/**
 * WoodMart 8.5.1 single-product gallery behavior adapted to Glozin markup.
 * Glozin's own Swiper arrows are intentionally left untouched.
 */

@font-face {
	font-family: "woodmart-font";
	src: url("../fonts/woodmart-font.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: block;
}

html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery {
	position: relative !important;
	top: 0 !important;
}

html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery > .glozin-button--product-lightbox {
	display: none !important;
}

html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery .woocommerce-product-gallery__wrapper {
	position: relative !important;
}

html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery .woocommerce-product-gallery__image {
	position: relative;
	overflow: hidden;
}

html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery .woocommerce-product-gallery__image .zoomImg {
	display: block !important;
	max-width: none !important;
	max-height: none !important;
	z-index: 2;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery .woocommerce-product-gallery__image.gz-woodmart-touch-zoom-active .zoomImg {
	opacity: 1 !important;
}

.product-additional-galleries {
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	z-index: 6;
	display: flex;
	align-items: flex-start;
	flex-direction: column;
	gap: 10px;
	padding: 15px;
	transition: all 0.3s ease;
}

.wd-action-btn.wd-style-icon-bg-text {
	--wd-action-icon-size: 18px;
	--wd-action-h: calc(var(--wd-action-icon-size) * 2.8);
	--wd-action-w: calc(var(--wd-action-icon-size) * 2.8);
	--wd-action-color: #666;
	--wd-action-color-hover: #333;
}

.wd-action-btn.wd-style-icon-bg-text > a {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: nowrap;
	overflow: hidden;
	gap: 0;
	min-width: var(--wd-action-w);
	width: unset;
	height: var(--wd-action-h);
	border-radius: calc(var(--wd-action-h) / 2);
	background-color: #fff;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.08);
	color: var(--wd-action-color);
	text-decoration: none;
	touch-action: manipulation;
}

.wd-action-btn.wd-style-icon-bg-text .wd-action-icon {
	position: relative;
	display: flex;
	flex: 0 0 var(--wd-action-w);
	align-items: center;
	justify-content: center;
	width: var(--wd-action-w);
	height: var(--wd-action-h);
}

.wd-action-btn.wd-style-icon-bg-text .wd-action-icon::before {
	content: var(--wd-btn-icon);
	font-family: "woodmart-font";
	font-weight: 400;
	font-size: var(--wd-action-icon-size);
	line-height: 1;
}

.wd-action-btn.wd-style-icon-bg-text .wd-action-text {
	display: inline-block;
	max-width: 0;
	overflow: hidden;
	padding-inline-end: 0;
	color: var(--wd-action-color);
	white-space: nowrap;
	font-size: 0.9em;
	line-height: var(--wd-action-h);
	transition: max-width 0.25s ease, padding-inline-end 0.25s ease, color 0.25s ease;
}

.wd-show-product-gallery-wrap {
	--wd-btn-icon: "\f127";
}

@media (hover: hover) and (pointer: fine) {
	.wd-action-btn.wd-style-icon-bg-text > a:hover .wd-action-text {
		padding-inline-end: calc(var(--wd-action-w) / 2);
		max-width: 280px;
	}

	.wd-action-btn.wd-style-icon-bg-text > a:hover .wd-action-icon::before,
	.wd-action-btn.wd-style-icon-bg-text > a:hover .wd-action-text {
		color: var(--wd-action-color-hover);
	}
}

.wd-action-btn.wd-style-icon-bg-text > a:focus-visible {
	outline: 2px dotted #111;
	outline-offset: -2px;
}

.wd-action-btn.wd-style-icon-bg-text > a:focus-visible .wd-action-text {
	padding-inline-end: calc(var(--wd-action-w) / 2);
	max-width: 280px;
}

/* WoodMart places single-product labels in the gallery's top-right corner. */
html body.single-product div.product .woocommerce-product-gallery .woocommerce-badges--single.gz-single-gallery-badge {
	position: absolute !important;
	top: 15px !important;
	inset-inline-start: auto !important;
	inset-inline-end: 15px !important;
	z-index: 8 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: flex-end !important;
	width: auto !important;
	margin: 0 !important;
	pointer-events: none !important;
}

/* WoodMart sticky-details behavior: the gallery follows the longer summary. */
@media (min-width: 1025px) {
	html body.single-product div.product:not(.product-quickview) .product-gallery-summary {
		align-items: flex-start !important;
	}

	html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery {
		position: sticky !important;
		top: var(--gz-woodmart-gallery-sticky-top, 0px) !important;
		align-self: flex-start !important;
	}

	html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery.image-action-zoom .woocommerce-product-gallery__image > a {
		cursor: default;
		pointer-events: none;
	}

	html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery .woocommerce-product-gallery__image {
		cursor: zoom-in !important;
	}
}

@media (max-width: 1024px) {
	.wd-action-btn.wd-style-icon-bg-text {
		--wd-action-icon-size: 16px;
	}

	html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery.gz-woodmart-product-gallery .woocommerce-product-gallery__image > a {
		touch-action: manipulation;
	}
}

@media (max-width: 576px) {
	.product-additional-galleries {
		padding: 10px;
	}

	html body.single-product div.product .woocommerce-product-gallery .woocommerce-badges--single.gz-single-gallery-badge {
		top: 10px !important;
		inset-inline-end: 10px !important;
	}
}

/* Restore WoodMart's native PhotoSwipe v4 full-view presentation. */
html body.single-product .pswp {
	opacity: 1 !important;
	transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1), visibility 0s linear 0s !important;
}

html body.single-product .pswp__bg,
html body.single-product .pswp--open .pswp__bg,
html body.single-product .pswp.gz-pswp-opening .pswp__bg,
html body.single-product .pswp.gz-pswp-closing .pswp__bg {
	background: #000 !important;
	background-image: none !important;
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
	animation: none !important;
	transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1) !important;
}

html body.single-product .pswp.gz-pswp-opening .pswp__scroll-wrap,
html body.single-product .pswp.gz-pswp-closing .pswp__scroll-wrap,
html body.single-product .pswp.gz-pswp-opening .pswp__ui,
html body.single-product .pswp.gz-pswp-closing .pswp__ui,
html body.single-product .pswp.gz-pswp-opening .pswp__button,
html body.single-product .pswp.gz-pswp-closing .pswp__button,
html body.single-product .pswp.gz-pswp-opening .pswp__counter,
html body.single-product .pswp.gz-pswp-closing .pswp__counter {
	animation: none !important;
}

html body.single-product .pswp__scroll-wrap {
	background: transparent !important;
}

@media (prefers-reduced-motion: reduce) {
	.wd-action-btn.wd-style-icon-bg-text .wd-action-text,
	html body.single-product .pswp,
	html body.single-product .pswp__bg,
	html body.single-product div.product:not(.product-quickview) .woocommerce-product-gallery .zoomImg {
		transition-duration: 0.01ms !important;
	}
}
