/*
	Estilos de la carga progresiva del listado paginado (fase 2, SPEC B). Fuera del bundle
	MINIFY: se carga aparte, versionado por filemtime (_product_listing.php).
*/

/* Oculto visualmente pero disponible para lectores de pantalla (h2 y región de anuncios) */
.lp-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

#lp-listing {
	/* Evita que el scroll-anchoring del navegador compense el desplazamiento al insertar
	   bloques por arriba («Ver anteriores»): la compensación la hace el propio JS */
	overflow-anchor: none;
}

.lp-sentinel {
	height: 1px;
}

.lp-prev {
	display: block;
	text-align: center;
	padding: 12px 0;
	color: var(--verde-color, #39ba4e);
	font-weight: 600;
	text-decoration: underline;
}

.lp-prev:focus-visible {
	outline: 2px solid var(--verde-color, #39ba4e);
	outline-offset: 2px;
}

/* Bloques cargados por JS: content-visibility para no pagar el layout/paint de todo lo
   acumulado. El primer bloque (servido por el servidor) NO lleva esta clase. La altura la
   fija el JS con --lp-page-height midiendo el primer bloque real una vez al arrancar */
.lp-page-loaded {
	content-visibility: auto;
	contain-intrinsic-size: auto var(--lp-page-height, 2400px);
}

/* Esqueletos mientras carga --------------------------------------------------------------- */
.lp-skeleton {
	box-sizing: border-box;
}

.lp-skeleton-box {
	height: 100%;
	background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
	background-size: 400% 100%;
	border-radius: 8px;
	animation: lp-shimmer 1.4s ease infinite;
}

@keyframes lp-shimmer {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
	.lp-skeleton-box {
		animation: none;
		background: #eee;
	}
}

/* Bloque de progreso: contador + barra + botón -------------------------------------------- */
.lp-progress {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 24px 15px 30px;
	text-align: center;
}

.lp-counter {
	margin: 0;
	font-size: 15px;
	color: #555;
}

.lp-bar {
	width: 100%;
	max-width: 420px;
	height: 6px;
	background: #eee;
	border-radius: 3px;
	overflow: hidden;
}

.lp-bar span {
	display: block;
	height: 100%;
	background: var(--verde-color, #39ba4e);
	transition: width 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
	.lp-bar span {
		transition: none;
	}
}

.lp-end {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #666;
}

.lp-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 56px;
	min-width: 320px;
	padding: 0 44px;
	background-color: var(--verde-color, #39ba4e);
	color: #fff;
	text-align: center;
	text-transform: uppercase;
	font-weight: 400;
	font-size: 19px;
	letter-spacing: 0.5px;
	/* Sin «inherit» en la lista: invalidaba la declaración entera y salía Open Sans */
	font-family: "Boris Black Bloxx", "Arial Black", sans-serif;
	text-decoration: none;
	border-radius: 4px;
	box-shadow: 0 8px 22px rgba(57, 186, 78, 0.3);
	cursor: pointer;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.lp-more[aria-disabled="true"] {
	pointer-events: none;
}

.lp-more[aria-disabled="true"]:not(.lp-loading) {
	opacity: 0.6;
}

.lp-more:hover,
.lp-more:focus {
	color: #fff;
	transform: translateY(-2px);
}

.lp-more:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

/* «Cargando…» con spinner mientras llegan las páginas pedidas con el botón */
.lp-more.lp-loading::before {
	content: "";
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: lp-spin 0.7s linear infinite;
}

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

/* Las tarjetas nuevas aparecen escalonadas (solo opacity/transform: sin CLS) */
.lp-card-in {
	animation: lp-card-in 0.4s ease both;
	animation-delay: calc(var(--lp-i, 0) * 35ms);
}

@keyframes lp-card-in {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.lp-more.lp-loading::before { animation-duration: 2s; }
	.lp-card-in { animation: none; }
	.lp-more:hover, .lp-more:focus { transform: none; }
}

/* Con JS el botón sustituye al paginador numérico: se oculta pero sigue en el HTML, así que
   los enlaces 1 2 3… siguen ahí para Google y para quien navega sin JS (el JS pone la clase) */
html.lp-js #pgnc {
	display: none !important; /* #pgnc lleva .d-flex de Bootstrap, que ya usa !important */
}

@media (max-width: 767.98px) {
	.lp-progress {
		padding-left: 8px;
		padding-right: 8px;
	}

	.lp-more {
		width: 100%;
		min-width: 0;
		max-width: 420px;
		font-size: 18px;
	}
}

/* «Volver arriba» (SPEC B11): abajo a la izquierda para no tapar la cesta (.dty-cart-toast,
   bottom/right:20px) ni el aviso de favoritos (#fvrt-show, bottom/right:10px) */
.lp-top {
	position: fixed;
	left: 16px;
	bottom: 20px;
	z-index: 9500;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	background: #222;
	color: #fff;
	border: 0;
	border-radius: 22px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.lp-top:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.lp-top[hidden] {
	display: none;
}
