.pje-gallery-section {
	position: relative;
	background: #111214;
	padding: 90px 24px 140px;
	overflow: hidden;
}

.pje-gallery-header {
	text-align: center;
	margin-bottom: 50px;
	position: relative;
	z-index: 2;
}

.pje-gallery-header h2 {
	color: #fff;
	font-size: 34px;
	font-weight: 600;
	margin: 0;
	letter-spacing: 0.02em;
}

.pje-gallery-header p {
	color: rgba(255, 255, 255, 0.55);
	margin: 10px 0 0;
	font-size: 15px;
}

.pje-iso-stage {
	max-width: 1320px;
	margin: 0 auto;
	position: relative;
}

/* Patron de rejilla de fondo (evoca el "suelo" isometrico sin
   transformar el DOM en 3D, que resulto poco fiable entre navegadores). */
.pje-gallery-grid {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 55px 40px;
	padding: 60px 40px;
	background-image:
		repeating-linear-gradient(25deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 90px),
		repeating-linear-gradient(-25deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 90px);
}

.pje-tile {
	--tilt: 0deg;
	--ty: 0px;
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 3 / 4;
	box-shadow: 0 25px 45px rgba(0, 0, 0, 0.5);
	transform: rotate(var(--tilt)) translateY(var(--ty));
	opacity: 0;
	transition: opacity 0.8s ease, box-shadow 0.3s ease;
	will-change: transform;
}

.pje-tile.is-visible {
	opacity: 1;
}

.pje-tile:nth-child(4n+2) { aspect-ratio: 4 / 3; }
.pje-tile:nth-child(4n+3) { aspect-ratio: 1 / 1; }

.pje-tile:hover {
	box-shadow: 0 35px 60px rgba(0, 0, 0, 0.65);
	z-index: 3;
}

.pje-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pje-gallery-empty {
	text-align: center;
	color: rgba(255, 255, 255, 0.5);
	grid-column: 1 / -1;
	padding: 40px 0;
	font-size: 15px;
	transform: none;
}

@media (max-width: 900px) {
	.pje-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 18px;
		padding: 0;
		background-image: none;
	}
	.pje-tile {
		transform: none !important;
		box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
	}
	.pje-gallery-header h2 { font-size: 26px; }
}

/* -------- Lightbox (visor ampliado) -------- */
.pje-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(6, 6, 8, 0.97);
	-webkit-backdrop-filter: blur(18px) saturate(1.15);
	backdrop-filter: blur(18px) saturate(1.15);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease;
}
.pje-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.pje-lightbox-topbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	padding: 22px 24px;
	z-index: 3;
}
.pje-lightbox-counter {
	color: rgba(255, 255, 255, 0.6);
	font-size: 13px;
	letter-spacing: 0.05em;
	font-variant-numeric: tabular-nums;
	margin-right: auto;
}
.pje-lightbox-close {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}
.pje-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.18);
	transform: scale(1.06);
}

.pje-lightbox-stage {
	position: relative;
	width: 100%;
	max-width: 1300px;
	height: 78vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 90px;
	box-sizing: border-box;
}

.pje-lightbox-imgwrap {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pje-lightbox-imgwrap img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 10px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 0.35s ease, transform 0.35s ease;
}
.pje-lightbox-imgwrap img.is-loaded {
	opacity: 1;
	transform: scale(1);
}

.pje-lightbox-spinner {
	position: absolute;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.18);
	border-top-color: rgba(255, 255, 255, 0.75);
	animation: pje-spin 0.8s linear infinite;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}
.pje-lightbox-spinner.is-active { opacity: 1; }
@keyframes pje-spin { to { transform: rotate(360deg); } }

.pje-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.06);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}
.pje-lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.16);
	transform: translateY(-50%) scale(1.08);
}
.pje-lightbox-nav:active { transform: translateY(-50%) scale(0.96); }
.pje-lightbox-prev { left: 16px; }
.pje-lightbox-next { right: 16px; }

.pje-lightbox-filmstrip {
	display: flex;
	gap: 10px;
	margin-top: 22px;
	max-width: 92vw;
	overflow-x: auto;
	padding: 6px;
	scrollbar-width: none;
}
.pje-lightbox-filmstrip::-webkit-scrollbar { display: none; }
.pje-lightbox-filmstrip img {
	width: 68px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	opacity: 0.45;
	cursor: pointer;
	border: 2px solid transparent;
	transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
	flex: 0 0 auto;
}
.pje-lightbox-filmstrip img:hover { opacity: 0.8; }
.pje-lightbox-filmstrip img.is-active {
	opacity: 1;
	border-color: #fff;
	transform: scale(1.08);
}

@media (max-width: 700px) {
	.pje-lightbox-stage { padding: 0 46px; height: 68vh; }
	.pje-lightbox-nav { width: 40px; height: 40px; font-size: 18px; }
	.pje-lightbox-prev { left: 6px; }
	.pje-lightbox-next { right: 6px; }
	.pje-lightbox-filmstrip img { width: 52px; height: 38px; }
}
