/* ==========================================================================
   Essential Product Gallery — Frontend Styles
   ========================================================================== */

.epg-gallery-wrapper {
	--epg-thumb-width: 78px;
	--epg-thumb-radius: 12px;
	--epg-thumb-gap: 14px;
	--epg-main-radius: 16px;
	--epg-main-bg: #f3f3f3;
	--epg-thumb-bg: #ffffff;
	--epg-border-color: #e4e4e4;
	--epg-active-border: #000000;
	--epg-icon-color: #1a1a1a;
	--epg-icon-bg: #ffffff;

	display: flex;
	align-items: flex-start;
	gap: 20px;
	width: 100%;
	box-sizing: border-box;
}

.epg-gallery-wrapper * {
	box-sizing: border-box;
}

.epg-gallery-wrapper img {
	max-width: 100%;
	display: block;
}

/* ---------------------------------------------------------------------- */
/* THUMBNAIL COLUMN                                                        */
/* ---------------------------------------------------------------------- */

.epg-thumbs-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
	width: var(--epg-thumb-width);
}

.epg-thumbs-list {
	display: flex;
	flex-direction: column;
	gap: var(--epg-thumb-gap);
	overflow-y: auto;
	scroll-behavior: smooth;
	max-height: 520px;
	width: 100%;
	padding: 2px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.epg-thumbs-list::-webkit-scrollbar {
	display: none;
}

.epg-thumb-item {
	position: relative;
	flex: 0 0 auto;
	width: var(--epg-thumb-width);
	height: var(--epg-thumb-width);
	border-radius: var(--epg-thumb-radius);
	border: 2px solid var(--epg-border-color);
	background-color: var(--epg-thumb-bg);
	overflow: hidden;
	cursor: pointer;
	padding: 0;
	transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
	will-change: transform;
}

.epg-thumb-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.epg-thumb-item.is-active {
	border-color: var(--epg-active-border);
}

.epg-thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.epg-thumb-nav {
	display: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 24px;
	border: none;
	background: transparent;
	color: #444;
	cursor: pointer;
	flex-shrink: 0;
	transition: color 0.2s ease;
}

.epg-thumb-nav:hover {
	color: #000;
}

.epg-thumbs-col.has-overflow .epg-thumb-nav {
	display: flex;
}

/* ---------------------------------------------------------------------- */
/* MAIN IMAGE                                                              */
/* ---------------------------------------------------------------------- */

.epg-main-col {
	flex: 1 1 auto;
	min-width: 0;
}

.epg-main-stage {
	position: relative;
	width: 100%;
	height: 520px;
	background-color: var(--epg-main-bg);
	border-radius: var(--epg-main-radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.epg-main-image-track {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.epg-main-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	opacity: 0;
	transform: scale(0.98);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}

.epg-main-image.is-active {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

.epg-zoom-btn {
	position: absolute;
	right: 18px;
	bottom: 18px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background-color: var(--epg-icon-bg);
	color: var(--epg-icon-color);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	z-index: 3;
}

.epg-zoom-btn:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ---------------------------------------------------------------------- */
/* LIGHTBOX                                                                */
/* ---------------------------------------------------------------------- */

.epg-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 10, 0.95);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.epg-lightbox.is-open {
	display: flex;
	opacity: 1;
}

.epg-lightbox-stage {
	width: 90vw;
	height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.epg-lightbox-image {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 8px;
	user-select: none;
}

.epg-lightbox-close,
.epg-lightbox-prev,
.epg-lightbox-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #fff;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.epg-lightbox-close:hover,
.epg-lightbox-prev:hover,
.epg-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.25);
}

.epg-lightbox-close {
	top: 24px;
	right: 24px;
}

.epg-lightbox-prev {
	left: 24px;
	top: 50%;
	transform: translateY(-50%);
}

.epg-lightbox-next {
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
}

/* ---------------------------------------------------------------------- */
/* PLACEHOLDER (editor / empty states)                                    */
/* ---------------------------------------------------------------------- */

.epg-placeholder {
	padding: 40px;
	text-align: center;
	background: #f7f7f7;
	border: 1px dashed #ccc;
	border-radius: 12px;
	color: #777;
	font-size: 14px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
	.epg-main-stage {
		height: 420px;
	}
	.epg-thumbs-list {
		max-height: 420px;
	}
}

/* Mobile: thumbnails move below main image, horizontal scroll */
@media (max-width: 767px) {

	.epg-gallery-wrapper {
		flex-direction: column;
	}

	.epg-gallery-wrapper.epg-thumbs-bottom {
		flex-direction: column-reverse;
	}

	.epg-main-col {
		width: 100%;
		order: 1;
	}

	.epg-main-stage {
		height: 320px;
	}

	.epg-thumbs-col {
		width: 100%;
		flex-direction: row;
		order: 2;
	}

	.epg-thumbs-list {
		flex-direction: row;
		max-height: none;
		overflow-x: auto;
		overflow-y: hidden;
		width: 100%;
		padding: 6px 2px;
	}

	.epg-thumb-item {
		width: 64px;
		height: 64px;
	}

	.epg-thumb-nav {
		display: none !important;
	}

	.epg-lightbox-prev,
	.epg-lightbox-next {
		width: 40px;
		height: 40px;
	}
}
