/**
 * Instagram-style single product gallery (600×800 viewport, arrows, dot pagination).
 */

.kaveh-instagram-gallery {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	background: transparent;
	direction: ltr;
}

.kaveh-instagram-gallery__outer {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	background: transparent;
	direction: ltr;
}

.kaveh-instagram-gallery__arrow--prev {
	order: 1;
}

.kaveh-instagram-gallery__frame {
	order: 2;
	width: 600px;
	max-width: 100%;
	height: 800px;
	max-height: min(800px, calc(100vw * 1.333333));
	overflow: hidden;
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	flex-shrink: 0;
}

.kaveh-instagram-gallery__arrow--next {
	order: 3;
}

.kaveh-instagram-gallery__swiper,
.kaveh-instagram-gallery__swiper .swiper-wrapper,
.kaveh-instagram-gallery__swiper .swiper-slide {
	width: 100%;
	height: 100%;
	background: transparent;
}

.kaveh-instagram-gallery__swiper .swiper-slide.kaveh-instagram-gallery__slide--png {
	background-color: #d2b48c;
}

.kaveh-instagram-gallery__swiper .swiper-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	background: transparent;
}

.kaveh-instagram-gallery__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.kaveh-instagram-gallery__arrow::after {
	content: none !important;
	display: none !important;
}

.kaveh-instagram-gallery__arrow:hover {
	background: rgba(0, 0, 0, 0.85);
}

.kaveh-instagram-gallery__arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.kaveh-instagram-gallery__arrow-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	line-height: 1;
}

.kaveh-instagram-gallery__arrow-svg {
	display: block;
	width: 20px;
	height: 20px;
}

.kaveh-instagram-gallery__dots {
	position: static !important;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
	width: auto !important;
}

.kaveh-instagram-gallery__dots .swiper-pagination-bullet {
	width: 10px;
	height: 10px;
	margin: 0 !important;
	opacity: 1;
	background: #000;
	border-radius: 50%;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.kaveh-instagram-gallery__dots .swiper-pagination-bullet-active {
	transform: scale(1.15);
	opacity: 1;
}

.kaveh-instagram-gallery__dots .swiper-pagination-bullet:not(.swiper-pagination-bullet-active) {
	opacity: 0.35;
}

/* Keep action icons positioned over the gallery in existing layouts. */
.single-product .gallery-image.position-relative > .kaveh-instagram-gallery,
.single-product .gallery.position-relative > .kaveh-instagram-gallery,
.single-product .detail-product-four-gallery-origin > .kaveh-instagram-gallery {
	width: 100%;
}

/* Remove legacy theme frame/background on gallery wrappers. */
.single-product .gallery-image:has(> .kaveh-instagram-gallery),
.single-product .gallery:has(> .kaveh-instagram-gallery),
.single-product .detail-product-four-gallery-origin:has(> .kaveh-instagram-gallery),
.single-product .detail-product-five__gallery__origin:has(> .kaveh-instagram-gallery),
.single-product .detail-product-six__info__gallery:has(> .kaveh-instagram-gallery) {
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
}

@media (max-width: 767.98px) {
	.kaveh-instagram-gallery__outer {
		gap: 8px;
	}

	.kaveh-instagram-gallery__frame {
		height: auto;
		aspect-ratio: 3 / 4;
		max-height: none;
	}

	.kaveh-instagram-gallery__arrow {
		width: 34px;
		height: 34px;
	}
}
