/* Module: Gallery. Look matches the product gallery (assets/css/product-details.css). */
.gallery { padding-top: 84px; padding-bottom: 84px; }
.gallery--theme-grey { background: var(--skin-grey-5); }
.gallery--theme-dark { background: var(--skin-dark-60); color: var(--skin-white); }
.gallery--theme-dark .gallery__head h1,
.gallery--theme-dark .gallery__head h2,
.gallery--theme-dark .gallery__head h3 { color: var(--skin-white); }

.gallery__head { text-align: center; max-width: 720px; margin: 0 auto 48px; display: flex; flex-direction: column; gap: 16px; }

/* Shared: rounded image tiles with an expand badge on hover. */
.gallery__main,
.gallery__link {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 18px;
	background: var(--skin-grey-20);
	cursor: zoom-in;
}
.gallery__main img,
.gallery__link img { display: block; width: 100%; transition: transform 0.4s ease; }
.gallery__main:hover img,
.gallery__link:hover img { transform: scale(1.03); }
.gallery__zoom {
	position: absolute; left: 20px; bottom: 20px;
	width: 48px; height: 48px;
	border-radius: 1000px;
	border: 1px solid var(--skin-teal);
	background: rgba(255,255,255,0.2);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: var(--skin-teal);
	display: flex; align-items: center; justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
	box-shadow: inset 0 -2px 15px rgba(0,0,0,0.2), inset 0 2px 15px rgba(255,255,255,0.4);
}
.gallery__main:hover .gallery__zoom,
.gallery__main:focus-visible .gallery__zoom,
.gallery__link:hover .gallery__zoom,
.gallery__link:focus-visible .gallery__zoom { opacity: 1; }

.gallery__item { margin: 0; }
.gallery__caption { margin-top: 12px; font-size: 16px; line-height: 24px; text-align: left; }
.gallery__caption[hidden] { display: none; }

/* 1. Default: large image centred, thumbnails below. */
.gallery__stage { position: relative; width: 100%; max-width: 1080px; margin: 0 auto; }
/* Keep the stage + thumbs centred even when Elementor/theme resets figure margins or shrinks the widget. */
.elementor-widget-marcoeco-gallery { width: 100%; }
.gallery--default .skin-inner { display: flex; flex-direction: column; align-items: center; }
.gallery--default .gallery__head { width: 100%; }
.gallery .gallery__stage { margin-left: auto; margin-right: auto; }
.gallery__main { aspect-ratio: 16 / 9; }
.gallery__main img { height: 100%; object-fit: cover; }
.gallery--default .gallery__caption { text-align: center; }
.gallery__nav { position: absolute; right: 20px; top: 20px; display: flex; gap: 8px; }
.gallery__nav-arrow {
	width: 48px; height: 48px;
	border-radius: 1000px;
	border: 1px solid var(--skin-teal);
	background: rgba(255,255,255,0.2);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: var(--skin-teal);
	font-size: 18px;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	box-shadow: inset 0 -2px 15px rgba(0,0,0,0.2), inset 0 2px 15px rgba(255,255,255,0.4);
	transition: background 0.2s;
}
.gallery__nav-arrow:hover { background: rgba(255,255,255,0.4); }
.gallery__thumbs {
	display: flex;
	gap: 12px;
	width: 100%;
	max-width: 1080px;
	margin: 20px auto 0;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
}
.gallery__thumbs::-webkit-scrollbar { display: none; }
/* Centred when it fits, still scrollable from the first thumb when it overflows. */
.gallery__thumb:first-child { margin-left: auto; }
.gallery__thumb:last-child { margin-right: auto; }
.gallery__thumb {
	flex: 0 0 auto;
	width: 100px; height: 100px;
	padding: 0;
	border: 1px solid var(--skin-teal-20);
	border-radius: 18px;
	overflow: hidden;
	background: none;
	cursor: pointer;
	opacity: 0.75;
	transition: border-color 0.2s, opacity 0.2s;
}
.gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb.is-active { border: 2px solid var(--skin-teal); opacity: 1; }

/* 2 / 3. Grid: even tiles, 4:3 crop. */
.gallery--grid-2 .gallery__grid,
.gallery--grid-3 .gallery__grid { display: grid; gap: 32px; }
.gallery--grid-2 .gallery__grid { grid-template-columns: repeat(2, 1fr); }
.gallery--grid-3 .gallery__grid { grid-template-columns: repeat(3, 1fr); }
.gallery--grid-2 .gallery__link,
.gallery--grid-3 .gallery__link { aspect-ratio: 4 / 3; }
.gallery--grid-2 .gallery__link img,
.gallery--grid-3 .gallery__link img { height: 100%; object-fit: cover; }

/* 4. Masonry: 3 columns, each image keeps its own shape. */
.gallery--masonry .gallery__grid { columns: 3; column-gap: 32px; }
.gallery--masonry .gallery__item { break-inside: avoid; margin-bottom: 32px; }
.gallery--masonry .gallery__link img { height: auto; }

/* Lightbox (same look as the product page; one overlay per page). */
.marcoeco-lightbox {
	position: fixed; inset: 0; z-index: 1000;
	display: none; align-items: center; justify-content: center;
	background: rgba(10, 10, 10, 0.92);
}
.marcoeco-lightbox.is-open { display: flex; }
body.marcoeco-lightbox-open { overflow: hidden; }
.marcoeco-lightbox__stage { max-width: 90vw; max-height: 90vh; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.marcoeco-lightbox__caption { color: #fff; font-family: var(--font-body); font-size: 16px; line-height: 1.3; text-align: center; }
.marcoeco-lightbox__caption[hidden] { display: none; }
.marcoeco-lightbox__img { max-width: 90vw; max-height: 82vh; width: auto; height: auto; display: block; border-radius: 8px; }
.marcoeco-lightbox__close,
.marcoeco-lightbox__nav {
	position: absolute;
	border-radius: 1000px;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid var(--skin-teal);
	color: var(--skin-teal);
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background 0.2s;
}
.marcoeco-lightbox__close:hover,
.marcoeco-lightbox__nav:hover { background: rgba(255, 255, 255, 0.3); }
.marcoeco-lightbox__close { top: 24px; right: 24px; width: 48px; height: 48px; font-size: 20px; }
.marcoeco-lightbox__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 20px; }
.marcoeco-lightbox__nav--prev { left: 24px; }
.marcoeco-lightbox__nav--next { right: 24px; }

/* Responsive. */
@media (max-width: 991.98px) {
	.gallery { padding-top: 60px; padding-bottom: 60px; }
	.gallery__head { margin-bottom: 32px; }
	.gallery--grid-3 .gallery__grid { grid-template-columns: repeat(2, 1fr); }
	.gallery--grid-2 .gallery__grid,
	.gallery--grid-3 .gallery__grid { gap: 20px; }
	.gallery--masonry .gallery__grid { columns: 2; column-gap: 20px; }
	.gallery--masonry .gallery__item { margin-bottom: 20px; }
	.gallery__zoom { opacity: 1; width: 40px; height: 40px; left: 12px; bottom: 12px; }
}
@media (max-width: 575.98px) {
	.gallery__main { aspect-ratio: 4 / 3; }
	.gallery__nav { right: 12px; top: 12px; }
	.gallery__nav-arrow { width: 40px; height: 40px; font-size: 16px; }
	.gallery__thumb { width: 72px; height: 72px; border-radius: 12px; }
	.gallery--grid-2 .gallery__grid,
	.gallery--grid-3 .gallery__grid { grid-template-columns: 1fr; }
	.marcoeco-lightbox__nav { top: auto; bottom: 24px; transform: none; }
}
