/**
 * Filter pill rows (ADO #41325).
 *
 * Same rule as the hero slider: sizes and spacing come from the Elementor
 * controls, the palette is fixed. Active is Sotheby's navy on white, inactive is
 * navy text in a hairline box, per the screendesign.
 */

.sir-filters {
	--sir-ink: #0a2246;
	--sir-line: #d8dce3;
	--sir-muted: #8a93a3;

	display: flex;
	flex-direction: column;
	width: 100%;
}

.sir-filters__row {
	display: flex;
	align-items: center;
	gap: 8px 16px;
	padding: 18px 0;
}

.sir-filters--divided .sir-filters__row + .sir-filters__row {
	border-top: 1px solid var(--sir-line);
}

.sir-filters__label {
	flex: 0 0 var(--sir-label-basis, 96px);
	color: var(--sir-muted);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-size: 11px;
	line-height: 1.4;
}

.sir-filters__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
}

/*
 * The frame is drawn by a pseudo-element rather than a border or a box-shadow.
 * The parent theme styles links with both of those — a border-bottom for its
 * underline effect and its own shadow reset — and kept overriding whichever of
 * the two the pill used. Theme link rules do not reach ::before, so this holds,
 * costs no layout space, and follows the corner radius.
 */
.sir-filters__pill {
	--sir-frame: 1px;
	--sir-frame-color: var(--sir-line);

	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background-color: #fff;
	color: var(--sir-ink);
	text-decoration: none;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 160ms ease, color 160ms ease;
}

.sir-filters__pill::before {
	content: "";
	position: absolute;
	inset: 0;
	border: var(--sir-frame) solid var(--sir-frame-color);
	border-radius: inherit;
	pointer-events: none;
	transition: border-color 160ms ease;
}

/*
 * Bold on hover would reflow the row, so every pill already reserves the width of
 * its own bold text: the ghost copy in ::after sits in a second grid row, is
 * zero-height and hidden, and therefore only contributes width.
 */
.sir-filters__text {
	display: inline-grid;
}

.sir-filters__text::after {
	content: attr(data-text);
	height: 0;
	overflow: hidden;
	visibility: hidden;
	font-weight: 700;
	pointer-events: none;
}

/* Hover and focus: navy frame, bold label, background unchanged. */
.sir-filters__pills a.sir-filters__pill:hover,
.sir-filters__pills a.sir-filters__pill:focus-visible {
	--sir-frame-color: var(--sir-ink);

	background-color: #fff;
	color: var(--sir-ink);
	font-weight: 700;
}

/* Selected: navy frame and fill, white label. */
.sir-filters__pills a.sir-filters__pill.is-active {
	--sir-frame-color: var(--sir-ink);

	background-color: var(--sir-ink);
	color: #fff;
	font-weight: 700;
}

/* An already-selected pill keeps its fill while hovered. */
.sir-filters__pills a.sir-filters__pill.is-active:hover,
.sir-filters__pills a.sir-filters__pill.is-active:focus-visible {
	background-color: var(--sir-ink);
	color: #fff;
}

.sir-filters__pill:focus-visible {
	outline: 2px solid var(--sir-ink);
	outline-offset: 2px;
}

.sir-filters__count {
	opacity: 0.6;
	font-size: 0.85em;
}

/* Mobile: the label sits above its own row of pills, which then scrolls. */
@media (max-width: 767px) {
	.sir-filters__row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	/*
	 * The row is a column here, so any main-axis basis would become a height.
	 * Reset the whole flex shorthand rather than just the basis.
	 */
	.sir-filters__label {
		flex: 0 0 auto;
		width: auto;
	}

	.sir-filters__pills {
		flex-wrap: nowrap;
		width: 100%;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.sir-filters__pills::-webkit-scrollbar {
		display: none;
	}
}
