/* Бренды (/brands/, страница бренда) и распродажа: доски Brands и Sale. Карточки и фильтры — из каталога (theme.css). */
.rs-brands-page > * + * { margin-block-start: 0; }

/* Популярный бренд */
.rs-brand-popular { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; padding: 28px; border-radius: 16px; background: var(--rs-light); }
.rs-brand-popular__head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.rs-brand-popular__logo { flex: none; display: grid; place-items: center; width: 200px; height: 96px; padding: 16px 20px; border: 1px solid var(--rs-line); border-radius: 16px; background: #fff; }
.rs-brand-popular__img { display: block; width: auto; height: auto; max-width: 100%; max-height: 64px; object-fit: contain; }
.rs-brand-popular__text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 4px; }
.rs-brand-popular__tag { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rs-orange-text); }
.rs-brand-popular__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.rs-brand-popular__title h2 { margin: 0; font-size: 28px; line-height: 1.1; }
.rs-brand-popular__text p { margin: 0; font-size: 16px; }
.rs-brand-popular__all { flex: none; display: inline-flex; align-items: center; height: 48px; padding: 0 22px; border-radius: 10px; background: var(--rs-orange); color: var(--rs-dark); font-weight: 600; text-decoration: none; }
.rs-brand-popular__all:hover { color: var(--rs-dark); text-decoration: none; filter: brightness(.95); }
.rs-brand-popular .rs-products .wc-block-product-template { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }

/* Алфавитный указатель */
.rs-brand-letters { margin-top: 28px; }
.rs-brand-letters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rs-brand-letters a { width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px solid var(--rs-line); border-radius: 10px; background: #fff; color: var(--rs-dark); font-size: 16px; font-weight: 700; text-decoration: none; }
.rs-brand-letters a:hover { border-color: var(--rs-dark); color: var(--rs-dark); }

/* Бренды по буквам */
.rs-brand-groups { margin-top: 24px; border-bottom: 1px solid var(--rs-line); }
.rs-brand-group { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-top: 1px solid var(--rs-line); scroll-margin-top: 16px; }
.rs-brand-group h2 { margin: 0; font-size: 32px; font-weight: 600; line-height: 1.1; color: var(--rs-orange-text); }
.rs-brand-group ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.rs-brand-group li { display: flex; }
.rs-brand-tile { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 12px 14px; border: 1px solid var(--rs-line); border-radius: 16px; background: #fff; color: var(--rs-dark); text-decoration: none; }
.rs-brand-tile:hover { border-color: var(--rs-dark); color: var(--rs-dark); text-decoration: none; }
.rs-brand-tile__logo { width: 100%; height: 88px; display: grid; place-items: center; }
.rs-brand-tile__img { display: block; width: auto; height: auto; max-width: 100%; max-height: 80px; object-fit: contain; }
.rs-brand-tile__name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.rs-brand-tile__count { margin-top: auto; font-size: 13px; color: var(--rs-muted); font-variant-numeric: tabular-nums; }

/* Страница бренда: логотип и описание */
.rs-brand-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.rs-brand-head__logo { flex: none; display: grid; place-items: center; padding: 20px 28px; border: 1px solid var(--rs-line); border-radius: 16px; background: #fff; margin-top: 12px; }
.rs-brand-head__img { display: block; width: auto; height: auto; max-width: 180px; max-height: 64px; object-fit: contain; }
.rs-brand-head .rs-catalog-head__title { margin-top: 12px; }

/* Распродажа */
.rs-sale-lead { margin: 4px 0 0; font-size: 18px; }
.rs-sale-lead > * { margin: 0; }

@media (max-width: 1100px) {
	.rs-brand-group ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.rs-brand-popular .rs-products .wc-block-product-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
	.rs-brand-popular { gap: 10px; margin: 16px calc(var(--rs-gutter) * -1) 0; padding: 16px 0; border-radius: 0; }
	.rs-brand-popular__head { flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 var(--rs-gutter); }
	.rs-brand-popular__logo { width: auto; height: auto; padding: 0; border: 0; background: none; }
	.rs-brand-popular__img { max-height: 42px; }
	.rs-brand-popular__text { flex: none; }
	.rs-brand-popular__tag { font-size: 12px; }
	.rs-brand-popular__title h2 { font-size: 22px; }
	.rs-brand-popular__text p { font-size: 15px; line-height: 1.45; }
	.rs-brand-popular .rs-products { overflow-x: auto; padding: 4px var(--rs-gutter) 0; }
	.rs-brand-popular .rs-products .wc-block-product-template { display: flex !important; gap: 10px; width: max-content; }
	.rs-brand-popular .rs-products .wc-block-product { flex: none; width: 156px !important; }
	.rs-brand-letters { margin-top: 16px; margin-inline: calc(var(--rs-gutter) * -1); }
	.rs-brand-letters ul { flex-wrap: nowrap; overflow-x: auto; padding: 0 var(--rs-gutter) 8px; }
	.rs-brand-letters li { flex: none; }
	.rs-brand-groups { margin-top: 12px; border-bottom: 0; }
	.rs-brand-group { display: block; padding: 20px 0 8px; }
	.rs-brand-group h2 { margin-bottom: 12px; font-size: 22px; }
	.rs-brand-group ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.rs-brand-tile { align-items: center; gap: 6px; padding: 8px 6px 10px; border-radius: 12px; text-align: center; }
	.rs-brand-tile__logo { height: 56px; }
	.rs-brand-tile__img { max-height: 52px; }
	.rs-brand-tile__name { min-height: 31px; font-size: 12px; }
	.rs-brand-tile__count { font-size: 12px; }
	.rs-brand-head__logo { padding: 12px 16px; margin-top: 8px; }
	.rs-brand-head__img { max-height: 40px; }
	.rs-sale-lead { font-size: 15px; }
}
@media (max-width: 420px) {
	.rs-brand-group ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
