/**
 * CzarCommerce — Lightbox CSS (companion para assets/src/front/modules/lightbox.js)
 *
 * Modal cobre viewport inteira via fixed + z-index czar-z-modal. Imagens e
 * iframes responsivos. Botões de nav posicionados nas laterais (desktop) ou
 * inferior (mobile).
 */

.czar-lightbox {
	position: fixed;
	inset: 0;
	z-index: var(--czar-z-modal, 2000);
	display: flex;
	align-items: center;
	justify-content: center;
}

.czar-lightbox[hidden] {
	display: none;
}

.czar-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	cursor: zoom-out;
}

.czar-lightbox__panel {
	position: relative;
	max-width: min(90vw, 1200px);
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.czar-lightbox__content {
	max-width: 100%;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.czar-lightbox__image {
	max-width: 100%;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: var(--czar-shadow-lg, 0 25px 50px -12px rgba(0, 0, 0, 0.5));
	border-radius: var(--czar-radius-md, 8px);
}

.czar-lightbox__iframe-wrap {
	position: relative;
	width: min(90vw, 1200px);
	aspect-ratio: 16 / 9;
}

.czar-lightbox__iframe-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: var(--czar-radius-md, 8px);
}

.czar-lightbox__btn {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: rgba(255, 255, 255, 0.9);
	color: #111;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
	z-index: 1;
}

.czar-lightbox__btn:hover,
.czar-lightbox__btn:focus-visible {
	background: #fff;
	transform: scale(1.06);
	outline: 2px solid var(--czar-color-primary, #3452ef);
	outline-offset: 2px;
}

.czar-lightbox__btn--close {
	top: 12px;
	right: 12px;
}

.czar-lightbox__btn--prev {
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
}

.czar-lightbox__btn--prev:hover,
.czar-lightbox__btn--prev:focus-visible {
	transform: translateY(-50%) scale(1.06);
}

.czar-lightbox__btn--next {
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
}

.czar-lightbox__btn--next:hover,
.czar-lightbox__btn--next:focus-visible {
	transform: translateY(-50%) scale(1.06);
}

@media (max-width: 640px) {
	.czar-lightbox__btn--prev {
		left: 8px;
		width: 36px;
		height: 36px;
	}
	.czar-lightbox__btn--next {
		right: 8px;
		width: 36px;
		height: 36px;
	}
	.czar-lightbox__btn--close {
		top: 8px;
		right: 8px;
		width: 36px;
		height: 36px;
	}
}

body.czar-lightbox-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.czar-lightbox__btn {
		transition: none;
	}
}
