/* ==== MARVIT SWIPER GALLERY V4.0.0 - ELEMENTOR ==== */
/* INSTRUÇÕES: Substitua .elementor-widget-woocommerce-product-images pelo seletor real do seu widget */
/* Exemplo: .elementor-element-1a2b3c4d ou o ID específico do seu widget */

/* ESCONDER GALERIA ORIGINAL DO WOOCOMMERCE */
.elementor-widget-woocommerce-product-images
	.woocommerce-product-gallery:not(.marvit-swiper-gallery)
	.woocommerce-product-gallery__wrapper {
	display: none !important;
}

/* ESCONDER ELEMENTOS SPACER DO ELEMENTOR STICKY */
.elementor-widget-woocommerce-product-images.elementor-sticky__spacer {
	display: none !important;
}

/* SELETOR ESPECÍFICO - SUBSTITUA PELO SEU ID DE ELEMENTO */
/* .elementor-element-SEU-ID-AQUI .woocommerce-product-gallery:not(.marvit-swiper-gallery) .woocommerce-product-gallery__wrapper {
    display: none !important;
} */

/* Container principal do Swiper */
.elementor-widget-woocommerce-product-images .marvit-swiper-gallery {
	position: relative;
	max-width: 100%;
	background: #f3f3f3;
	border: 1px solid #e1e1e1;
	border-radius: 12px;
	padding: 16px;
	overflow: visible;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* ==== GALERIA PRINCIPAL ==== */
.elementor-widget-woocommerce-product-images .main-gallery-wrapper {
	position: relative;
	margin-bottom: 12px;
}

.elementor-widget-woocommerce-product-images .marvit-main-swiper {
	width: 100% !important;
	height: 455px;
	border-radius: 10px;
	overflow: hidden;
	background: #f2f2f2;
	border: 1px solid #e2e2e2;
	display: block !important;
	visibility: visible !important;
}

.elementor-widget-woocommerce-product-images .marvit-main-swiper .swiper-slide {
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: #f2f2f2;
	padding: 14px;
	visibility: visible !important;
	opacity: 1 !important;
}

.elementor-widget-woocommerce-product-images
	.marvit-main-swiper
	.image-container {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.elementor-widget-woocommerce-product-images .marvit-main-swiper img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	cursor: zoom-in;
	transition: transform 0.3s ease;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.elementor-widget-woocommerce-product-images
	.marvit-main-swiper
	.swiper-zoom-container {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ==== GALERIA DE THUMBNAILS ==== */
.elementor-widget-woocommerce-product-images .thumbs-gallery-wrapper {
	position: relative;
	height: auto;
	min-height: 98px;
	background: #ededed;
	border: 1px solid #e1e1e1;
	border-radius: 10px;
	padding: 10px 14px;
	overflow: hidden;
	margin-top: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.elementor-widget-woocommerce-product-images .marvit-thumbs-swiper {
	height: 72px !important;
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	overflow: hidden !important;
}

.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-slide {
	width: 72px !important;
	height: 72px !important;
	margin-right: 10px;
	flex-shrink: 0;
	display: flex !important;
	align-items: center;
	justify-content: center;
}

.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-wrapper {
	align-items: center !important;
	display: flex !important;
}

/* Força configurações de tamanho para sobrescrever cálculos automáticos do Swiper */
.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-slide[style] {
	width: 72px !important;
	margin-right: 10px !important;
}
.elementor-widget-woocommerce-product-images .thumb-item {
	width: 62px;
	height: 62px;
	border: 3px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background: #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}

.elementor-widget-woocommerce-product-images .thumb-item:hover {
	border-color: #855e94;
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(133, 94, 148, 0.25);
}

.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-slide-thumb-active
	.thumb-item {
	border-color: #855e94 !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(133, 94, 148, 0.3);
}

.elementor-widget-woocommerce-product-images .thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.elementor-widget-woocommerce-product-images .thumb-item:hover img {
	transform: scale(1.05);
}

/* ==== NAVEGAÇÃO ==== */
.elementor-widget-woocommerce-product-images .swiper-navigation {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	z-index: 10;
}

.elementor-widget-woocommerce-product-images .marvit-thumb-prev,
.elementor-widget-woocommerce-product-images .marvit-thumb-next {
	display: none !important;
}

.elementor-widget-woocommerce-product-images .marvit-thumb-prev {
	left: 15px;
}

.elementor-widget-woocommerce-product-images .marvit-thumb-next {
	right: 15px;
}

.elementor-widget-woocommerce-product-images .marvit-thumb-prev:hover,
.elementor-widget-woocommerce-product-images .marvit-thumb-next:hover {
	background: rgba(133, 94, 148, 1);
	transform: translateY(-50%) scale(1.1);
}

.elementor-widget-woocommerce-product-images .marvit-thumb-prev::after {
	content: "‹";
	font-size: 18px;
	line-height: 1;
}

.elementor-widget-woocommerce-product-images .marvit-thumb-next::after {
	content: "›";
	font-size: 18px;
	line-height: 1;
}

/* Estado desabilitado */
.elementor-widget-woocommerce-product-images
	.marvit-thumb-prev.swiper-button-disabled,
.elementor-widget-woocommerce-product-images
	.marvit-thumb-next.swiper-button-disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

/* ==== CONTADOR DE IMAGENS ==== */
.elementor-widget-woocommerce-product-images .image-counter {
	position: absolute;
	bottom: 16px;
	left: 16px;
	background: rgba(127, 91, 159, 0.95);
	color: white;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	z-index: 20;
	backdrop-filter: blur(6px);
}

/* ==== ZOOM INDICATOR ==== */
.elementor-widget-woocommerce-product-images
	.marvit-main-swiper
	.image-container::after {
	content: "🔍";
	position: absolute;
	top: 16px;
	right: 16px;
	background: rgba(133, 94, 148, 0.8);
	color: white;
	width: 35px;
	height: 35px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 10;
	pointer-events: none;
}

.elementor-widget-woocommerce-product-images
	.marvit-main-swiper
	.image-container:hover::after {
	opacity: 1;
}

/* ==== RESPONSIVIDADE ==== */
@media (max-width: 768px) {
	.elementor-widget-woocommerce-product-images .marvit-swiper-gallery {
		padding: 14px;
	}

	.elementor-widget-woocommerce-product-images .marvit-main-swiper {
		height: 360px;
	}

	.elementor-widget-woocommerce-product-images .marvit-main-swiper .swiper-slide {
		padding: 12px;
	}

	.elementor-widget-woocommerce-product-images .thumbs-gallery-wrapper {
		padding: 9px 10px;
		min-height: 92px;
		height: auto;
		overflow: hidden;
	}

	.elementor-widget-woocommerce-product-images
		.marvit-thumbs-swiper
		.swiper-slide {
		height: 68px !important;
		width: 68px !important;
	}

	.elementor-widget-woocommerce-product-images .thumb-item {
		width: 58px;
		height: 58px;
	}

	.elementor-widget-woocommerce-product-images .marvit-thumb-prev,
	.elementor-widget-woocommerce-product-images .marvit-thumb-next {
		width: 30px;
		height: 30px;
	}

	.elementor-widget-woocommerce-product-images .marvit-thumb-prev {
		left: 10px;
	}

	.elementor-widget-woocommerce-product-images .marvit-thumb-next {
		right: 10px;
	}
}

@media (max-width: 480px) {
	.elementor-widget-woocommerce-product-images .marvit-swiper-gallery {
		/* Ultra-robusta configuração mobile */
		position: relative !important;
		z-index: 1001 !important;
		pointer-events: auto !important;
		touch-action: manipulation !important;
		isolation: isolate !important;
		transform: translateZ(0) !important;
		will-change: auto !important;

		/* Garantir que fique no lugar durante scroll */
		contain: layout style paint !important;
		backface-visibility: hidden !important;
	}

	.elementor-widget-woocommerce-product-images .marvit-main-swiper {
		position: relative !important;
		z-index: 1002 !important;
		pointer-events: auto !important;
		touch-action: manipulation !important;
		isolation: isolate !important;
		transform: translateZ(0) !important;
	}

	.elementor-widget-woocommerce-product-images .marvit-thumbs-swiper {
		position: relative !important;
		z-index: 1002 !important;
		pointer-events: auto !important;
		touch-action: pan-x !important;
		isolation: isolate !important;
		transform: translateZ(0) !important;
	}

	/* Forçar elementos do swiper a manterem z-index */
	.elementor-widget-woocommerce-product-images .swiper,
	.elementor-widget-woocommerce-product-images .swiper-container {
		position: relative !important;
		z-index: 1002 !important;
		isolation: isolate !important;
	}

	.elementor-widget-woocommerce-product-images .swiper-slide {
		pointer-events: auto !important;
		touch-action: manipulation !important;
		position: relative !important;
		z-index: 1003 !important;
	}

	/* Prevenir interferência de outros elementos */
	.elementor-widget-woocommerce-product-images {
		position: relative !important;
		z-index: 1000 !important;
		isolation: isolate !important;
		transform: translateZ(0) !important;
		padding: 12px;
	}

	/* Garantir que elementos sticky/fixed não interfiram */
	body.single-product .elementor-widget-woocommerce-product-images {
		position: relative !important;
		z-index: 1000 !important;
	}

	/* Prevenir que headers sticky cubram a galeria */
	.elementor-widget-woocommerce-product-images .marvit-swiper-gallery {
		margin-top: 0 !important;
		top: 0 !important;
	}

	.elementor-widget-woocommerce-product-images .marvit-main-swiper {
		height: 300px;
	}

	.elementor-widget-woocommerce-product-images .marvit-main-swiper .swiper-slide {
		padding: 8px;
	}

	.elementor-widget-woocommerce-product-images .thumbs-gallery-wrapper {
		padding: 8px 10px;
		min-height: 84px;
		height: auto;
		overflow: hidden;
	}

	.elementor-widget-woocommerce-product-images
		.marvit-thumbs-swiper
		.swiper-slide {
		height: 58px !important;
		width: 58px !important;
	}

	.elementor-widget-woocommerce-product-images .thumb-item {
		width: 52px;
		height: 52px;
	}

	.elementor-widget-woocommerce-product-images .marvit-thumb-prev,
	.elementor-widget-woocommerce-product-images .marvit-thumb-next {
		width: 28px;
		height: 28px;
	}

	.elementor-widget-woocommerce-product-images .marvit-thumb-prev::after,
	.elementor-widget-woocommerce-product-images .marvit-thumb-next::after {
		font-size: 16px;
	}
}

/* ==== PROTEÇÃO CONTRA INTERFERÊNCIA DE WIDGETS DINÂMICOS ==== */
/* Prevenir que widgets de preço e pagamento afetem a galeria */
[data-marvit-price-widget],
[data-marvit-payment-options],
#dynamic-price-widget,
#payment-options-display {
	position: relative !important;
	z-index: 100 !important;
	isolation: isolate !important;
}

/* Garantir que a galeria tenha prioridade sobre widgets dinâmicos */
.elementor-widget-woocommerce-product-images {
	position: relative !important;
	z-index: 1000 !important;
	isolation: isolate !important;
}

.elementor-widget-woocommerce-product-images .marvit-swiper-gallery {
	position: relative !important;
	z-index: 1001 !important;
	isolation: isolate !important;
}

/* Proteger durante atualizações dinâmicas */
[data-marvit-price-widget].loading + * .marvit-swiper-gallery,
#dynamic-price-widget.loading + * .marvit-swiper-gallery,
.marvit-swiper-gallery {
	position: relative !important;
	z-index: 1001 !important;
	pointer-events: auto !important;
	touch-action: manipulation !important;
}

/* Forçar elementos da galeria a manterem funcionalidade */
.marvit-swiper-gallery .swiper,
.marvit-swiper-gallery .swiper-container,
.marvit-swiper-gallery .swiper-wrapper,
.marvit-swiper-gallery .swiper-slide {
	pointer-events: auto !important;
	touch-action: manipulation !important;
	position: relative !important;
	z-index: inherit !important;
}

/* ==== ANIMAÇÕES ==== */
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.elementor-widget-woocommerce-product-images .marvit-swiper-gallery {
	animation: slideIn 0.5s ease-out;
}

/* ==== LOADING STATES ==== */
.elementor-widget-woocommerce-product-images
	.marvit-swiper-gallery
	.swiper-slide
	img {
	opacity: 0;
	transition: opacity 0.3s ease;
}

.elementor-widget-woocommerce-product-images
	.marvit-swiper-gallery
	.swiper-slide
	img.loaded {
	opacity: 1;
}

/* ==== ACESSIBILIDADE ==== */
.elementor-widget-woocommerce-product-images .marvit-thumb-prev:focus,
.elementor-widget-woocommerce-product-images .marvit-thumb-next:focus {
	outline: 2px solid #855e94;
	outline-offset: 2px;
}

.elementor-widget-woocommerce-product-images .thumb-item:focus {
	outline: 2px solid #855e94;
	outline-offset: 2px;
}

/* ==== SCROLLBAR CUSTOMIZADA ==== */
.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-scrollbar {
	position: absolute;
	bottom: 5px;
	left: 20px;
	right: 20px;
	height: 8px;
	background: rgba(133, 94, 148, 0.15);
	border-radius: 4px;
	opacity: 1 !important;
}

.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-scrollbar-drag {
	background: #855e94;
	border-radius: 4px;
	height: 8px;
}

.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-scrollbar-drag:hover {
	background: #9b6ba8;
	height: 6px;
	margin-top: -1px;
}

/* ==== MELHORAR VISUALIZAÇÃO DAS THUMBS ==== */
.elementor-widget-woocommerce-product-images .marvit-thumbs-swiper {
	height: 100% !important;
	width: 100% !important;
	overflow: visible !important;
}

.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-wrapper {
	align-items: center;
	padding: 5px 0;
}

.elementor-widget-woocommerce-product-images
	.marvit-thumbs-swiper
	.swiper-slide {
	width: auto !important;
	height: 100px !important;
	margin-right: 15px;
	flex-shrink: 0;
}

.elementor-widget-woocommerce-product-images .thumb-item {
	width: 100px;
	height: 100px;
	border: 3px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background: #ffffff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ==== FORÇAR VISIBILIDADE DE TODOS OS ELEMENTOS ==== */
.elementor-widget-woocommerce-product-images .marvit-swiper-gallery,
.elementor-widget-woocommerce-product-images .marvit-swiper-gallery *,
.elementor-widget-woocommerce-product-images .marvit-main-swiper,
.elementor-widget-woocommerce-product-images .marvit-thumbs-swiper,
.elementor-widget-woocommerce-product-images .swiper-slide,
.elementor-widget-woocommerce-product-images .thumb-item {
	visibility: visible !important;
	opacity: 1 !important;
}
