/* Calimaro Galeria & Vídeos v1.0.3 — Zero jQuery, CSS Scroll-Snap + Native <dialog> Lightbox */

.single-product div.product div.images.cal-gal,
.cal-gal {
	--cal-gal-thumbs: 6;
	--cal-gal-accent: #1c8651;
	--cal-gal-arrow-bg: #ffffff;
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-block-end: 2em;
}

@media (max-width: 921px) {
	.single-product div.product div.images.cal-gal {
		width: 100% !important;
		max-width: 100% !important;
		float: none !important;
	}
}

@media (min-width: 922px) {
	.single-product div.product div.images.cal-gal {
		float: left;
		width: 50%;
	}
	.cal-gal--layout-left {
		flex-direction: row-reverse;
		align-items: flex-start;
	}
	.cal-gal--layout-right {
		flex-direction: row;
		align-items: flex-start;
	}
	.cal-gal--layout-left .cal-gal__stage,
	.cal-gal--layout-right .cal-gal__stage {
		flex: 1 1 auto;
		min-inline-size: 0;
	}
	.cal-gal--layout-left .cal-gal__thumbs-bar,
	.cal-gal--layout-right .cal-gal__thumbs-bar {
		flex: 0 0 82px;
		flex-direction: column;
		max-block-size: 520px;
	}
	.cal-gal--layout-left .cal-gal__thumbs,
	.cal-gal--layout-right .cal-gal__thumbs {
		flex-direction: column;
		overflow-x: hidden;
		overflow-y: auto;
	}
	.cal-gal--layout-left .cal-gal__thumb,
	.cal-gal--layout-right .cal-gal__thumb {
		flex: 0 0 76px;
		width: 76px;
	}
}

.cal-gal-sr-only {
	position: absolute;
	clip-path: inset(50%);
	overflow: hidden;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	white-space: nowrap;
}

/* ---------- Palco Principal & Track Scroll-Snap (Touch + Trackpad + Mouse Drag) ---------- */
.cal-gal__stage {
	position: relative;
	width: 100%;
	border-radius: 12px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	overflow: hidden;
}

.cal-gal__track {
	display: flex;
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	touch-action: pan-x pan-y pinch-zoom;
	outline: none;
}

.cal-gal__track::-webkit-scrollbar {
	display: none;
}

@media (prefers-reduced-motion: no-preference) {
	.cal-gal__track {
		scroll-behavior: smooth;
	}
}

.cal-gal--draggable .cal-gal__track {
	cursor: grab;
}

.cal-gal--draggable .cal-gal__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none !important;
	scroll-behavior: auto !important;
	user-select: none;
}

.cal-gal--draggable .cal-gal__track.is-dragging .cal-gal__img {
	pointer-events: none;
}

.cal-gal__track:focus-visible {
	box-shadow: inset 0 0 0 3px var(--cal-gal-accent);
}

body .cal-gal .cal-gal__slide,
.cal-gal__slide {
	position: relative;
	flex: 0 0 100% !important;
	width: 100% !important;
	aspect-ratio: 1 / 1;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	box-sizing: border-box;
	overflow: hidden;
}

.cal-gal__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #ffffff;
	transition: transform 0.2s ease-out;
	user-select: none;
	-webkit-user-drag: none;
	touch-action: pan-x pan-y pinch-zoom;
}

@media (hover: hover) and (pointer: fine) {
	.cal-gal--zoom .cal-gal__slide--image.is-zooming .cal-gal__img {
		transform: scale(1.85);
		cursor: zoom-in;
	}
}

/* ---------- Controles Anterior / Próximo (Ocultos em repouso e no mobile; revelados no hover desktop) ---------- */
.cal-gal__controls {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-inline: 10px;
	pointer-events: none;
}

