/*
 * Hubka Theme
 *
 * Phase: 12E — New Arrivals: Rail Conversion + Link Fix
 * Purpose: Visual polish for the New Arrivals pattern's presentation
 * only — grid spacing and no-results integration. The Book Card it
 * renders is styled exclusively in components/book-card.css, not
 * duplicated here.
 *
 * Revision note: the product template is now a horizontal scroll-snap
 * rail (CSS-only, no JS) instead of a wrapped grid — confirmed real
 * DOM from live rendering: Product Collection's product-template
 * renders as `<ul class="wc-block-product-template"><li class="wc-block-product">`,
 * so the rail targets that `<li>` directly rather than a generic child
 * selector. Degrades to look identical to a normal row when the
 * catalog has few items; scrolls once there are more — the
 * differentiator from Featured Collection's fixed grid above it, per
 * HOMEPAGE_EDITORIAL_SPEC.md. Native scrollbar kept visible
 * (not hidden) for accessibility/discoverability, consistent with the
 * project's "focus states always visible" accessibility stance.
 *
 * Rules:
 * - Reuse theme.json tokens.
 * - Use logical properties.
 * - Keep selectors shallow.
 * - Do not duplicate component styling.
 */

.hubka-new-arrivals__grid {
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}

.hubka-new-arrivals__grid .wc-block-product-template {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	gap: var(--wp--preset--spacing--50);
	padding-block-end: var(--wp--preset--spacing--20);
}

.hubka-new-arrivals__grid .wc-block-product-template > li {
	flex: 0 0 auto;
	inline-size: min(80vw, 16rem);
	scroll-snap-align: start;
}

/* Same reasoning as featured-collection.css's identical rule: the <li>
 * cells stretch to equal height already, but the `.wp-block-template-part`
 * div WordPress wraps Book Card in doesn't inherit that height on its
 * own, leaving Book Card's own block-size:100% with nothing definite to
 * resolve against. */
.hubka-new-arrivals__grid .wc-block-product-template > li > .wp-block-template-part {
	block-size: 100%;
}

.hubka-new-arrivals__grid .wp-block-woocommerce-product-collection-no-results {
	padding-block: var(--wp--preset--spacing--50);
	text-align: center;
}
