/* Home category wall as round image links (genesis-b2b-jfzf.11); the same look
 * for the sub-category tiles of category pages (genesis-b2b-jfzf.14).
 * Loaded by catalog/controller/extension/module/oct_category_wall.php and
 * catalog/controller/product/category.php.
 * Assumes show_sub_categories off: only the leaf branch (a.content-block) is
 * styled; the div.content-block branch with sub-category chips is not.
 * !important only overrides theme utilities that carry it:
 * .align-items-start, .d-inline-block, .ps-3, .fsz-14 (wall) and .p-2, .h-100,
 * .fsz-12 and the theme's flex-direction: row below 768px (sub-category tiles,
 * see the sub-only rules). */

#common-home .ds-category-wall,
#product-category .ds-subcategories {
	display: flex;
	flex-wrap: nowrap;
	margin: 0;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 4px;
	/* genesis-b2b-jfzf.12: Chromium scrolls on focus only when the link is wholly
	 * outside the snapport, never when it is partly cut. 92px = 88px link + 4px
	 * focus ring, so a link whose ring is cut lies outside the snapport and Tab
	 * scrolls it in; the items' -88px scroll-margin keeps the start snap at 4px. */
	scroll-padding: 4px 92px;
	scrollbar-width: none;
}

#common-home .ds-category-wall::-webkit-scrollbar,
#product-category .ds-subcategories::-webkit-scrollbar {
	display: none;
}

#common-home .ds-category-wall .ds-category-wall-item,
#product-category .ds-subcategories .ds-subcategories-item {
	flex: 0 0 88px;
	min-width: 0;
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
	scroll-margin-inline-start: -88px;
}

#common-home .ds-category-wall a.content-block,
#product-category .ds-subcategories a.content-block {
	flex-direction: column;
	align-items: center !important;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	text-decoration: none;
}

#product-category .ds-subcategories .ds-subcategories-item {
	max-width: none;
}

#product-category .ds-subcategories a.content-block {
	flex-direction: column !important;
	padding: 0 !important;
	height: auto !important;
}

#common-home .ds-category-wall a.content-block:focus-visible,
#product-category .ds-subcategories a.content-block:focus-visible {
	outline: 2px solid var(--ds-primary-color);
	outline-offset: 2px;
}

#common-home .ds-category-wall a.content-block img,
#product-category .ds-subcategories a.content-block img {
	width: 72px;
	height: auto;
	margin: 0 auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 50%;
	border: 2px solid var(--ds-primary-color);
	padding: 3px;
	background: var(--ds-white-color);
}

#common-home .ds-category-wall .ds-category-wall-title,
#product-category .ds-subcategories .ds-subcategories-title {
	display: -webkit-box !important;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	width: 100%;
	margin-top: .5rem;
	padding-left: 0 !important;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
}

@media (max-width: 991.98px) {
	#common-home .ds-category-wall .ds-category-wall-title,
	#product-category .ds-subcategories .ds-subcategories-title {
		font-size: .75rem !important;
	}
}

@media (min-width: 992px) {
	#common-home .ds-category-wall {
		justify-content: space-between;
	}

	#common-home .ds-category-wall .ds-category-wall-item {
		flex: 1 1 0;
		max-width: 128px;
	}

	#common-home .ds-category-wall a.content-block img,
	#product-category .ds-subcategories a.content-block img {
		width: 100%;
	}

	#common-home .ds-category-wall .ds-category-wall-title {
		font-size: .875rem;
	}

	/* Sub-category row: fixed 128px tiles from the left, wrapping, no scroll. */
	#product-category .ds-subcategories {
		flex-wrap: wrap;
		justify-content: flex-start;
		overflow: visible;
	}

	#product-category .ds-subcategories .ds-subcategories-item {
		flex: 0 0 128px;
	}

	#product-category .ds-subcategories .ds-subcategories-title {
		font-size: .875rem !important;
	}
}
