/* Astra makes .site-content .ast-container a flex row; the catalogue is its
   only child and must take the full width. */
.sd-catalog,
.sd-category-index {
	flex: 1 1 100%;
	width: 100%;
	min-width: 0;
}

/* Category index (shop page) */

.sd-category-index__header {
	max-width: 46rem;
	margin: 0 auto 2.5rem;
	text-align: center;
}

.sd-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
	gap: 1.5rem;
	margin: 0 0 3rem;
	padding: 0;
	list-style: none;
}

.sd-category-card {
	margin: 0;
}

.sd-category-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
	color: inherit;
	text-decoration: none;
	transition: box-shadow .2s ease, transform .2s ease;
}

.sd-category-card__link:hover,
.sd-category-card__link:focus-visible {
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	transform: translateY(-2px);
}

.sd-category-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	background: #f2f0ed;
}

.sd-category-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sd-category-card__body {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	padding: 1.1rem 1.25rem 1.35rem;
}

.sd-category-card__name {
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.25;
}

.sd-category-card__descriptor {
	font-size: .95rem;
	opacity: .78;
}

.sd-category-card__count {
	margin-top: .15rem;
	font-size: .8rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .55;
}

/* Category archive hero */

.sd-cat-hero {
	margin: 0 0 1.75rem;
}

/* Full-bleed banner.
   seifdesign-utils constrains .ast-container to 90vw, so the hero is inset by
   a 5% gutter each side. Rather than fight that with viewport-unit breakout
   (which misaligns by the scrollbar width), let the container itself run full
   width on product archives - the same approach the plugin uses for its own
   page banners - and keep the image at a plain 100%. */
.sd-cat-hero__media {
	position: relative;
	width: 100%;
	aspect-ratio: 21 / 6;
	min-height: 11rem;
	overflow: hidden;
	background: #f2f0ed;
}

.sd-cat-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sd-cat-hero__body {
	max-width: 46rem;
	margin: 1.4rem auto 0;
	padding: 0 1rem;
	text-align: center;
}

.sd-cat-hero.no-image .sd-cat-hero__body {
	margin-top: 0;
}

.sd-cat-hero__title {
	margin: 0 0 .35rem;
	line-height: 1.15;
}

.sd-cat-hero__descriptor {
	margin: 0;
	font-size: 1.05rem;
	opacity: .78;
}

/* Filter bar */

.sd-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 1.25rem 2rem;
	max-width: 68rem;
	margin: 0 auto 2rem;
	padding: 1rem;
	border-top: 1px solid rgba(0, 0, 0, .09);
	border-bottom: 1px solid rgba(0, 0, 0, .09);
}

.sd-filters__group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	min-width: 0;
}

.sd-filters__label {
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .6;
}

.sd-filters__options {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sd-filters__options li {
	margin: 0;
}

.sd-filters__chip {
	display: inline-flex;
	align-items: baseline;
	gap: .35rem;
	padding: .32rem .7rem;
	border: 1px solid rgba(0, 0, 0, .16);
	border-radius: 999px;
	font-size: .88rem;
	line-height: 1.3;
	color: inherit;
	text-decoration: none;
	transition: border-color .15s ease, background-color .15s ease;
}

.sd-filters__chip:hover,
.sd-filters__chip:focus-visible {
	border-color: rgba(0, 0, 0, .45);
}

.sd-filters__chip.is-active {
	border-color: #1a1a1a;
	background: #1a1a1a;
	color: #fff;
}

.sd-filters__chip-count {
	font-size: .75rem;
	opacity: .6;
}

/* Swatches on filter chips.
   Reuses the artwork set on the attribute term by seifdesign-swatches, so a
   chip shows the same stone/wood/shape as the product page. Terms without
   artwork keep the plain text chip, so the bar stays mixed-safe. */

.sd-filters__chip.has-swatch {
	align-items: center;
	gap: .45rem;
	padding: .28rem .7rem .28rem .32rem;
}

.sd-filters__swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1.55rem;
	height: 1.55rem;
	overflow: hidden;
	border-radius: 50%;
}

/* Material photos read as material at this size, so fill the circle. */
.sd-filters__swatch--image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sd-filters__swatch--color {
	background: var(--sd-swatch-color, transparent);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}

/* Shape SVGs are Inkscape line art: outlines drawn with `stroke:#000000` in an
   inline style attribute, sized in mm. So the colour has to be forced with
   !important (an inline style outranks a stylesheet otherwise), it has to go on
   `stroke` rather than `fill` (the shapes are `fill:none` - filling them would
   produce solid blobs), and the mm dimensions have to be overridden or the icon
   renders at a physical size. viewBox keeps the aspect ratio intact. */
.sd-filters__swatch--svg {
	border-radius: 0;
	color: inherit;
}

.sd-filters__swatch--svg svg {
	width: 100%;
	height: 100%;
	display: block;
	overflow: visible;
}

.sd-filters__swatch--svg svg [style*="stroke"],
.sd-filters__swatch--svg svg path,
.sd-filters__swatch--svg svg rect,
.sd-filters__swatch--svg svg circle,
.sd-filters__swatch--svg svg ellipse,
.sd-filters__swatch--svg svg polygon,
.sd-filters__swatch--svg svg polyline,
.sd-filters__swatch--svg svg line {
	stroke: currentColor !important;
	vector-effect: non-scaling-stroke;
}

/* Inkscape layers can carry display:none on a hidden sublayer; the shapes here
   use `display:inline` explicitly, so leave display alone and only force the
   colour. */

/* A photo inside a dark active chip needs a rim to stay legible. */
.sd-filters__chip.is-active .sd-filters__swatch--image,
.sd-filters__chip.is-active .sd-filters__swatch--color {
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.sd-filters__reset {
	align-self: center;
	margin-left: auto;
	font-size: .85rem;
	text-decoration: underline;
	opacity: .7;
}

.sd-catalog__empty {
	max-width: 46rem;
	margin: 2rem auto;
	text-align: center;
}

@media (max-width: 600px) {
	.sd-filters {
		gap: .9rem 1rem;
	}

	.sd-filters__group {
		width: 100%;
		align-items: flex-start;
		flex-direction: column;
		gap: .4rem;
	}

	.sd-filters__reset {
		margin-left: 0;
	}

	.sd-cat-hero__media {
		aspect-ratio: 16 / 9;
	}
}
