/* ==========================================================================
   Brands page — ТехСтройМаркет
   ========================================================================== */

.brands-page {
	--brand-blue: #1b9fc6;
	--brand-blue-dark: #147f9b;
	--brand-ink: #2b2f34;
	--brand-soft: #565d66;
	--brand-line: #e4e7ea;
	max-width: 1180px;
	margin: 0 auto;
	padding: 4px 0 48px;
	color: var(--brand-ink);
}
.brands-page * { box-sizing: border-box; }

.brands-lead {
	max-width: 860px;
	margin: 0 0 30px;
	font-size: 16px;
	line-height: 1.65;
	color: var(--brand-soft);
}

.brands-section { margin-top: 34px; }
.brands-section:first-of-type { margin-top: 0; }

.brands-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}
.brands-title {
	margin: 0;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--brand-ink);
}
.brands-count {
	font-size: 13px;
	color: #838a93;
	white-space: nowrap;
}

.brands-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 10px;
}

.brand-card {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	min-height: 64px;
	padding: 12px 15px;
	background: #fff;
	border: 1px solid var(--brand-line);
	border-radius: 10px;
	text-decoration: none;
	transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.brand-card:hover,
.brand-card:focus-visible {
	border-color: var(--brand-blue);
	box-shadow: 0 8px 22px rgba(27, 159, 198, .12);
	transform: translateY(-1px);
	outline: none;
}
.brand-card__name {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--brand-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.brand-card__count {
	display: block;
	font-size: 12px;
	line-height: 1.3;
	color: #838a93;
}

.brands-grid--popular .brand-card {
	min-height: 76px;
	padding: 14px 16px;
	background: #fbfdfe;
	border-color: #dceef4;
}
.brands-grid--popular .brand-card__name { font-size: 16px; }
.brands-grid--popular .brand-card__count { color: var(--brand-blue-dark); }

.brands-alpha {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0 0 24px;
	padding: 10px 12px;
	background: #f7f9fa;
	border: 1px solid #eef0f2;
	border-radius: 10px;
}
.brands-alpha__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 8px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: var(--brand-soft);
	text-decoration: none;
	transition: background-color .14s ease, color .14s ease;
}
.brands-alpha__item:hover,
.brands-alpha__item:focus-visible {
	background: var(--brand-blue);
	color: #fff;
	outline: none;
}

.brands-group { margin-top: 26px; scroll-margin-top: 96px; }
.brands-letter {
	margin: 0 0 12px;
	font-size: 18px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--brand-blue-dark);
}

.brands-empty {
	padding: 18px;
	background: #f7f9fa;
	border: 1px solid var(--brand-line);
	border-radius: 10px;
	color: var(--brand-soft);
}

.brands-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: 40px;
	padding: 22px 24px;
	background: linear-gradient(135deg, #f2fafc 0%, #e8f6fa 100%);
	border: 1px solid #d7eef4;
	border-radius: 14px;
}
.brands-cta__text { display: flex; flex-direction: column; gap: 4px; }
.brands-cta__text strong { font-size: 16px; color: var(--brand-ink); }
.brands-cta__text span { font-size: 14px; color: var(--brand-soft); }
.brands-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	background: var(--brand-blue);
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .16s ease;
}
.brands-cta__btn:hover { background: var(--brand-blue-dark); color: #fff; }

@media (max-width: 767px) {
	.brands-page { padding-bottom: 28px; }
	.brands-lead { margin-bottom: 22px; font-size: 15px; }
	.brands-title { font-size: 20px; }
	.brands-head { flex-direction: column; align-items: flex-start; gap: 4px; }
	.brands-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
	.brand-card { min-height: 58px; padding: 10px 12px; }
	.brand-card__name { font-size: 14px; }
	.brands-grid--popular .brand-card { min-height: 64px; }
	.brands-grid--popular .brand-card__name { font-size: 15px; }
	.brands-alpha { gap: 2px; padding: 8px; }
	.brands-alpha__item { min-width: 28px; height: 28px; font-size: 12px; }
	.brands-cta { flex-direction: column; align-items: flex-start; padding: 18px; }
	.brands-cta__btn { width: 100%; }
}
