.efp-product-gallery {
	--efp-pg-thumb-size: 56px;
	--efp-pg-thumb-gap: 12px;
	display: grid;
	grid-template-columns: var(--efp-pg-thumb-size) minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	width: 100%;
}

.efp-product-gallery--bottom {
	display: flex;
	flex-direction: column-reverse;
	gap: 12px;
}

.efp-pg-thumb-carousel {
	position: relative;
	min-width: 0;
}

.efp-pg-thumbnails {
	display: flex;
	gap: var(--efp-pg-thumb-gap);
	min-width: 0;
	min-height: 0;
	overscroll-behavior: contain;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.efp-pg-thumbnails::-webkit-scrollbar {
	display: none;
}

.efp-product-gallery--left .efp-pg-thumb-carousel {
	width: var(--efp-pg-thumb-size);
	padding: 34px 0;
	box-sizing: border-box;
}

.efp-product-gallery--left .efp-pg-thumbnails {
	flex-direction: column;
	max-height: calc((var(--efp-pg-thumb-size) * 6) + (var(--efp-pg-thumb-gap) * 5));
	height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
}

.efp-product-gallery--bottom .efp-pg-thumb-carousel {
	width: 100%;
	padding: 0 34px;
	box-sizing: border-box;
}

.efp-product-gallery--bottom .efp-pg-thumbnails {
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
}

.efp-pg-thumb-nav {
	appearance: none;
	position: absolute;
	z-index: 2;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #231f1a;
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 3px 10px rgba(0,0,0,.14);
	font-size: 12px;
	line-height: 1;
	padding: 0;
	transition: transform .2s ease, opacity .2s ease;
}

.efp-pg-thumb-nav:hover {
	transform: scale(1.05);
}

.efp-pg-thumb-nav:disabled {
	opacity: .35;
	cursor: default;
	transform: none;
}

.efp-product-gallery--left .efp-pg-thumb-prev {
	top: 2px;
	left: 50%;
	transform: translateX(-50%) rotate(90deg);
}

.efp-product-gallery--left .efp-pg-thumb-next {
	bottom: 2px;
	left: 50%;
	transform: translateX(-50%) rotate(90deg);
}

.efp-product-gallery--left .efp-pg-thumb-prev:hover,
.efp-product-gallery--left .efp-pg-thumb-next:hover {
	transform: translateX(-50%) rotate(90deg) scale(1.05);
}

.efp-product-gallery--bottom .efp-pg-thumb-prev {
	left: 2px;
	top: 50%;
	transform: translateY(-50%);
}

.efp-product-gallery--bottom .efp-pg-thumb-next {
	right: 2px;
	top: 50%;
	transform: translateY(-50%);
}

.efp-product-gallery--bottom .efp-pg-thumb-prev:hover,
.efp-product-gallery--bottom .efp-pg-thumb-next:hover {
	transform: translateY(-50%) scale(1.05);
}

.efp-pg-thumb {
	appearance: none;
	border: 1px solid transparent;
	padding: 0;
	margin: 0;
	background: transparent;
	border-radius: 8px;
	width: var(--efp-pg-thumb-size);
	height: var(--efp-pg-thumb-size);
	flex: 0 0 var(--efp-pg-thumb-size);
	overflow: hidden;
	cursor: pointer;
	transition: border-color .2s ease, opacity .2s ease, transform .2s ease;
}

.efp-pg-thumb:hover {
	opacity: .9;
}

.efp-pg-thumb.is-active {
	border-color: #a5271f;
}

.efp-pg-thumb img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	background: #f4f1ea;
}

.efp-pg-main-wrap {
	min-width: 0;
}

.efp-pg-main {
	position: relative;
	width: 100%;
	aspect-ratio: var(--efp-pg-ratio, 1.03);
	border-radius: 22px;
	overflow: hidden;
	background: #f4f0e8;
}

.efp-pg-main-image {
	width: 100% !important;
	height: 100% !important;
	display: block;
	object-fit: var(--efp-pg-object-fit, cover);
	transition: opacity .2s ease, transform .35s ease;
}

.efp-pg-main-image.is-changing {
	opacity: .35;
}

.efp-pg-zoom {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #231f1a;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,.10);
	padding: 0;
	z-index: 2;
}

.efp-pg-zoom:hover {
	transform: scale(1.04);
}

/* Zoom lightbox with a scrollable gallery rail. */
.efp-pg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(20,18,16,.94);
	padding: 54px 64px 34px;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	box-sizing: border-box;
}

.efp-pg-lightbox[hidden] {
	display: none;
}

.efp-pg-lightbox-shell {
	min-height: 0;
	height: min(84vh, 900px);
	max-width: 1500px;
	width: 100%;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	gap: 22px;
}

.efp-pg-lightbox-rail {
	min-height: 0;
	display: grid;
	grid-template-rows: 36px minmax(0, 1fr) 36px;
	gap: 8px;
}

