/* --- Стили для страницы брендов по категориям --- */
.brand-category-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}
.category-section { margin-bottom: 50px; }
.category-title {
    font-size: 28px;
    font-weight: 600;
    color: #111;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    text-align: left;
}
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}
.brand-item-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.brand-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.brand-item-main-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    padding: 20px 15px 15px;
}
.brand-image-wrapper {
    width: 100px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}
.brand-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.brand-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.brand-subcategories {
    padding: 0 15px 15px;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    padding-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.subcategory-tag {
    display: inline-flex;
    align-items: center;
    background-color: #f5f5f5;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 20px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.subcategory-tag:hover {
    background-color: #6d6158;
    color: #fff;
}
.subcategory-more-btn {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px;
}
.subcategory-more-btn:hover { color: #005a87; }


/* --- НОВЫЕ СТИЛИ ДЛЯ ВЫРАВНИВАНИЯ И ФИЛЬТРА --- */

.ed-toolbar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Для мобильных устройств */
    gap: 20px;
    margin-bottom: 25px; /* Стандартный отступ WooCommerce */
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.brand-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    /* Убираем фон и отступы, так как они теперь у родителя */
    padding: 0;
    margin: 0;
    background: none;
    border-radius: 0;
}

.brand-filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.brand-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-filter-button {
    display: inline-block;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.brand-filter-button:hover {
    background-color: #6d6158;
    color: #fff;
    border-color: #6d6158;
}

.brand-filter-button.active {
    background-color: #6d6158;
    color: #fff;
    border-color: #6d6158;
    font-weight: 600;
}


/* --- Адаптивность --- */
@media (max-width: 992px) { /* Точка, когда блоки начнут переноситься */
    .ed-toolbar-wrapper {
        justify-content: flex-start; /* Начинаем с левого края */
    }
}

@media (max-width: 768px) {
    .brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
    .category-title {
        font-size: 24px;
    }
    .brand-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 480px) {
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}