/* ================================================================
   КАТЕГОРИИ В BRICKS OFFCANVAS
   Подключается через wp_enqueue_style в mobile-menu-bricks.php
   ================================================================ */

.parusweb-mobile-categories {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.mobile-categories-header {
    padding: 0 20px 16px;
}

.mobile-categories-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Список категорий */
.mobile-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-category-item {
    border-bottom: 1px solid #f0f0f0;
}

.category-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fff;
    transition: background 0.2s ease;
}

.category-item-header:hover {
    background: #fafafa;
}

.category-link {
    flex: 1;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-link:hover {
    color: #8bc34a;
}

.category-count {
    font-size: 13px;
    color: #999;
    font-weight: 400;
}

.category-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: transform 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-category-item.is-expanded .category-toggle {
    transform: rotate(180deg);
}

.category-toggle:hover {
    color: #8bc34a;
}

/* Подкатегории */
.category-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: #fafafa;
}

.mobile-category-item.is-expanded .category-children {
    max-height: 2000px;
}

.mobile-subcategories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-subcategory-item {
    border-bottom: 1px solid #e8e8e8;
    background: #fafafa;
    transition: background 0.2s ease;
}

.mobile-subcategory-item:hover {
    background: #f5f5f5;
}

.subcategory-header {
    padding: 12px 20px 12px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subcategory-link {
    flex: 1;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subcategory-link:hover {
    color: #8bc34a;
}

.subcategory-count {
    font-size: 12px;
    color: #aaa;
}

.subcategory-filters-toggle {
    background: #8bc34a;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.subcategory-filters-toggle:hover {
    background: #7cb342;
}

/* Фильтры */
.mobile-filters-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0;
    background: #fff;
}

.mobile-filters-container.is-visible {
    max-height: 1500px;
    padding: 5px;
}

.filters-list {
    background: #fff;
    border-radius: 4px;
    padding: 5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 12px;
    column-gap: 12px;
}

.filter-item {
    break-inside: avoid;
}

.filter-item a {
    text-decoration: none;
    color: #555;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 6px;
    border-radius: 3px;
    transition: background 0.2s ease, color 0.2s ease;
}

.filter-item a:hover {
    background: #f0f8e8;
    color: #8bc34a;
}

.filter-count {
    font-size: 10px;
    color: #aaa;
    margin-left: 4px;
    flex-shrink: 0;
}

.no-filters {
    padding: 12px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 13px;
    margin: 0;
}

/* ================================================================
   АДАПТИВНОСТЬ
   ================================================================ */

@media (min-width: 1200px) {
    .parusweb-mobile-categories {
        display: none;
    }
}

@media (max-width: 320px) {
    .mobile-categories-header h3 {
        font-size: 16px;
    }

    .category-link {
        font-size: 14px;
    }

    .subcategory-link {
        font-size: 13px;
    }

    .subcategory-filters-toggle {
        padding: 5px 10px;
        font-size: 11px;
    }

    .filter-items {
        grid-template-columns: 1fr;
    }

    .filter-item a {
        font-size: 13px;
        padding: 6px 8px;
    }
}
