/* Product Gallery for Elementor - Attach image style */

/* WooCommerce default product gallery / Elementor Product Images block hide jokhon PGE widget ache */
body:has(.pge-product-gallery) .woocommerce-product-gallery,
body:has(.pge-product-gallery) .woocommerce-product-gallery__wrapper,
body:has(.pge-product-gallery) .elementor-widget-woocommerce-product-images {
	display: none !important;
}

/* Duplicate gallery hide – page e 2+ thakle sirf prothom ta (JS theke .pge-duplicate-hidden add hoy) */
.pge-product-gallery.pge-duplicate-hidden {
	display: none !important;
}

/* Sticky column: overflow + width lock – image right e na jai, double na ase */
.elementor-widget-pge_product_gallery,
.elementor-widget-pge_product_gallery .elementor-widget-container {
	min-height: 0;
	overflow: hidden;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.pge-product-gallery {
	contain: layout style paint;
	min-height: 0;
	overflow: hidden;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	--pge-radius: 12px;
	--pge-thumb-gap: 10px;
	--pge-arrow-size: 44px;
	--pge-counter-height: 32px;
}

.pge-product-gallery .pge-no-product,
.pge-product-gallery .pge-no-images {
	padding: 20px;
	background: #f5f5f5;
	border-radius: var(--pge-radius);
	text-align: center;
	color: #666;
	margin: 0;
}

/* Main image area – sticky e right e overflow + double theke bachanor jonno strict contain */
.pge-main-wrap {
	position: relative;
	width: 100%;
	max-width: 100%;
	border-radius: var(--pge-radius);
	overflow: hidden;
	background: #f0f0f0;
	aspect-ratio: 4 / 3;
	min-height: 200px;
	isolation: isolate;
	transform: translateZ(0);
	backface-visibility: hidden;
	box-sizing: border-box;
}

.pge-main-inner {
	position: relative;
	width: 100%;
	height: 100%;
	max-width: 100%;
	overflow: hidden;
	isolation: isolate;
	box-sizing: border-box;
}

.pge-main-slides {
	position: relative;
	width: 100%;
	max-width: 100%;
	height: 100%;
	overflow: hidden;
	left: 0;
	top: 0;
	box-sizing: border-box;
}

/* Slide sob ek-i jaigay overlap – left theke, right e kichu berobe na (sticky fix) */
.pge-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	pointer-events: none;
	z-index: 0;
	box-sizing: border-box;
}

.pge-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
	pointer-events: auto;
}

.pge-slide:not(.is-active) {
	top: 0;
	left: 0;
	right: auto;
	bottom: auto;
	width: 100%;
	height: 100%;
}

.pge-slide img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	border-radius: var(--pge-radius);
	box-sizing: border-box;
}

/* Arrows - left/right, white circles */
.pge-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: var(--pge-arrow-size);
	height: var(--pge-arrow-size);
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #1a1a1a;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pge-arrow:hover {
	transform: translateY(-50%) scale(1.05);
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pge-arrow-prev {
	left: 14px;
}

.pge-arrow-next {
	right: 14px;
}

.pge-arrow svg {
	flex: 0 0 auto;
}

/* Image counter - bottom center, dark rounded */
.pge-counter {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	padding: 6px 14px;
	height: var(--pge-counter-height);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	border-radius: 8px;
	line-height: 1;
}

.pge-counter .pge-current {
	font-weight: 600;
}

/* Thumbnail strip */
.pge-thumbs {
	display: flex;
	gap: var(--pge-thumb-gap);
	margin-top: 14px;
	flex-wrap: nowrap;
	overflow-x: auto;
	padding-bottom: 4px;
	scrollbar-width: thin;
}

.pge-thumbs::-webkit-scrollbar {
	height: 6px;
}

.pge-thumbs::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

.pge-thumb {
	flex: 0 0 auto;
	width: 80px;
	height: 80px;
	padding: 0;
	margin-top:5px;
	padding-left: 5px;
    padding-right: 5px;
    margin-left:3px;
	border: 0px solid transparent;
	border-radius: var(--pge-radius);
	overflow: hidden;
	background: #f0f0f0 !important;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pge-thumb:hover {
	border-color: rgba(0, 0, 0, 0.3);
}

.pge-thumb.is-active {
	box-shadow: 0 0 0 2px #cdcfd1;
}

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

/* Responsive */
@media (max-width: 767px) {
	.pge-main-wrap {
		aspect-ratio: 1;
	}
	.pge-arrow {
		width: 38px;
		height: 38px;
	}
	.pge-thumb {
		width: 64px;
		height: 64px;
	}
}