/*
 * بارگذاری خودکار محصولات با اسکرول.
 *
 * `body.gs-inf` is added by the script, so none of this applies when the
 * script did not run: the numbered pagination is only hidden once something
 * is there to replace it.
 */

/* Hidden, not removed — the links stay for crawlers and for assistive tech
   that is following the listing by page. */
body.gs-inf nav.woocommerce-pagination {
	display: none;
}

.gs-inf__status {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 56px;
	margin: 18px 0 6px;
	color: #5a4014;
	font-size: 15px;
	text-align: center;
	direction: rtl;
}

/* Idle is the normal state: the listing simply keeps going, so there is
   nothing to say and nothing to reserve room for. */
.gs-inf__status.is-idle {
	min-height: 0;
	margin: 0;
}

.gs-inf__status.is-failed {
	cursor: pointer;
	color: #8a2b2b;
}

.gs-inf__status.is-end .gs-inf__text {
	color: #6f5a34;
	font-size: 14px;
	opacity: .8;
}

.gs-inf__spinner {
	display: none;
	width: 22px;
	height: 22px;
	border: 2px solid rgba( 216, 174, 109, .35 );
	border-top-color: #1a3b24;
	border-radius: 50%;
	animation: gs-inf-spin .8s linear infinite;
}

.gs-inf__status.is-loading .gs-inf__spinner {
	display: block;
}

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

/* The fade is on the tile's own transition, so a customer scrolling fast
   never waits on it — the products are in the document either way. */
.products > li.product {
	transition: opacity .35s ease, transform .35s ease;
}

.products > li.product.gs-inf__new {
	opacity: 0;
	transform: translateY( 12px );
}

@media ( prefers-reduced-motion: reduce ) {
	.products > li.product,
	.products > li.product.gs-inf__new {
		transition: none;
		opacity: 1;
		transform: none;
	}

	.gs-inf__spinner {
		animation-duration: 2s;
	}
}
