/* Bra Price Table. Colours come from the theme (currentColor), so it fits light and dark themes. */
.bpd {
	margin: 1.5em 0;
	font-variant-numeric: tabular-nums;
}

.bpd-disclosure,
.bpd-meta {
	font-size: 0.85em;
	opacity: 0.8;
}

.bpd-lead {
	font-size: 1.05em;
}

.bpd-nearby {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	font-size: 0.92em;
}

.bpd-nearby-label {
	font-weight: 600;
}

/* ---------- Filters ---------- */

.bpd-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px 20px;
	margin: 0 0 12px;
	padding: 12px 14px;
	border: 1px solid rgba(127, 127, 127, 0.35);
	border-radius: 8px;
}

.bpd-filters[hidden] {
	display: none;
}

.bpd-filters label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	font-size: 0.92em;
}

.bpd-filters input[type="number"] {
	width: 5.5em;
}

.bpd-search input {
	width: 12em;
	max-width: 100%;
}

.bpd-count {
	margin-left: auto;
	font-size: 0.9em;
	opacity: 0.8;
}

/* "Filters" button: phones only. */
.bpd-filter-toggle {
	display: none;
}

@media (max-width: 700px) {
	.bpd-filter-toggle {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		min-height: 36px;
		padding: 0 14px;
		border: 1px solid rgba(127, 127, 127, 0.5);
		border-radius: 6px;
		background: transparent;
		color: inherit;
		font: inherit;
		font-weight: 600;
		cursor: pointer;
	}

	.bpd-filter-toggle::after {
		content: "\25BE";
		content: "\25BE" / "";
	}

	.bpd-filter-toggle[aria-expanded="true"]::after {
		content: "\25B4";
		content: "\25B4" / "";
	}

	.bpd-filters.bpd-collapsed {
		align-items: center;
		padding: 8px 10px;
	}

	.bpd-filters.bpd-collapsed > :not(.bpd-filter-toggle):not(.bpd-count) {
		display: none;
	}

	.bpd-filters:not(.bpd-collapsed) .bpd-filter-toggle {
		flex-basis: 100%;
		justify-content: space-between;
	}
}

/* ---------- Tables ---------- */

.bpd-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.bpd-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.92em;
}

.bpd-table th,
.bpd-table td {
	padding: 8px 10px;
	border-bottom: 1px solid rgba(127, 127, 127, 0.25);
	text-align: left;
	vertical-align: top;
	white-space: nowrap;
}

.bpd-table th {
	font-weight: 600;
	border-bottom-width: 2px;
}

.bpd-table .bpd-num {
	text-align: right;
}

.bpd-table td.bpd-title {
	min-width: 16em;
	white-space: normal;
}

.bpd-table.bpd-wrap td.bpd-sizes {
	min-width: 12em;
	white-space: normal;
}

.bpd-table .bpd-key {
	font-weight: 700;
}

.bpd-table th button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.bpd-table th button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* The arrow is decorative: aria-sort already tells screen readers the order. */
.bpd-table th[aria-sort="ascending"] button::after {
	content: " \25B2";
	content: " \25B2" / "";
	font-size: 0.75em;
}

.bpd-table th[aria-sort="descending"] button::after {
	content: " \25BC";
	content: " \25BC" / "";
	font-size: 0.75em;
}

.bpd-table tr[hidden] {
	display: none;
}

/* Small second line under a name or price: colours, pack price, old price. */
.bpd-sub,
.bpd-was,
.bpd-flag {
	display: block;
	font-size: 0.8em;
	font-weight: 400;
}

.bpd-sub {
	opacity: 0.75;
}

.bpd-was {
	text-decoration: line-through;
	opacity: 0.7;
}

.bpd-flag {
	max-width: 11em;
	margin-left: auto;
	white-space: normal;
	font-style: italic;
	opacity: 0.85;
}

.bpd-table tr.bpd-sister td:not(:first-child) {
	opacity: 0.85;
}

/* The store's button under each price. */
.bpd-table .bpd-buy {
	display: block;
	width: max-content;
	max-width: 13em;
	margin: 5px 0 0 auto;
	padding: 0 8px;
	overflow: hidden;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 0.78em;
	font-weight: 600;
	line-height: 1.7;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bpd-table .bpd-buy:hover,
.bpd-table .bpd-buy:focus-visible {
	text-decoration: underline;
}

/* The first column stays in view while a wide table is swiped sideways. */
.bpd-scroll .bpd-table td:first-child,
.bpd-scroll .bpd-table th:first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	background-color: var(--bpd-bg, var(--lpt-bg, var(--ps-bg, var(--base-3, #fff))));
}

/* Sticky cells don't paint collapsed borders, so draw the row line and a thin edge instead. */
.bpd-scroll .bpd-table td:first-child {
	box-shadow: inset 0 -1px 0 rgba(127, 127, 127, 0.25), inset -1px 0 0 rgba(127, 127, 127, 0.25);
}

/* A copy of the header row pinned to the top of the window while a long table scrolls by. */
.bpd-float {
	position: fixed;
	z-index: 40;
	display: none;
	overflow: hidden;
	background-color: var(--bpd-bg, var(--lpt-bg, var(--ps-bg, var(--base-3, #fff))));
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.bpd-float.is-on {
	display: block;
}

.bpd-float .bpd-table {
	table-layout: fixed;
	max-width: none;
}

.bpd-float .bpd-table th {
	box-sizing: border-box;
	overflow: hidden;
}

.bpd-float .bpd-table th:first-child {
	position: relative;
	z-index: 1;
	background-color: var(--bpd-bg, var(--lpt-bg, var(--ps-bg, var(--base-3, #fff))));
}

@media print {
	.bpd-float {
		display: none !important;
	}
}

/* ---------- Size grid ---------- */

.bpd-pick {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px 16px;
	margin: 0 0 14px;
}

.bpd-pick label {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.9em;
	font-weight: 600;
}

.bpd-pick select,
.bpd-pick button {
	min-height: 40px;
	font: inherit;
	font-weight: 400;
}

.bpd-pick button {
	padding: 0 16px;
	font-weight: 600;
	cursor: pointer;
}

.bpd-grid {
	margin: 0;
	border-collapse: collapse;
	font-size: 0.9em;
}

.bpd-grid th,
.bpd-grid td {
	min-width: 2.6em;
	padding: 6px 6px;
	border: 1px solid rgba(127, 127, 127, 0.2);
	text-align: center;
	white-space: nowrap;
}

.bpd-grid thead th {
	font-weight: 700;
	border-bottom-width: 2px;
}

.bpd-grid tbody th {
	position: sticky;
	left: 0;
	z-index: 1;
	font-weight: 700;
	background-color: var(--bpd-bg, var(--lpt-bg, var(--ps-bg, var(--base-3, #fff))));
}

.bpd-grid td a {
	display: block;
	font-weight: 600;
	text-decoration: none;
}

.bpd-grid td a:hover,
.bpd-grid td a:focus-visible {
	text-decoration: underline;
}

.bpd-grid td.bpd-empty {
	opacity: 0.35;
}

.bpd-alpha {
	line-height: 1.8;
}

.bpd-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
