/*
 * Mind Kit — galeria da página do produto.
 *
 * Estrutura e estados; valores visuais em variáveis `--mc-gl-*` que o modelo
 * pode redefinir com os tokens da loja.
 */
.mc-gallery {
	--mc-gl-bg: #fff;
	--mc-gl-arrow-bg: hsla(0, 0%, 100%, 0.75);
	--mc-gl-arrow-text: #222;
	--mc-gl-ring: #2491ff;
	--mc-gl-thumb-size: 100px;
	--mc-gl-thumb-opacity: 0.4;
	--mc-gl-backdrop: rgba(0, 0, 0, 0.88);
	--mc-gl-on-backdrop: #fff;
	--mc-gl-thumb-gap: 10px;
	position: relative;
	width: 100%;
}

.mc-gallery ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mc-gallery__stage {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* ------------------------------------------------------------ Foto principal */
.mc-gallery__main {
	position: relative;
	width: 100%;
	min-width: 0;
}

.mc-gallery__track {
	display: flex;
	align-items: flex-start;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior-x: contain;
	position: relative;
	transition: height 0.2s ease;
}

.mc-gallery__track::-webkit-scrollbar {
	display: none;
}

.mc-gallery__slide {
	flex: 0 0 100%;
	min-width: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	position: relative;
	background: var(--mc-gl-bg);
}

.mc-gallery__link {
	display: block;
	position: relative;
	width: 100%;
	cursor: default;
}

.mc-gallery--zoom .mc-gallery__link {
	cursor: zoom-in;
}

.mc-gallery__link:focus-visible,
.mc-gallery__thumb button:focus-visible,
.mc-gallery__arrow:focus-visible,
.mc-lightbox button:focus-visible {
	outline: 0.25rem solid var(--mc-gl-ring);
	outline-offset: -0.25rem;
}

.mc-gallery__slide img {
	display: block;
	width: 100%;
	height: auto;
}

/* Setas */
.mc-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-top: -21px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--mc-gl-arrow-bg);
	color: var(--mc-gl-arrow-text);
	cursor: pointer;
	transition: background 0.3s ease;
}

.mc-gallery__arrow--prev {
	left: 0;
}

.mc-gallery__arrow--next {
	right: 0;
}

.mc-gallery__arrow:hover {
	background: #fff;
}

.mc-gallery__arrow:disabled {
	visibility: hidden;
}

/* ----------------------------------------------------------------- Miniaturas */
.mc-gallery__thumbs {
	min-width: 0;
	/* o respiro de 5px de cada miniatura fica fora da foto: as pontas alinham com a foto principal */
	width: calc(100% + 10px);
	margin: 0 -5px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.mc-gallery__thumbs::-webkit-scrollbar {
	display: none;
}

.mc-gallery__thumblist {
	display: flex;
	gap: 0;
}

.mc-gallery__thumb {
	position: relative;
	flex: 0 0 calc(100% / var(--mc-gl-m-thumbs, 4));
	box-sizing: border-box;
	padding: 0 5px;
	opacity: var(--mc-gl-thumb-opacity);
	transition: opacity 0.2s ease;
}

.mc-gallery__thumb.is-active,
.mc-gallery__thumb:hover {
	opacity: 1;
}

.mc-gallery__thumb button {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}

.mc-gallery__thumb img {
	display: block;
	width: 100%;
	height: auto;
}

.mc-gallery__thumb--video .mc-gallery__play,
.mc-gallery__thumb--video svg {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

/* Foto única: sem miniaturas nem setas */
.mc-gallery--single .mc-gallery__thumbs,
.mc-gallery--single .mc-gallery__arrow {
	display: none;
}

/* ------------------------------------------------- Computador: miniaturas ao lado */
@media (min-width: 771px) {
	.mc-gallery--vertical .mc-gallery__stage {
		flex-direction: row;
		gap: 4px;
		align-items: flex-start;
	}

	.mc-gallery--vertical .mc-gallery__main {
		flex: 1 1 0;
		order: 2;
	}

	.mc-gallery--vertical .mc-gallery__thumbs {
		flex: 0 0 var(--mc-gl-thumb-size);
		order: 1;
		width: auto;
		margin: 0;
		max-height: calc(var(--mc-gl-v-thumbs, 5) * 105px + (var(--mc-gl-v-thumbs, 5) - 1) * var(--mc-gl-thumb-gap));
		overflow-x: hidden;
		overflow-y: auto;
	}

	.mc-gallery--vertical .mc-gallery__thumblist {
		display: block;
	}

	.mc-gallery--vertical .mc-gallery__thumb {
		width: var(--mc-gl-thumb-size);
		height: 105px;
		padding: 2.5px 0 2.5px 5px;
		display: flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;
	}

	.mc-gallery--vertical .mc-gallery__thumb:first-child {
		padding-top: 0;
	}

	.mc-gallery--vertical .mc-gallery__thumb + .mc-gallery__thumb {
		margin-top: var(--mc-gl-thumb-gap);
	}

	.mc-gallery--vertical .mc-gallery__thumb button {
		height: 100%;
	}

	.mc-gallery--vertical .mc-gallery__thumb img {
		height: 100%;
		object-fit: cover;
	}

	.mc-gallery--single .mc-gallery__stage {
		display: block;
	}
}

/* ------------------------------------------------------------------------ Vídeo */
.mc-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 72px;
	height: 72px;
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 1;
}

.mc-gallery__slide--video .mc-gallery__link {
	cursor: pointer;
}

.mc-gallery__link[hidden] {
	display: none;
}

.mc-gallery__player {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background: #000;
}

.mc-gallery__player iframe,
.mc-gallery__player video {
	display: block;
	width: 100%;
	height: 100%;
	min-height: inherit;
	border: 0;
}

.mc-gallery__bgvideo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.mc-gallery__link.is-bgvideo img {
	visibility: hidden;
}

/* ------------------------------------------------------------------- Lightbox */
html:has(.mc-lightbox[open]) {
	overflow: hidden;
}

.mc-lightbox {
	width: 100vw;
	max-width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--mc-gl-backdrop);
	color: var(--mc-gl-on-backdrop);
	overflow: hidden;
}

.mc-lightbox::backdrop {
	background: var(--mc-gl-backdrop);
}

.mc-lightbox__bar {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
}

.mc-lightbox__counter {
	font-size: 14px;
	opacity: 0.85;
}

.mc-lightbox button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.mc-lightbox__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: auto;
	box-sizing: border-box;
	padding: 56px 12px 12px;
}

.mc-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: auto;
	object-fit: contain;
	cursor: zoom-in;
}

.mc-lightbox.is-zoomed .mc-lightbox__stage {
	align-items: flex-start;
	justify-content: flex-start;
}

.mc-lightbox.is-zoomed .mc-lightbox__img {
	max-width: none;
	max-height: none;
	cursor: zoom-out;
}

.mc-lightbox__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	margin-top: -22px;
}

.mc-lightbox__nav--prev {
	left: 8px;
}

.mc-lightbox__nav--next {
	right: 8px;
}

@media (prefers-reduced-motion: reduce) {
	.mc-gallery__track,
	.mc-gallery__thumb,
	.mc-gallery__arrow {
		transition: none;
	}
}
