/**
 * DeShop — shop.css
 *
 * Product archives: header, category chips, toolbar, active filters,
 * filter panel (sidebar ≥1024px, drawer below) and pagination.
 *
 * @package DeShop
 */

.shop-header {
	margin-bottom: var(--ds-space-lg);
}

/* Category chips ---------------------------------------------------------- */

.shop-chips {
	margin-bottom: var(--ds-space-xl);
}

.shop-chips__list {
	display: flex;
	gap: var(--ds-space-xs);
	margin: 0 calc(var(--ds-gutter) * -1);
	padding: 2px var(--ds-gutter);
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	list-style: none;
}

.shop-chips__list::-webkit-scrollbar {
	display: none;
}

.shop-chips__list > li {
	flex-shrink: 0;
	scroll-snap-align: start;
}

@media (min-width: 768px) {
	.shop-chips__list {
		flex-wrap: wrap;
		justify-content: center;
		margin: 0;
		padding: 0;
		overflow: visible;
	}
}

/* Toolbar ------------------------------------------------------------------ */

.shop-toolbar {
	display: flex;
	align-items: center;
	gap: var(--ds-space-sm);
	padding-block: var(--ds-space-sm);
	border-block: 1px solid var(--ds-border);
	margin-bottom: var(--ds-space-lg);
}

.shop-toolbar__results {
	flex: 1;
	color: var(--ds-text-muted);
	font-size: var(--ds-fs-sm);
}

.shop-toolbar__count {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: var(--ds-radius-full);
	background: var(--ds-primary);
	color: var(--ds-on-primary);
	font-size: 11px;
}

.shop-toolbar__filter:hover .shop-toolbar__count {
	background: var(--ds-surface);
	color: var(--ds-primary);
}

.shop-toolbar__sort .woocommerce-ordering {
	margin: 0;
}

.shop-toolbar__sort select {
	min-height: 40px;
	padding-block: 0.5rem;
	border-color: transparent;
	background-color: transparent;
	font-size: var(--ds-fs-sm);
	font-weight: 500;
	text-align: end;
	cursor: pointer;
}

.shop-toolbar__sort select:hover {
	border-color: var(--ds-border);
}

@media (max-width: 767.98px) {
	.shop-toolbar {
		flex-wrap: wrap;
	}

	.shop-toolbar__results {
		order: 3;
		flex-basis: 100%;
		font-size: var(--ds-fs-xs);
	}

	.shop-toolbar__sort {
		flex: 1;
		display: flex;
		justify-content: flex-end;
	}

	.shop-toolbar__sort select {
		max-width: 200px;
	}
}

/* The sort sheet button shows on phones only (mobile.css). */
.shop-toolbar__sort-btn {
	display: none;
}

/* Sort sheet ------------------------------------------------------------------------ */

.sort-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--ds-space-xs) var(--ds-space-xs) 0 var(--ds-space-lg);
}

.sort-sheet__title {
	font-size: var(--ds-fs-xl);
}

.sort-sheet__list {
	margin: 0;
	padding: var(--ds-space-xs) var(--ds-space-lg) var(--ds-space-lg);
	list-style: none;
}

.sort-sheet__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 52px;
	border-bottom: 1px solid var(--ds-border);
	color: var(--ds-text);
	text-decoration: none;
}

.sort-sheet__option.is-active {
	color: var(--ds-primary);
	font-weight: 600;
}

/* Active filters -------------------------------------------------------------- */

.shop-active {
	margin-bottom: var(--ds-space-lg);
}

.shop-active__list {
	margin: 0;
	padding: 0;
	list-style: none;
	--ds-cluster-gap: var(--ds-space-xs);
}

.shop-active__chip {
	min-height: 32px;
	padding-inline: 0.75rem 0.625rem;
	font-size: var(--ds-fs-xs);
}

.shop-active__clear {
	font-size: var(--ds-fs-xs);
}

/* Layout ---------------------------------------------------------------------- */

@media (min-width: 1024px) {
	.shop-filters-sidebar .shop-layout {
		display: grid;
		grid-template-columns: 240px minmax(0, 1fr);
		gap: var(--ds-space-2xl);
		align-items: start;
	}

	/* The sidebar shows the grid with one column fewer. */
	.shop-filters-sidebar .shop-main .ds-products:not(.ds-scroller) {
		grid-template-columns: repeat(var(--ds-cols-sb, 3), minmax(0, 1fr));
	}

	.shop-filters-sidebar .shop-toolbar__filter {
		display: none;
	}
}

