/* ── Producto Galería ────────────────────────────────────────────────────── */

.nole-producto-galeria {
	width: 100%;
}

.nole-producto-galeria__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( var( --nole-producto-galeria-cols, 3 ), 1fr );
	gap: 12px;
}

@media ( max-width: 900px ) {
	.nole-producto-galeria__grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 540px ) {
	.nole-producto-galeria__grid {
		grid-template-columns: 1fr;
	}
}

.nole-producto-galeria__item {
	margin: 0;
	padding: 0;
}

.nole-producto-galeria__figure {
	margin: 0;
	overflow: hidden;
	border-radius: 4px;
	line-height: 0;
	aspect-ratio: 4 / 3;
}

.nole-producto-galeria__link {
	display: block;
	width: 100%;
	height: 100%;
}

.nole-producto-galeria__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.nole-producto-galeria__figure:hover .nole-producto-galeria__img {
	transform: scale( 1.04 );
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */

#nole-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
}

#nole-lightbox.is-open {
	display: flex;
}

.nole-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.88 );
}

.nole-lightbox__container {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 92vw;
	max-height: 92vh;
}

.nole-lightbox__img {
	display: block;
	max-width: 92vw;
	max-height: 92vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	opacity: 0;
	transition: opacity 0.25s ease;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.6 );
}

.nole-lightbox__img.is-loaded {
	opacity: 1;
}

/* Spinner de carga */
.nole-lightbox__loader {
	position: absolute;
	width: 40px;
	height: 40px;
	border: 3px solid rgba( 255, 255, 255, 0.2 );
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: nole-spin 0.7s linear infinite;
}

@keyframes nole-spin {
	to { transform: rotate( 360deg ); }
}

/* Botón cerrar */
.nole-lightbox__close {
	position: absolute;
	top: -44px;
	right: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: #ffffff;
	padding: 8px;
	line-height: 0;
	opacity: 0.8;
	transition: opacity 0.2s ease;
}

.nole-lightbox__close:hover {
	opacity: 1;
}

/* ── Placeholder en el editor ────────────────────────────────────────────── */

.nole-producto-galeria-editor__placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	background: #f0f0f0;
	border: 2px dashed #ccc;
	border-radius: 4px;
	color: #555;
	text-align: center;
}

.nole-producto-galeria-editor__placeholder .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	margin-bottom: 8px;
}
