/*
 * Оформление бренда: шапка с логотипом, поиском и меню категорий,
 * сетка каталога 8 карточек в ряд, скруглённые углы.
 * Подключается ПОСЛЕ app.min.css и перебивает его сетку.
 */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eff6ff;
    --ink: #0f172a;
    --ink-muted: #64748b;
    --line: #e2e8f0;
    --radius: 16px;
    --radius-sm: 10px;
}

body.brand-body {
    margin: 0;
    background: #f8fafc;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.brand-container {
    max-width: 1760px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Шапка ---------- */

.brand-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}

.brand-header__top {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    flex-shrink: 0;
}

.brand-logo:hover { text-decoration: none; color: var(--ink); }

.brand-logo__mark { display: block; width: 38px; height: 38px; border-radius: 11px; }

.brand-logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-logo__name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand-logo__tagline { font-size: 11px; color: var(--ink-muted); }

/* Поиск */

.brand-search {
    flex: 1;
    max-width: 620px;
    display: flex;
    gap: 8px;
    margin: 0;
}

.brand-search__input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--ink);
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    outline: none;
}

.brand-search__input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.brand-search__btn {
    height: 42px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.brand-search__btn:hover { background: var(--brand-dark); }

/* Меню категорий */

.brand-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.brand-nav::-webkit-scrollbar { display: none; }

.brand-nav__link {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 14px;
    color: var(--ink-muted);
    text-decoration: none;
    background: #f1f5f9;
    border-radius: 999px;
    white-space: nowrap;
}

.brand-nav__link:hover {
    color: var(--brand);
    background: var(--brand-soft);
    text-decoration: none;
}

.brand-nav__link.is-active {
    color: #fff;
    background: var(--brand);
}

/* ---------- Заголовок страницы ---------- */

.brand-page-head { padding: 28px 0 20px; }

.brand-page-head h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-page-head p {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--ink-muted);
}

/* ---------- Каталог: 8 карточек в ряд ---------- */

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

@media (max-width: 1600px) { .catalog-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1280px) { .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

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

.product-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.product-card__media {
    display: block;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    overflow: hidden;
}

/* Запасной вариант для браузеров без aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
    .product-card__media { height: 0; padding-bottom: 100%; position: relative; }
    .product-card__media img { position: absolute; inset: 0; }
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 12px;
}

.product-card__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    /* Название в две строки — иначе карточки в ряду разной высоты */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__title a { color: var(--ink); text-decoration: none; }
.product-card__title a:hover { color: var(--brand); }

.product-card__price {
    margin-top: auto;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.product-card__btn {
    display: block;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: var(--brand);
    border-radius: var(--radius-sm);
}

.product-card__btn:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }

.catalog-empty {
    padding: 60px 0;
    text-align: center;
    color: var(--ink-muted);
}

/* ---------- Подвал ---------- */

.brand-footer {
    margin-top: 40px;
    padding: 28px 0;
    background: #fff;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-muted);
}

.brand-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.brand-footer a { color: var(--ink-muted); text-decoration: none; }
.brand-footer a:hover { color: var(--brand); }

@media (max-width: 860px) {
    .brand-header__top { flex-wrap: wrap; gap: 12px; }
    .brand-search { order: 3; flex-basis: 100%; max-width: none; }
    .brand-page-head h1 { font-size: 21px; }
}