/* Filter panel: drawer by default (phones, and desktop "drawer" layout). ------ */

.shop-filters__title {
	font-size: var(--ds-fs-lg);
}

.shop-filters__body {
	padding-block: var(--ds-space-xs);
	border-top: 0;
}

.shop-filter summary {
	min-height: 52px;
	font-size: var(--ds-fs-sm);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.shop-filter__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 0 var(--ds-space-md);
	padding: 0;
	list-style: none;
}

.shop-filter__option {
	display: flex;
	align-items: center;
	gap: var(--ds-space-sm);
	min-height: 40px;
	padding: 0.25rem 0;
	color: var(--ds-text);
	font-size: var(--ds-fs-sm);
	text-decoration: none;
}

.shop-filter__option:hover {
	color: var(--ds-primary);
}

.shop-filter__option.is-active {
	color: var(--ds-primary);
	font-weight: 600;
}

/* Checkbox look for toggle filters. */
.shop-filter__check {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius-sm);
	background: var(--ds-surface) center / 12px no-repeat;
}

.shop-filter__option.is-active .shop-filter__check {
	border-color: var(--ds-primary);
	background-color: var(--ds-primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.shop-filter__option--link {
	justify-content: space-between;
}

.shop-filter__num {
	color: var(--ds-text-muted);
	font-size: var(--ds-fs-xs);
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}

.shop-filters__widgets {
	padding-top: var(--ds-space-md);
}

.shop-filters__widgets .widget-title {
	margin-bottom: var(--ds-space-sm);
	font-family: var(--ds-font-body);
	font-size: var(--ds-fs-sm);
	font-weight: 600;
}

.shop-filters__widgets .widget + .widget {
	margin-top: var(--ds-space-lg);
}

/* Desktop sidebar: the drawer becomes a sticky column. */
@media (min-width: 1024px) {
	.shop-filters-sidebar .shop-filters,
	.shop-filters-sidebar .shop-filters[hidden] {
		position: sticky;
		top: calc(var(--ds-header-h) + var(--ds-space-lg));
		bottom: auto;
		z-index: 1;
		display: block !important;
		width: auto;
		max-height: calc(100vh - var(--ds-header-h) - var(--ds-space-2xl));
		padding: 0;
		overflow-y: auto;
		background: transparent;
		box-shadow: none;
		visibility: visible;
		transform: none;
		scrollbar-width: thin;
	}

	.shop-filters-sidebar .shop-filters__head {
		min-height: 0;
		padding: 0 0 var(--ds-space-sm);
	}

	.shop-filters-sidebar .shop-filters__close,
	.shop-filters-sidebar .shop-filters__foot,
	.shop-filters-sidebar .shop-filters-overlay {
		display: none !important;
	}

	.shop-filters-sidebar .shop-filters__body {
		padding: 0;
		overflow: visible;
	}
}

/* Hidden until opened when acting as a drawer (hidden attr added by JS). */
.no-js .shop-filters {
	position: static;
	width: auto;
	visibility: visible;
	transform: none;
	box-shadow: none;
}

/* Pagination -------------------------------------------------------------------- */

.shop-pagination {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--ds-space-sm);
	margin-top: var(--ds-space-2xl);
}

.woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--ds-space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.shop-load-more {
	min-width: 220px;
}

.shop-pagination__progress {
	color: var(--ds-text-muted);
	font-size: var(--ds-fs-xs);
}

/* With JavaScript, "Load more" replaces the page numbers. */
.js .shop-pagination--load-more .woocommerce-pagination {
	display: none;
}

.no-js .shop-load-more,
.no-js .shop-pagination__progress {
	display: none;
}

/* Newly loaded products fade in. */
.ds-product-card.is-new {
	animation: ds-card-in var(--ds-dur-slow) var(--ds-ease) both;
}

@keyframes ds-card-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

/* Empty state ------------------------------------------------------------------- */

.woocommerce-no-products-found {
	padding-block: var(--ds-space-2xl);
	text-align: center;
}
