.mb-archive-head {
	margin-bottom: 16px;
}

.mb-archive-head__title {
	font-size: 28px;
	margin: 0 0 16px;
	text-transform: uppercase;
	color: var(--mb-blue-deep);
}

.mb-subcats {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 8px;
	margin-bottom: 16px;
}

.mb-subcats__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none;
	color: var(--mb-text);
	font-size: 13px;
	background: #fff;
	border: 1px solid var(--mb-border);
	border-radius: var(--mb-radius-control);
	padding: 8px;
}

.mb-subcats__item img {
	width: 72px;
	height: 72px;
	object-fit: contain;
	margin-bottom: 6px;
}

/* Related categories: up to three titled blocks between the title and the filters. */
.mb-related-cats {
	margin-bottom: 16px;
	min-width: 0;
	max-width: 100%;
}

.mb-related-cats__track {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.mb-related-cats__track > .mb-types__item {
	flex: 0 0 calc((100% - 56px) / 8);
	width: calc((100% - 56px) / 8);
	max-width: calc((100% - 56px) / 8);
	min-width: 0;
	box-sizing: border-box;
	scroll-snap-align: start;
}

@media (max-width: 849px) {
	.mb-related-cats__track > .mb-types__item {
		flex-basis: 132px;
		width: 132px;
		max-width: none;
		min-width: 132px;
	}
}

.mb-related-cats__title {
	margin-bottom: 10px;
}

.mb-related-cats__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.mb-related-cats__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 120px;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--mb-border);
	border-radius: var(--mb-card-radius);
	color: var(--mb-text);
	text-align: center;
	text-decoration: none;
}

.mb-related-cats__img {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: 6px;
}

.mb-related-cats__img img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.mb-related-cats__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	min-height: 35px;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.35;
}

.mb-related-cats__item:hover .mb-related-cats__name,
.mb-related-cats__item.is-active .mb-related-cats__name {
	color: var(--mb-blue);
}

.mb-related-cats__item.is-active {
	border-color: var(--mb-blue);
}

@media (max-width: 549px) {
	.mb-related-cats__list {
		gap: 8px;
	}

	.mb-related-cats__item {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
		padding: 6px;
	}

	.mb-related-cats__img {
		width: 60px;
		height: 60px;
	}
}

/* Filters: a pill bar per attribute group, each opening its own dropdown. */
.mb-filters {
	position: relative;
	margin-bottom: 16px;
}

/* Flatsome styles every button as an uppercase CTA; filter controls opt out. */
.mb-filters button {
	margin: 0;
	min-width: 0;
	text-transform: none;
	letter-spacing: 0;
	text-shadow: none;
	box-shadow: none;
}

.mb-filters__row {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 8px;
}

.mb-filters__row--sort {
	margin-bottom: 0;
}

.mb-filters__title {
	flex: 0 0 auto;
	padding-top: 8px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--mb-heading);
	white-space: nowrap;
}

.mb-filters__bar,
.mb-filters__sorts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.mb-filters__dropdown {
	position: static;
}

.mb-filters__bar > .mb-filters__dropdown:not(.mb-filters__dropdown--all) {
	position: relative;
}

.mb-filters__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 6px 12px;
	border: 1px solid var(--mb-border);
	border-radius: var(--mb-radius-control);
	background: var(--mb-surface-subtle);
	color: var(--mb-heading);
	font-family: var(--mb-font);
	font-size: var(--mb-font-small);
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mb-filters__btn:hover {
	border-color: var(--mb-blue);
	background: var(--mb-surface-soft);
	color: var(--mb-blue);
}

.mb-filters__btn--all {
	border-color: var(--mb-blue);
	background: var(--mb-surface-soft);
	color: var(--mb-blue);
	font-weight: 600;
}

.mb-filters__btn.is-active,
.mb-filters__btn.is-open {
	border-color: var(--mb-blue);
	background: var(--mb-surface-soft);
	color: var(--mb-blue);
	font-weight: 600;
}

.mb-filters__caret {
	flex: 0 0 auto;
	transition: transform .15s ease;
}

.mb-filters__btn.is-open .mb-filters__caret {
	transform: rotate(180deg);
}

.mb-filters__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--mb-blue);
	color: var(--mb-white);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.mb-filters__count[hidden] {
	display: none;
}

/* Dropdown surfaces. */
.mb-filters__pop,
.mb-filters__panel {
	position: absolute;
	z-index: 60;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--mb-surface);
	border: 1px solid var(--mb-border);
	border-radius: var(--mb-card-radius);
	box-shadow: 0 16px 40px rgba(6, 58, 107, .16);
}

.mb-filters__pop[hidden],
.mb-filters__panel[hidden] {
	display: none;
}

.mb-filters__pop {
	top: calc(100% + 8px);
	left: 0;
	width: min(460px, calc(100vw - 32px));
}

