/* =========================================================
   Photo Gallery Widgets para Elementor
   ========================================================= */

/* ---------- Contenedor de imagen uniforme (grid y carrusel) ----------
   Se usa la técnica "padding-top: 100%" en vez de aspect-ratio, porque
   es compatible con todos los navegadores y no depende de que el tema
   de WordPress respete aspect-ratio. Esto garantiza que TODAS las fotos
   -sin importar su tamaño u orientación original- ocupen exactamente
   la misma caja cuadrada (hasta 1200x1200px), tanto en la grilla como
   en el carrusel. */
.pge-image-wrap {
	position: relative;
	width: 100%;
	max-width: 1200px;
	height: 0;
	padding-top: 100%; /* fuerza proporción 1:1 */
	margin: 0 auto;
	overflow: hidden;
	background-color: #f2f2f2;
	cursor: pointer;
}

.pge-image-wrap img {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: var(--pge-fit, cover) !important;
	object-position: center center !important;
	display: block;
	margin: 0 !important;
	transition: transform .35s ease;
}

.pge-image-wrap:hover img {
	transform: scale(1.04);
}

/* ---------- Grilla ---------- */
.pge-grid-wrapper {
	width: 100%;
}

.pge-grid {
	display: grid;
	grid-template-columns: repeat(var(--pge-columns, 3), 1fr);
	gap: var(--pge-gap, 16px);
}

.pge-load-more-wrap {
	text-align: center;
	margin-top: 24px;
}

.pge-load-more-btn {
	cursor: pointer;
	border: none;
	padding: 12px 28px;
	font-size: 15px;
	border-radius: 4px;
	background-color: #222222;
	color: #ffffff;
	transition: opacity .2s ease;
}

.pge-load-more-btn:hover {
	opacity: .85;
}

/* ---------- Carrusel ---------- */
.pge-carousel-wrapper {
	position: relative;
	width: 100%;
}

.pge-carousel {
	overflow: hidden;
	width: 100%;
}

.pge-carousel-track {
	display: flex;
	transition: transform .4s ease;
}

.pge-carousel-slide {
	flex: 0 0 calc((100% - (var(--pge-slides, 3) - 1) * var(--pge-gap, 16px)) / var(--pge-slides, 3));
	margin-right: var(--pge-gap, 16px);
	box-sizing: border-box;
}

.pge-carousel-slide:last-child {
	margin-right: 0;
}

.pge-carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	background-color: var(--pge-arrow-bg, rgba(0, 0, 0, .5));
	color: var(--pge-arrow-color, #ffffff);
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.pge-arrow-prev {
	left: 10px;
}

.pge-arrow-next {
	right: 10px;
}

.pge-carousel-arrow:hover {
	opacity: .85;
}

.pge-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}

.pge-carousel-dot {
	width: 10px;
	height: 10px;
	border-radius: var(--pge-dot-radius, 50%);
	background-color: var(--pge-dot-color, #cccccc);
	cursor: pointer;
	border: none;
	padding: 0;
	transition: background-color .2s ease, border-radius .2s ease;
}

.pge-carousel-dot:hover {
	background-color: var(--pge-dot-hover-color, var(--pge-dot-color, #cccccc));
}

.pge-carousel-dot.active {
	background-color: var(--pge-dot-active-color, #222222);
}

/* ---------- Modal / Lightbox ---------- */
.pge-modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .92);
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

.pge-modal.pge-modal-open {
	display: flex;
}

.pge-modal-img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 4px;
}

.pge-modal-close {
	position: absolute;
	top: 20px;
	right: 30px;
	color: #ffffff;
	font-size: 36px;
	cursor: pointer;
	line-height: 1;
}

.pge-modal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, .15);
	border: none;
	color: #ffffff;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	font-size: 20px;
	cursor: pointer;
}

.pge-modal-prev {
	left: 20px;
}

.pge-modal-next {
	right: 20px;
}

.pge-modal-nav:hover {
	background: rgba(255, 255, 255, .3);
}

@media (max-width: 767px) {
	.pge-modal-nav {
		width: 38px;
		height: 38px;
		font-size: 16px;
	}

	.pge-carousel-arrow {
		width: 34px;
		height: 34px;
		font-size: 14px;
	}
}
