/**
 * Smart Dynamic Product Rotator - frontend grid styles.
 * Uses CSS grid auto-fill so card sizing stays uniform regardless of
 * whether a section shows 4, 8, or N products.
 */

.sp-rotator-section {
	margin: 32px 0;
}

.sp-rotator-title {
	margin: 0 0 16px;
	font-size: 22px;
	line-height: 1.3;
}

.sp-rotator-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
	width: 100%;
	list-style: none;
	margin: 0;
	padding: 0;
}

.sp-rotator-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	margin: 0;
	width: auto;
	float: none;
}

.sp-rotator-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.sp-rotator-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.sp-rotator-card__image {
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f6f6f6;
}

.sp-rotator-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sp-rotator-card__title {
	margin: 12px 12px 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	/* Clamp to 2 lines so uneven product-name lengths don't break card heights. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sp-rotator-card__price {
	margin: 0 12px 14px;
	font-size: 14px;
	font-weight: 600;
	color: #333;
}

@media (max-width: 782px) {
	.sp-rotator-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
}

@media (max-width: 400px) {
	.sp-rotator-grid {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
}