/* Hide the previous child-theme and WooCommerce hover magnifier layers. */
.single-product .phium-image-zoom-panel,
.single-product .woocommerce-product-gallery .zoomImg {
	display: none !important;
	opacity: 0 !important;
	pointer-events: none !important;
	visibility: hidden !important;
}

.single-product .woocommerce-product-gallery .flexy-items .ct-media-container {
	cursor: pointer !important;
}

/* PHIUM product media is square. Override Blocksy's inline 3:4 crop. */
.single-product .woocommerce-product-gallery .ct-media-container {
	aspect-ratio: 1 / 1 !important;
}

.single-product .woocommerce-product-gallery .ct-media-container > img {
	aspect-ratio: 1 / 1 !important;
	height: 100% !important;
	object-fit: contain !important;
	object-position: center !important;
	width: 100% !important;
}

body.phium-product-lightbox-open {
	overflow: hidden;
}

.phium-product-lightbox {
	background: rgba(20, 15, 13, 0.96);
	border: 0;
	color: #fff;
	height: 100dvh;
	inset: 0;
	margin: 0;
	max-height: none;
	max-width: none;
	padding: 0;
	position: fixed;
	width: 100vw;
}

.phium-product-lightbox:not([open]) {
	display: none;
}

.phium-product-lightbox::backdrop {
	background: rgba(20, 15, 13, 0.96);
}

.phium-product-lightbox__shell {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	height: 100%;
	width: 100%;
}

.phium-product-lightbox__topbar {
	align-items: center;
	display: flex;
	justify-content: space-between;
	min-height: 64px;
	padding: 0.5rem clamp(1rem, 3vw, 2rem);
}

.phium-product-lightbox__counter {
	font-family: Poppins, sans-serif;
	font-size: 0.82rem;
	letter-spacing: 0.08em;
	margin: 0;
}

.phium-product-lightbox__close,
.phium-product-lightbox__arrow {
	align-items: center;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	justify-content: center;
	padding: 0;
	transition: background-color 180ms ease, transform 180ms ease;
}

.phium-product-lightbox__close {
	font-size: 2rem;
	height: 44px;
	line-height: 1;
	width: 44px;
}

.phium-product-lightbox__arrow {
	font-size: 1.35rem;
	height: 48px;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	z-index: 2;
}

.phium-product-lightbox__close:hover,
.phium-product-lightbox__close:focus-visible,
.phium-product-lightbox__arrow:hover,
.phium-product-lightbox__arrow:focus-visible {
	background: #c28b68;
	border-color: #c28b68;
}

.phium-product-lightbox__close:focus-visible,
.phium-product-lightbox__arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.phium-product-lightbox__stage {
	align-items: center;
	display: flex;
	justify-content: center;
	min-height: 0;
	padding: 0.5rem clamp(4rem, 9vw, 7.5rem) 1.5rem;
	position: relative;
}

.phium-product-lightbox__figure {
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: center;
	margin: 0;
	max-width: min(90vw, 1400px);
	min-height: 0;
}

.phium-product-lightbox__image {
	display: block;
	max-height: calc(100dvh - 125px);
	max-width: 100%;
	object-fit: contain;
	width: auto;
}

.phium-product-lightbox__caption {
	color: rgba(255, 255, 255, 0.9);
	font-family: Poppins, sans-serif;
	font-size: 0.82rem;
	margin-top: 0.65rem;
	min-height: 1.25em;
	text-align: center;
}

.phium-product-lightbox__arrow--previous {
	left: clamp(0.75rem, 3vw, 2rem);
}

.phium-product-lightbox__arrow--next {
	right: clamp(0.75rem, 3vw, 2rem);
}

.phium-product-lightbox__arrow[hidden] {
	display: none;
}

@media (max-width: 640px) {
	.phium-product-lightbox__stage {
		padding: 0 0.75rem 1rem;
	}

	.phium-product-lightbox__figure {
		max-width: 100%;
	}

	.phium-product-lightbox__image {
		max-height: calc(100dvh - 115px);
	}

	.phium-product-lightbox__arrow {
		background: rgba(140, 90, 61, 0.92);
		height: 42px;
		width: 42px;
	}

	.phium-product-lightbox__arrow--previous {
		left: 0.75rem;
	}

	.phium-product-lightbox__arrow--next {
		right: 0.75rem;
	}

	.phium-product-lightbox__caption {
		padding: 0 3.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.phium-product-lightbox__close,
	.phium-product-lightbox__arrow {
		transition: none;
	}
}
