/**
 * LaserBra Product Gallery 1.1.11
 */

.laserbra-main-image,
.laserbra-gallery-grid,
.laserbra-main-image *,
.laserbra-gallery-grid * {
	box-sizing: border-box;
}

.laserbra-main-image {
	width: 100%;
	margin: 0;
}

.laserbra-main-image__link,
.laserbra-gallery-grid__link {
	display: block;
	width: 100%;
	line-height: 0;
	overflow: hidden;
	cursor: zoom-in;
}

.laserbra-main-image__img,
.laserbra-gallery-grid__img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	margin: 0;
	object-fit: cover;
}

.laserbra-gallery-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 5px;
	width: 100%;
	margin: 0;
	padding: 0;
}

.laserbra-gallery-grid__item {
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

.laserbra-gallery-notice {
	padding: 12px;
	border: 1px dashed #aaa;
	font-size: 13px;
	line-height: 1.4;
}

/* Lightbox carousel */
body.laserbra-lightbox-open {
	overflow: hidden;
}

.laserbra-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.90);
}

.laserbra-lightbox.is-open {
	display: flex;
}

.laserbra-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 48px 90px;
}

.laserbra-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 96px);
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
}

.laserbra-lightbox__close,
.laserbra-lightbox__prev,
.laserbra-lightbox__next {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: rgba(0, 0, 0, 0.18);
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
}

.laserbra-lightbox__close:hover,
.laserbra-lightbox__prev:hover,
.laserbra-lightbox__next:hover {
	background: rgba(0, 0, 0, 0.42);
}

.laserbra-lightbox__close {
	top: 14px;
	right: 18px;
	width: 44px;
	height: 44px;
	font-size: 34px;
	line-height: 1;
}

.laserbra-lightbox__prev,
.laserbra-lightbox__next {
	top: 50%;
	width: 58px;
	height: 72px;
	transform: translateY(-50%);
	font-size: 46px;
	line-height: 1;
}

.laserbra-lightbox__prev {
	left: 18px;
}

.laserbra-lightbox__next {
	right: 18px;
}

.laserbra-lightbox__counter {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	padding: 5px 10px;
	background: rgba(0, 0, 0, 0.28);
	color: #fff;
	font-size: 13px;
	line-height: 1;
}

@media (max-width: 767px) {
	.laserbra-gallery-grid {
		grid-template-columns: 1fr;
	}

	.laserbra-lightbox__stage {
		padding: 54px 42px;
	}

	.laserbra-lightbox__image {
		max-height: calc(100vh - 108px);
	}

	.laserbra-lightbox__prev,
	.laserbra-lightbox__next {
		width: 40px;
		height: 58px;
		font-size: 36px;
		background: rgba(0, 0, 0, 0.25);
	}

	.laserbra-lightbox__prev {
		left: 0;
	}

	.laserbra-lightbox__next {
		right: 0;
	}

	.laserbra-lightbox__close {
		top: 6px;
		right: 6px;
	}
}

/* Prevent first-paint image flash; critical duplicate is printed in wp_head. */
.laserbra-main-image__img { opacity: 0; }
.laserbra-main-image__img.is-loaded { opacity: 1; }


/**
 * Mobile fixed main image — same method as the homepage hero.
 * The real <img> keeps the natural space in the layout; a fixed ::before
 * displays the image behind the page, so there is no JS top recalculation.
 */
@media (max-width: 767px) {
	.laserbra-main-image.is-mobile-fixed {
		--laserbra-mobile-hero-top: 70px;
		position: relative !important;
		overflow: hidden !important;
		background-image: none !important;
		isolation: isolate;
	}

	.laserbra-main-image.is-mobile-fixed::before {
		content: "";
		position: fixed;
		top: var(--laserbra-mobile-hero-top);
		left: 10px;
		right: 10px;
		width: auto;
		height: calc(100svh - var(--laserbra-mobile-hero-top));
		background-image: var(--laserbra-mobile-fixed-image);
		background-size: cover;
		background-position: center top;
		background-repeat: no-repeat;
		z-index: -1;
		pointer-events: none;
	}

	/* The original image remains only as the exact layout spacer and link area. */
	.laserbra-main-image.is-mobile-fixed .laserbra-main-image__img {
		visibility: hidden !important;
		opacity: 0 !important;
	}

	.laserbra-main-image.is-mobile-fixed > * {
		position: relative;
		z-index: 1;
	}

	/* Product information and the rest of the page scroll above the fixed image. */
	body.laserbra-mobile-fixed-image-active .laserbra-mobile-fixed-content {
		position: relative;
		z-index: 1;
		background: #fff;
	}
}