body .cal-gal button.cal-gal__arrow {
	pointer-events: auto;
	appearance: none;
	width: 42px;
	height: 42px;
	min-height: 42px;
	padding: 0;
	margin: 0;
	border-radius: 999px;
	border: 1px solid rgba(15, 23, 42, 0.12);
	background-color: var(--cal-gal-arrow-bg, #ffffff);
	color: var(--cal-gal-accent, #1c8651);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	touch-action: manipulation;
	transition: opacity 0.18s ease-out, transform 0.18s ease-out, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body .cal-gal.cal-gal--hover-arrows button.cal-gal__arrow {
	opacity: 0;
	transform: scale(0.92);
	pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
	body .cal-gal.cal-gal--hover-arrows .cal-gal__stage:hover button.cal-gal__arrow {
		opacity: 1;
		transform: scale(1);
		pointer-events: auto;
	}
}

body .cal-gal.cal-gal--hover-arrows button.cal-gal__arrow:focus-visible {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

body .cal-gal button.cal-gal__arrow:hover,
body .cal-gal button.cal-gal__arrow:focus-visible {
	background-color: var(--cal-gal-accent, #1c8651);
	border-color: var(--cal-gal-accent, #1c8651);
	color: #ffffff;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

body .cal-gal button.cal-gal__arrow:active {
	background-color: var(--cal-gal-accent, #1c8651);
	border-color: var(--cal-gal-accent, #1c8651);
	color: #ffffff;
	transform: scale(0.95);
}

body .cal-gal button.cal-gal__arrow:focus-visible {
	outline: 3px solid #0b57d0;
	outline-offset: 2px;
}

body .cal-gal button.cal-gal__arrow[disabled] {
	opacity: 0 !important;
	cursor: default;
	pointer-events: none !important;
}

/* Botão da Lupa (Ampliar Lightbox) */
body .cal-gal button.cal-gal__expand-btn {
	position: absolute;
	z-index: 5;
	width: 40px;
	height: 40px;
	min-height: 40px;
	padding: 0;
	margin: 0;
	border-radius: 999px;
	border: 1px solid rgba(15, 23, 42, 0.12);
	background-color: rgba(255, 255, 255, 0.94);
	color: #0f172a;
	box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	touch-action: manipulation;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cal-gal--lb-bottom-right button.cal-gal__expand-btn { inset-block-end: 12px; inset-inline-end: 12px; }
.cal-gal--lb-top-right button.cal-gal__expand-btn { inset-block-start: 12px; inset-inline-end: 12px; }
.cal-gal--lb-bottom-left button.cal-gal__expand-btn { inset-block-end: 12px; inset-inline-start: 12px; }
.cal-gal--lb-top-left button.cal-gal__expand-btn { inset-block-start: 12px; inset-inline-start: 12px; }

body .cal-gal button.cal-gal__expand-btn:hover,
body .cal-gal button.cal-gal__expand-btn:focus,
body .cal-gal button.cal-gal__expand-btn:active {
	background-color: #0f172a;
	border-color: #0f172a;
	color: #ffffff;
}

body .cal-gal button.cal-gal__expand-btn:focus-visible {
	outline: 3px solid #0b57d0;
	outline-offset: 2px;
}

/* ---------- Fachada Lite YouTube / Vimeo / MP4 ---------- */
.cal-gal__video-shell {
	position: relative;
	width: 100%;
	height: 100%;
	background: #0f172a;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.cal-gal__video-poster {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	opacity: 0.88;
	transition: transform 0.25s ease, opacity 0.25s ease;
	user-select: none;
	-webkit-user-drag: none;
}

.cal-gal__video-shell:hover .cal-gal__video-poster {
	opacity: 0.96;
	transform: scale(1.02);
}

body .cal-gal button.cal-gal__play-btn,
body dialog.cal-gal-lightbox button.cal-gal__play-btn {
	position: absolute;
	inset: 0;
	z-index: 3;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: radial-gradient(circle, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.55) 100%);
	color: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
	touch-action: pan-x pan-y pinch-zoom;
}

body .cal-gal button.cal-gal__play-btn:hover,
body .cal-gal button.cal-gal__play-btn:focus,
body .cal-gal button.cal-gal__play-btn:active,
body dialog.cal-gal-lightbox button.cal-gal__play-btn:hover,
body dialog.cal-gal-lightbox button.cal-gal__play-btn:focus {
	background: radial-gradient(circle, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.65) 100%);
	color: #ffffff;
}

.cal-gal__play-circle {
	width: 68px;
	height: 68px;
	border-radius: 999px;
	background: var(--cal-gal-accent, #1c8651);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
	transition: transform 0.18s ease, background-color 0.18s ease;
}

body .cal-gal button.cal-gal__play-btn:hover .cal-gal__play-circle,
body dialog.cal-gal-lightbox button.cal-gal__play-btn:hover .cal-gal__play-circle {
	transform: scale(1.08);
	background: #15683f;
}

.cal-gal__play-badge {
	padding: 5px 14px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.85);
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.cal-gal__video-shell iframe,
.cal-gal__video-shell video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000000;
}

/* ---------- Barra de Miniaturas ---------- */
.cal-gal__thumbs-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
}

.cal-gal__thumbs {
	display: flex;
	flex-direction: row;
	gap: 8px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
	scrollbar-width: none;
	scroll-behavior: smooth;
	padding: 2px;
	flex: 1 1 auto;
}

.cal-gal__thumbs::-webkit-scrollbar {
	display: none;
}

body .cal-gal button.cal-gal__thumb {
	position: relative;
	appearance: none;
	flex: 0 0 calc((100% - (var(--cal-gal-thumbs, 6) - 1) * 8px) / var(--cal-gal-thumbs, 6));
	min-width: 58px;
	max-width: 96px;
	aspect-ratio: 1 / 1;
	padding: 2px;
	margin: 0;
	border-radius: 8px;
	border: 2px solid #e2e8f0;
	background-color: #ffffff;
	cursor: pointer;
	overflow: hidden;
	touch-action: manipulation;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

body .cal-gal button.cal-gal__thumb:hover,
body .cal-gal button.cal-gal__thumb:focus,
body .cal-gal button.cal-gal__thumb:active {
	background-color: #ffffff;
	border-color: #94a3b8;
	color: inherit;
}

body .cal-gal button.cal-gal__thumb[aria-current="true"] {
	border-color: var(--cal-gal-accent, #1c8651);
	box-shadow: 0 0 0 1px var(--cal-gal-accent, #1c8651);
}

body .cal-gal button.cal-gal__thumb:focus-visible {
	outline: 3px solid #0b57d0;
	outline-offset: 2px;
}

.cal-gal__thumb img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 5px;
	user-select: none;
	-webkit-user-drag: none;
}

.cal-gal__thumb-play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.82);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

body .cal-gal button.cal-gal__thumb-nav {
	appearance: none;
	flex: 0 0 32px;
	width: 32px;
	height: 56px;
	min-height: 44px;
	padding: 0;
	margin: 0;
	border-radius: 8px;
	border: 1px solid #cbd5e1;
	background-color: #ffffff;
	color: var(--cal-gal-accent, #1c8651);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	touch-action: manipulation;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body .cal-gal button.cal-gal__thumb-nav[hidden] {
	display: none !important;
}

body .cal-gal button.cal-gal__thumb-nav:hover,
body .cal-gal button.cal-gal__thumb-nav:focus-visible,
body .cal-gal button.cal-gal__thumb-nav:active {
	background-color: var(--cal-gal-accent, #1c8651);
	border-color: var(--cal-gal-accent, #1c8651);
	color: #ffffff;
}

body .cal-gal button.cal-gal__thumb-nav:focus-visible {
	outline: 3px solid #0b57d0;
	outline-offset: 2px;
}

/* ---------- Lightbox <dialog> HTML5 Nativo (Mesmo comportamento: setas no hover + rolar/arrastar lateral) ---------- */
dialog.cal-gal-lightbox {
	padding: 0;
	border: 0;
	background: transparent;
	max-width: min(96vw, 1120px);
	max-height: 94dvh;
	width: 100%;
	color: #f8fafc;
}

dialog.cal-gal-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

dialog.cal-gal-lightbox:modal {
	overscroll-behavior: contain;
}

dialog.cal-gal-lightbox::backdrop {
	overflow: hidden;
	overscroll-behavior: contain;
	background: rgba(15, 23, 42, 0.92);
	backdrop-filter: blur(4px);
}

.cal-gal-lightbox__shell {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: 92dvh;
	background: #0f172a;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.cal-gal-lightbox__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	background: rgba(15, 23, 42, 0.95);
	border-block-end: 1px solid rgba(255, 255, 255, 0.1);
}

.cal-gal-lightbox__counter {
	font-size: 13.5px;
	font-weight: 600;
	color: #e2e8f0;
}

.cal-gal-lightbox__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.cal-gal-lightbox__close-form {
	margin: 0;
}

body dialog.cal-gal-lightbox button.cal-gal-lightbox__btn,
body dialog.cal-gal-lightbox button.cal-gal-lightbox__nav {
	appearance: none;
	width: 42px;
	height: 42px;
	min-height: 42px;
	padding: 0;
	margin: 0;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background-color: rgba(30, 41, 59, 0.9);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	touch-action: manipulation;
	transition: opacity 0.18s ease-out, transform 0.18s ease-out, background-color 0.15s ease;
}

/* Setas do Lightbox: ocultas em repouso e no mobile; surgem suavemente no hover desktop */
body dialog.cal-gal-lightbox button.cal-gal-lightbox__nav {
	position: absolute;
	z-index: 5;
	opacity: 0;
	transform: scale(0.92);
	pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
	body dialog.cal-gal-lightbox .cal-gal-lightbox__body:hover button.cal-gal-lightbox__nav {
		opacity: 1;
		transform: scale(1);
		pointer-events: auto;
	}
}

body dialog.cal-gal-lightbox button.cal-gal-lightbox__nav:focus-visible {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

body dialog.cal-gal-lightbox button.cal-gal-lightbox__btn:hover,
body dialog.cal-gal-lightbox button.cal-gal-lightbox__btn:focus-visible,
body dialog.cal-gal-lightbox button.cal-gal-lightbox__nav:hover,
body dialog.cal-gal-lightbox button.cal-gal-lightbox__nav:focus-visible {
	background-color: var(--cal-gal-accent, #1c8651);
	border-color: var(--cal-gal-accent, #1c8651);
	color: #ffffff;
}

body dialog.cal-gal-lightbox button:focus-visible {
	outline: 3px solid #60a5fa;
	outline-offset: 2px;
}

.cal-gal-lightbox__body {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: min(72dvh, 720px);
	max-height: calc(92dvh - 64px);
	background: #ffffff;
	overflow: hidden;
}

.cal-gal-lightbox__nav--prev { inset-inline-start: 14px; }
.cal-gal-lightbox__nav--next { inset-inline-end: 14px; }

.cal-gal-lightbox__stage {
	width: 100%;
	height: min(76dvh, 760px);
	display: flex;
	overflow: hidden;
}

.cal-gal-lightbox__track {
	display: flex;
	width: 100%;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	touch-action: pan-x pan-y pinch-zoom;
	cursor: grab;
}

.cal-gal-lightbox__track::-webkit-scrollbar {
	display: none;
}

@media (prefers-reduced-motion: no-preference) {
	.cal-gal-lightbox__track {
		scroll-behavior: smooth;
	}
}

.cal-gal-lightbox__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none !important;
	scroll-behavior: auto !important;
	user-select: none;
}

.cal-gal-lightbox__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #ffffff;
}

.cal-gal-lightbox__slide.is-zoomed {
	overflow: auto;
	cursor: zoom-out;
}

.cal-gal-lightbox__slide img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transition: transform 0.2s ease;
	user-select: none;
	-webkit-user-drag: none;
	touch-action: pan-x pan-y pinch-zoom;
}

.cal-gal-lightbox__track.is-dragging .cal-gal-lightbox__slide img {
	pointer-events: none;
}

.cal-gal-lightbox__slide.is-zoomed img {
	transform: scale(2);
	transform-origin: center center;
}

.cal-gal-lightbox__slide iframe,
.cal-gal-lightbox__slide video {
	width: 100%;
	height: 100%;
	border: 0;
	background: #000000;
}