.mb-filters__pop.is-flipped {
	left: auto;
	right: 0;
}

.mb-filters__panel {
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	width: auto;
	max-width: 880px;
}

@media (min-width: 850px) {
	.mb-filters__pop:not([hidden]),
	.mb-filters__panel:not([hidden]) {
		animation: mb-filters-pop .16s ease-out;
	}
}

@keyframes mb-filters-pop {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.mb-filters__pop-head,
.mb-filters__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--mb-divider);
}

.mb-filters__panel-title {
	font-size: 15px;
	color: var(--mb-heading);
}

.mb-filters__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	min-height: 0;
	line-height: 1;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--mb-muted);
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.mb-filters__close:hover {
	background: var(--mb-surface-soft);
	color: var(--mb-heading);
}

.mb-filters__pop-body,
.mb-filters__panel-body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 14px 16px;
}

.mb-filters__pop-body {
	max-height: 320px;
}

.mb-filters__panel-body {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px 20px;
	max-height: 60vh;
}

.mb-filters__block-title {
	display: block;
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--mb-heading);
}

.mb-filters__pop .mb-filters__pop-head .mb-filters__block-title {
	margin-bottom: 0;
}

/* Every option is a toggle pill backed by a checkbox. */
.mb-filters__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mb-filters__opt {
	display: inline-flex;
	margin: 0;
	color: inherit;
	font-size: var(--mb-font-small);
	font-weight: 400;
	cursor: pointer;
}

.mb-filters__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.mb-filters__pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 34px;
	padding: 6px 12px;
	border: 1px solid var(--mb-border);
	border-radius: var(--mb-radius-control);
	background: var(--mb-surface-subtle);
	color: var(--mb-text);
	font-family: var(--mb-font);
	font-size: var(--mb-font-small);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.4;
	text-transform: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mb-filters__opt:hover .mb-filters__pill {
	border-color: var(--mb-blue);
	background: var(--mb-surface-soft);
	color: var(--mb-blue);
}

.mb-filters__input:checked ~ .mb-filters__pill {
	border-color: var(--mb-blue);
	background: var(--mb-surface-soft);
	color: var(--mb-blue);
	font-weight: 600;
}

.mb-filters__input:checked ~ .mb-filters__pill::before {
	content: "";
	width: 11px;
	height: 6px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg) translate(1px, -2px);
}

.mb-filters__input:focus-visible ~ .mb-filters__pill {
	outline: 2px solid var(--mb-blue);
	outline-offset: 2px;
}

/* Footer actions mirror the two-button pattern of the reference site. */
.mb-filters__actions {
	display: flex;
	gap: 10px;
	padding: 12px 16px;
	background: var(--mb-surface-subtle);
	border-top: 1px solid var(--mb-divider);
}

.mb-filters__cancel,
.mb-filters__apply {
	flex: 1 1 0;
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid transparent;
	border-radius: var(--mb-radius-control);
	font-family: var(--mb-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.mb-filters__cancel {
	background: var(--mb-surface-soft);
	border-color: var(--mb-border);
	color: var(--mb-blue);
}

.mb-filters__cancel:hover {
	background: #e2f1fb;
	border-color: var(--mb-blue);
}

.mb-filters__apply {
	background: var(--mb-blue);
	border-color: var(--mb-blue);
	color: var(--mb-white);
}

.mb-filters__apply:hover {
	background: var(--mb-blue-hover);
	border-color: var(--mb-blue-hover);
	color: var(--mb-white);
}

/* Active filters. */
.mb-filters__chips-wrap:empty {
	display: none;
}

.mb-filters__chips-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.mb-filters__chips-label {
	font-size: var(--mb-font-small);
	color: var(--mb-muted);
}

.mb-filters__chips {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
}

.mb-filters__chips li {
	margin: 0;
	list-style: none;
}

.mb-filters__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 4px 10px;
	border: 1px solid var(--mb-blue);
	border-radius: var(--mb-radius-control);
	background: var(--mb-surface-soft);
	color: var(--mb-blue);
	font-size: var(--mb-font-small);
	line-height: 1.4;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.mb-filters__chip:hover {
	background: #e2f1fb;
	border-color: var(--mb-blue-hover);
}

.mb-filters__chip-tax {
	color: var(--mb-muted);
	font-size: var(--mb-font-caption);
}

.mb-filters__chip-text {
	font-weight: 600;
}

.mb-filters__chip-x {
	font-size: 16px;
	line-height: 1;
	opacity: .65;
}

.mb-filters__chip:hover .mb-filters__chip-x {
	opacity: 1;
}

.mb-filters__clear {
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: var(--mb-sale);
	font-size: var(--mb-font-small);
	line-height: 1.4;
	cursor: pointer;
}

.mb-filters__clear:hover {
	text-decoration: underline;
}

/* Sort row. */
.mb-filters__sort-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 6px 12px;
	border: 1px solid var(--mb-border);
	border-radius: var(--mb-radius-control);
	background: var(--mb-surface);
	color: var(--mb-text);
	font-family: var(--mb-font);
	font-size: var(--mb-font-small);
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mb-filters__sort-pill:hover {
	border-color: var(--mb-blue);
	color: var(--mb-blue);
}

.mb-filters__sort-pill.is-active {
	border-color: var(--mb-blue);
	background: var(--mb-surface-soft);
	color: var(--mb-blue);
	font-weight: 600;
}

.mb-filters__overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	background: rgba(6, 58, 107, .45);
}

.mb-filters__overlay[hidden] {
	display: none;
}

@media (max-width: 849px) {
	.mb-filters__row {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
	}

	.mb-filters__title {
		padding-top: 0;
		font-size: 14px;
	}

	/* One swipeable line of pills instead of a tall wrapped block. */
	.mb-filters__bar,
	.mb-filters__sorts {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		padding-bottom: 2px;
	}

	.mb-filters .mb-filters__sort-pill {
		flex: 0 0 auto;
		min-width: max-content;
		overflow: visible;
	}

	.mb-filters__bar::-webkit-scrollbar,
	.mb-filters__sorts::-webkit-scrollbar {
		display: none;
	}

	.mb-filters__pop,
	.mb-filters__panel {
		position: fixed;
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-width: none;
		max-height: 85vh;
		border-width: 0;
		border-radius: 16px 16px 0 0;
		animation: mb-filters-sheet .22s ease-out;
	}

	.mb-filters__pop-body {
		max-height: none;
	}

	.mb-filters__panel-body {
		grid-template-columns: 1fr;
		max-height: none;
	}

	.mb-filters__actions {
		padding-bottom: max(12px, env(safe-area-inset-bottom));
	}
}

@keyframes mb-filters-sheet {
	from {
		transform: translateY(100%);
	}
}

body.mb-filters-lock {
	overflow: hidden;
}

#mb-shop-results {
	position: relative;
	min-height: 120px;
}

