/*
 * Casetti: phones, the shop and category lists: three rows of two cards, then one large card across the width
 * (inc/site/shop-feature.php). The 7th, 14th, 21st … card spans both columns; a last card alone in its row too.
 */
@media (max-width: 700px) {
	.casetti-shop-feature ul.products > li.product:nth-child(7n),
	.casetti-shop-feature ul.products > li.product:nth-child(7n+1):last-child,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+3):last-child,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+5):last-child {
		grid-column: 1 / -1;
		margin: 8px 0;
	}

	.casetti-shop-feature ul.products > li.product:nth-child(7n) .myco-card-media,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+1):last-child .myco-card-media,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+3):last-child .myco-card-media,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+5):last-child .myco-card-media {
		aspect-ratio: 1 / 1;
		margin-bottom: 14px;
	}

	.casetti-shop-feature ul.products > li.product:nth-child(7n) .c-card-cat,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+1):last-child .c-card-cat,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+3):last-child .c-card-cat,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+5):last-child .c-card-cat {
		margin-inline: 16px;
		font-size: 11px;
	}

	.casetti-shop-feature ul.products > li.product:nth-child(7n) .woocommerce-loop-product__title,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+1):last-child .woocommerce-loop-product__title,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+3):last-child .woocommerce-loop-product__title,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+5):last-child .woocommerce-loop-product__title {
		min-height: 0;
		margin: 2px 16px 4px;
		font-size: 18px;
		line-height: 1.35;
	}

	.casetti-shop-feature ul.products > li.product:nth-child(7n) .price,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+1):last-child .price,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+3):last-child .price,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+5):last-child .price {
		margin-inline: 16px;
		font-size: 16px;
	}

	.casetti-shop-feature ul.products > li.product:nth-child(7n) .button,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+1):last-child .button,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+3):last-child .button,
	.casetti-shop-feature ul.products > li.product:nth-child(7n+5):last-child .button {
		margin: 10px 16px 18px;
	}
}

/* The large cards' swipe gallery (shop-feature.js; body.casetti-card-gallery): the pictures side by side in a track,
   under the picture a small grey pill of dots: how many there are, the one showing drawn long. */
.woocommerce ul.products li.product.cf-has .cf-track {
	display: flex;
	width: 100%;
	height: 100%;
	transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.woocommerce ul.products li.product.cf-has .cf-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
}

.woocommerce ul.products li.product.cf-has .cf-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: none !important;
}

.woocommerce ul.products li.product.cf-on {
	touch-action: pan-y;
}

.woocommerce ul.products li.product .cf-dots {
	display: flex;
	align-items: center;
	gap: 4px;
	width: max-content;
	margin: -2px auto 10px;
	padding: 4px 6px;
	border-radius: 999px;
	background: #c9c9c9;
	pointer-events: none;
}

.woocommerce ul.products li.product:not(.cf-on) .cf-dots {
	display: none;
}

.woocommerce ul.products li.product .cf-dot {
	display: block;
	width: 4px;
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.75);
	transition: width 0.25s ease, background-color 0.25s ease;
}

.woocommerce ul.products li.product .cf-dot.is-on {
	width: 14px;
	background: #fff;
}

/* The small cards (two in a row): a smaller pill. */
@media (max-width: 700px) {
	.woocommerce ul.products li.product:not(:nth-child(7n)) .cf-dots {
		gap: 3px;
		margin: -4px auto 6px;
		padding: 3px 5px;
	}

	.woocommerce ul.products li.product:not(:nth-child(7n)) .cf-dot {
		width: 3px;
		height: 3px;
	}

	.woocommerce ul.products li.product:not(:nth-child(7n)) .cf-dot.is-on {
		width: 10px;
	}
}
