/**
 * Finpip brokers directory — list UI (shortcode).
 */

.bpt-directory {
	--bpt-bg: #f8fafc;
	--bpt-card: #ffffff;
	--bpt-text: #0f172a;
	--bpt-muted: #64748b;
	--bpt-border: #e2e8f0;
	--bpt-accent: #2563eb;
	--bpt-accent-soft: rgba(37, 99, 235, 0.1);
	--bpt-gold: #d97706;
	--bpt-radius: 14px;
	--bpt-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 28px rgba(15, 23, 42, 0.06);
	font-size: 15px;
	line-height: 1.5;
	color: var(--bpt-text);
	box-sizing: border-box;
	width: 100%;
	max-width: 1280px;
	margin: 1.5rem auto 2.5rem;
	padding: 0 1rem;
}

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

.bpt-directory__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1rem 1.25rem;
	margin-bottom: 1.25rem;
	padding: 1.1rem 1.25rem;
	background: var(--bpt-card);
	border: 1px solid var(--bpt-border);
	border-radius: var(--bpt-radius);
	box-shadow: var(--bpt-shadow);
}

.bpt-directory__search-wrap {
	flex: 1 1 220px;
	min-width: 180px;
}

.bpt-directory__search {
	width: 100%;
	padding: 0.65rem 0.9rem;
	border: 1px solid var(--bpt-border);
	border-radius: 10px;
	font-size: 0.95rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bpt-directory__search:focus {
	outline: none;
	border-color: var(--bpt-accent);
	box-shadow: 0 0 0 3px var(--bpt-accent-soft);
}

.bpt-directory__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	align-items: center;
}

.bpt-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.45rem 0.85rem;
	font-size: 0.82rem;
	font-weight: 600;
	border-radius: 999px;
	border: 1px solid var(--bpt-border);
	background: var(--bpt-bg);
	color: var(--bpt-text);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bpt-chip:hover {
	border-color: #cbd5e1;
	background: #f1f5f9;
}

.bpt-chip.is-active {
	background: var(--bpt-accent);
	border-color: var(--bpt-accent);
	color: #fff;
}

.bpt-directory__sort-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--bpt-muted);
}

.bpt-directory__sort {
	padding: 0.55rem 0.75rem;
	border-radius: 10px;
	border: 1px solid var(--bpt-border);
	font-size: 0.9rem;
	min-width: 11rem;
	background: #fff;
	cursor: pointer;
}

.bpt-directory__count {
	margin: 0 0 1rem;
	font-size: 0.9rem;
	color: var(--bpt-muted);
	font-weight: 500;
}

.bpt-directory__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.25rem;
}

@media (min-width: 1200px) {
	.bpt-directory__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.bpt-card {
	display: flex;
	flex-direction: column;
	background: var(--bpt-card);
	border: 1px solid var(--bpt-border);
	border-radius: var(--bpt-radius);
	box-shadow: var(--bpt-shadow);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bpt-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 16px 40px rgba(15, 23, 42, 0.08);
}

.bpt-card.is-hidden {
	display: none !important;
}

.bpt-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	padding: 1.25rem;
	background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
	border-bottom: 1px solid var(--bpt-border);
}

.bpt-card__logo {
	max-width: 160px;
	max-height: 72px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.bpt-card__logo--placeholder {
	display: block;
	width: 120px;
	height: 48px;
	border-radius: 8px;
	background: linear-gradient(110deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
}

.bpt-card__body {
	padding: 1.1rem 1.2rem 1.25rem;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.65rem;
}

.bpt-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	min-height: 1.5rem;
}

.bpt-badge {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
}

.bpt-badge--rec {
	background: rgba(37, 99, 235, 0.12);
	color: #1d4ed8;
}

.bpt-badge--feat {
	background: rgba(5, 150, 105, 0.12);
	color: #047857;
}

.bpt-badge--pop {
	background: rgba(217, 119, 6, 0.14);
	color: #b45309;
}

.bpt-card__title {
	margin: 0;
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.02em;
}

.bpt-card__title a {
	color: inherit;
	text-decoration: none;
}

.bpt-card__title a:hover {
	color: var(--bpt-accent);
}

.bpt-card__tagline {
	margin: 0;
	font-size: 0.86rem;
	color: var(--bpt-muted);
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bpt-card__stats {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 1rem;
}

.bpt-card__rating {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.5rem;
}

.bpt-card__rating-value {
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--bpt-gold);
}

.bpt-card__rating-max {
	font-size: 0.8rem;
	color: var(--bpt-muted);
	font-weight: 600;
}

.bpt-starbar {
	flex: 1 1 100%;
	max-width: 140px;
	height: 6px;
	border-radius: 999px;
	background: #e2e8f0;
	overflow: hidden;
}

.bpt-starbar__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.bpt-card__reviews {
	font-size: 0.82rem;
	color: var(--bpt-muted);
	font-weight: 500;
}

.bpt-card__facts {
	margin: 0;
	display: grid;
	gap: 0.35rem 0.75rem;
	font-size: 0.8rem;
}

.bpt-card__facts > div {
	display: grid;
	grid-template-columns: minmax(0, 38%) 1fr;
	gap: 0.35rem;
	align-items: baseline;
}

.bpt-card__facts dt {
	margin: 0;
	font-weight: 600;
	color: var(--bpt-muted);
}

.bpt-card__facts dd {
	margin: 0;
	font-weight: 500;
	color: var(--bpt-text);
	word-break: break-word;
}

.bpt-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 0.35rem;
}

.bpt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.55rem 1rem;
	font-size: 0.86rem;
	font-weight: 600;
	border-radius: 10px;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bpt-btn--primary {
	background: var(--bpt-accent);
	color: #fff;
	border: 1px solid var(--bpt-accent);
}

.bpt-btn--primary:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #fff;
}

.bpt-btn--ghost {
	background: transparent;
	color: var(--bpt-accent);
	border: 1px solid var(--bpt-border);
}

.bpt-btn--ghost:hover {
	border-color: var(--bpt-accent);
	background: var(--bpt-accent-soft);
}

.bpt-directory__empty-msg {
	text-align: center;
	padding: 2rem 1rem;
	color: var(--bpt-muted);
	font-weight: 500;
}

.bpt-directory--empty {
	box-sizing: border-box;
	width: 100%;
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
	padding: 2rem 1rem;
	text-align: center;
	color: var(--bpt-muted);
}

/* RTL-friendly spacing */
[dir="rtl"] .bpt-card__facts > div {
	grid-template-columns: minmax(0, 42%) 1fr;
}