#mb-shop-results.is-loading {
	pointer-events: none;
}

#mb-shop-results.is-loading > * {
	opacity: .4;
	transition: opacity .15s ease;
}

#mb-shop-results.is-loading::after {
	content: "";
	position: absolute;
	top: 80px;
	left: 50%;
	width: 32px;
	height: 32px;
	margin-left: -16px;
	border: 3px solid var(--mb-border);
	border-top-color: var(--mb-blue);
	border-radius: 50%;
	animation: mb-filters-spin .7s linear infinite;
}

@keyframes mb-filters-spin {
	to {
		transform: rotate(360deg);
	}
}

.mb-theme.archive .products,
.mb-theme.woocommerce .products.row,
.mb-theme.woocommerce-shop .products,
.mb-theme.tax-product_cat .products {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
	margin: 0;
}

.mb-theme.archive .products .product,
.mb-theme.woocommerce .products .product,
.mb-theme.woocommerce-shop .products .product,
.mb-theme.tax-product_cat .products .product {
	width: auto !important;
	max-width: none !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.mb-archive-desc {
	max-height: 120px;
	overflow: hidden;
	position: relative;
	margin-top: 24px;
}

.mb-archive-desc.is-open {
	max-height: none;
}

@media (max-width: 849px) {
	.mb-theme.archive .products,
	.mb-theme.woocommerce .products.row {
		grid-template-columns: repeat(3, 1fr);
	}

	.mb-subcats {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 549px) {
	.mb-theme.archive .products,
	.mb-theme.woocommerce .products.row {
		grid-template-columns: repeat(2, 1fr);
	}

	.mb-subcats {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mb-filters__pop:not([hidden]),
	.mb-filters__panel:not([hidden]) {
		animation: none;
	}

	.mb-filters__caret,
	.mb-filters__btn,
	.mb-filters__pill,
	.mb-filters__sort-pill,
	.mb-filters__chip {
		transition: none;
	}
}

.mb-archive-content { max-width: var(--mb-container); margin: 24px auto; padding: 20px; border: 1px solid var(--mb-border); border-radius: var(--mb-card-radius); background: var(--mb-surface); }
.mb-archive-content__inner { max-height: 360px; overflow: hidden; overflow-wrap: anywhere; }
.mb-archive-content.is-expanded .mb-archive-content__inner { max-height: none; overflow-x: auto; }
.mb-archive-content img { max-width: 100%; height: auto; }
.mb-archive-content [data-mb-desc-toggle] { display: block; margin: 12px auto 0; }
.mb-related-cats .mb-types__item[aria-current="page"] { color: var(--mb-blue); background: var(--mb-surface-soft); }
@media (max-width: 849px) { .mb-archive-content { margin: 20px 15px; padding: 14px; } }

.mb-theme .mb-archive-content [data-mb-desc-toggle][hidden] { display: none; }
