/**
 * Vemax — Galeria do Produto.
 *
 * Everything is scoped under .vemax-product-gallery. The frame rules are
 * intentionally written as ".vemax-product-gallery .vemax-product-image-frame"
 * (never as a bare .vemax-product-image-frame) so they cannot collide with the
 * existing per-widget correction applied to the standalone Image widget in the
 * Single Produto template.
 */

.vemax-product-gallery {
	width: 100%;
}

/* ---------- Main frame (1:1, no fixed height) ---------- */

.vemax-product-gallery .vemax-product-image-frame {
	position: relative; /* anchor for the future "Destaque" badge */
	width: 100%;
	aspect-ratio: 1 / 1;
	background-color: #F7F8FA;
	border-radius: 16px;
	overflow: hidden;
	padding: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

/*
 * Elementor ships ".elementor img { height:auto; max-width:100% }" (0-1-1),
 * which outranks a single class. The rule below is scoped through the gallery
 * wrapper (0-2-0) so it wins without !important, and it constrains the image
 * with max-width/max-height instead of forcing 100%/100% — the natural ratio
 * is preserved, nothing is cropped and nothing is stretched.
 */
.vemax-product-gallery .vemax-product-gallery__main-image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	margin: 0;
}

/* ---------- Thumbnails ---------- */

.vemax-product-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
}

/*
 * The active theme (Hello Elementor) styles every button with
 * '[type="button"]:hover, [type="button"]:focus { background-color:#c36 }'
 * — a dark pink — and '[type="button"] { color:#c36; transition:all .3s }'.
 * Those selectors score 0-2-0, so the thumb rules are scoped through the
 * gallery wrapper (0-2-0 base / 0-3-0 on state) to outrank them without any
 * !important, and every state repaints the background explicitly.
 */
.vemax-product-gallery .vemax-product-gallery__thumb,
.vemax-product-gallery .vemax-product-gallery__thumb:hover,
.vemax-product-gallery .vemax-product-gallery__thumb:focus,
.vemax-product-gallery .vemax-product-gallery__thumb:focus-visible,
.vemax-product-gallery .vemax-product-gallery__thumb:active {
	background-color: #FFFFFF;
	background-image: none;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}

.vemax-product-gallery .vemax-product-gallery__thumb {
	width: 64px;
	height: 64px;
	padding: 4px;
	margin: 0;
	border: 2px solid #E5E7EB;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.vemax-product-gallery .vemax-product-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	margin: 0;
	padding: 0;
}

.vemax-product-gallery .vemax-product-gallery__thumb:hover {
	border-color: #1C325A;
}

.vemax-product-gallery .vemax-product-gallery__thumb.is-active {
	border-color: #1C325A;
	box-shadow: 0 2px 8px rgba(15, 30, 56, 0.18);
}

.vemax-product-gallery .vemax-product-gallery__thumb:focus-visible {
	outline: 2px solid #FFD301;
	outline-offset: 3px;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
	.vemax-product-gallery .vemax-product-image-frame {
		padding: 24px;
	}
}

/* ---------- Editor-only notice ---------- */

.vemax-product-gallery__notice {
	padding: 12px 14px;
	border: 1px dashed #9CA3AF;
	border-radius: 8px;
	color: #4B5563;
	font-size: 13px;
	font-family: "Open Sans", system-ui, sans-serif;
}