.efp-pg-lightbox-thumbs {
	min-height: 0;
	overflow-y: hidden;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 2px 4px 2px 2px;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.efp-pg-lightbox-thumbs::-webkit-scrollbar {
	display: none;
}

.efp-pg-lightbox-rail-btn {
	appearance: none;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #231f1a;
	width: 36px;
	height: 36px;
	margin: 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 5px 16px rgba(0,0,0,.16);
	font-size: 14px;
	line-height: 1;
	padding: 0;
}

.efp-pg-lightbox-rail-btn:hover {
	transform: scale(1.04);
}

@media (min-width: 768px) {
	.efp-pg-lightbox-rail-prev,
	.efp-pg-lightbox-rail-next {
		position: relative;
	}
}

.efp-pg-lightbox-thumb {
	appearance: none;
	border: 2px solid transparent;
	padding: 0;
	margin: 0;
	background: rgba(255,255,255,.08);
	border-radius: 8px;
	width: 80px;
	height: 80px;
	flex: 0 0 80px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color .2s ease, opacity .2s ease, transform .2s ease;
}

.efp-pg-lightbox-thumb:hover {
	transform: translateY(-1px);
}

.efp-pg-lightbox-thumb.is-active {
	border-color: #fff;
}

.efp-pg-lightbox-thumb img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.efp-pg-lightbox-stage {
	position: relative;
	min-width: 0;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.efp-pg-lightbox-image-wrap {
	width: 100%;
	height: 100%;
	overflow: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	box-sizing: border-box;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}

.efp-pg-lightbox-image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	user-select: none;
	-webkit-user-drag: none;
	transition: opacity .2s ease;
}

.efp-pg-lightbox-image.is-loading {
	opacity: .45;
}

.efp-pg-lightbox-nav {
	padding: 0;
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #231f1a;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.efp-pg-lightbox-nav:hover {
	transform: translateY(-50%) scale(1.04);
}

.efp-pg-lightbox-prev {
	left: 14px;
}

.efp-pg-lightbox-next {
	right: 14px;
}

.efp-pg-lightbox-close {
	padding: 0;
	position: absolute;
	top: 16px;
	right: 18px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #231f1a;
	font-size: 29px;
	line-height: 1;
	cursor: pointer;
	z-index: 5;
}

.efp-pg-lightbox-counter {
	min-height: 24px;
	padding-top: 10px;
	text-align: center;
	color: #fff;
	font-size: 14px;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
}

.efp-pg-empty {
	padding: 20px;
	border: 1px dashed #ccc;
	background: #f8f8f8;
	text-align: center;
}

@media (max-width: 767px) {
	.efp-product-gallery--left {
		grid-template-columns: 1fr;
	}

	.efp-product-gallery--left .efp-pg-thumb-carousel {
		order: 2;
		width: 100%;
		padding: 0 34px;
	}

	.efp-product-gallery--left .efp-pg-thumbnails {
		flex-direction: row;
		max-height: none;
		height: auto;
		overflow-x: auto;
		overflow-y: hidden;
		width: 100%;
	}

	.efp-product-gallery--left .efp-pg-thumb-prev {
		top: 50%;
		left: 2px;
		transform: translateY(-50%);
	}

	.efp-product-gallery--left .efp-pg-thumb-next {
		top: 50%;
		bottom: auto;
		right: 2px;
		left: auto;
		transform: translateY(-50%);
	}

	.efp-product-gallery--left .efp-pg-thumb-prev:hover,
	.efp-product-gallery--left .efp-pg-thumb-next:hover {
		transform: translateY(-50%) scale(1.05);
	}

	.efp-product-gallery--left .efp-pg-main-wrap {
		order: 1;
	}

	.efp-pg-lightbox {
		padding: 56px 12px 18px;
	}

	.efp-pg-lightbox-shell {
		height: auto;
		max-height: calc(100vh - 112px);
		display: flex;
		flex-direction: column;
		gap: 12px;
	}

	.efp-pg-lightbox-stage {
		order: 1;
	}

	.efp-pg-lightbox-rail {
		order: 2;
		width: 100%;
		height: 78px;
		flex: 0 0 78px;
		display: grid;
		grid-template-columns: 30px minmax(0, 1fr) 30px;
		grid-template-rows: 1fr;
		gap: 6px;
		align-items: center;
	}

	.efp-pg-lightbox-thumbs {
		width: 100%;
		height: 78px;
		flex: 0 0 78px;
		flex-direction: row;
		overflow-x: hidden;
		overflow-y: hidden;
		padding: 2px;
	}

	.efp-pg-lightbox-rail-btn {
		width: 30px;
		height: 30px;
		font-size: 12px;
	}

	.efp-pg-lightbox-rail-prev {
		transform: rotate(-90deg);
	}

	.efp-pg-lightbox-rail-next {
		transform: rotate(-90deg);
	}

	.efp-pg-lightbox-thumb {
		width: 68px;
		height: 68px;
		flex-basis: 68px;
	}

	.efp-pg-lightbox-stage {
		min-height: 0;
		height: calc(100vh - 210px);
	}

	.efp-pg-lightbox-image-wrap {
		padding: 0 44px;
	}

	.efp-pg-lightbox-nav {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}

	.efp-pg-lightbox-prev {
		left: 2px;
	}

	.efp-pg-lightbox-next {
		right: 2px;
	}
}
