/* ===========================================
   Сайдбар — премиальный стиль
   =========================================== */

/* Обёртка сайдбара — только десктоп */
.rv-legacy-sidebar {
    max-width: 300px;
}

/* Скрываем сайдбар на мобильных и планшетах */
@media (max-width: 1023px) {
    .rv-legacy-sidebar {
        display: none !important;
    }
}

/* Заголовок сайдбара «КАТЕГОРИИ» */
.rv-legacy-sidebar h3 {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px !important;
    color: #0f172a;
    position: relative;
    padding-bottom: 12px;
}

/* Градиентная линия под заголовком */
.rv-legacy-sidebar h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #1e54c8, #3b82f6);
    border-radius: 3px;
}

/* Список категорий WooCommerce */
.rv-legacy-sidebar .wc-block-product-categories-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.rv-legacy-sidebar .wc-block-product-categories-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.rv-legacy-sidebar .wc-block-product-categories-list li:last-child {
    border-bottom: none;
}

/* Ссылки категорий */
.rv-legacy-sidebar .wc-block-product-categories-list li a {
    box-sizing: border-box;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    padding: 10px 34px 10px 16px;
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    transition: color 0.2s ease, padding-left 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
}

/* Стрелка справа */
.rv-legacy-sidebar .wc-block-product-categories-list li a::after {
    content: '›';
    position: absolute;
    right: 16px;
    color: #94a3b8;
    font-size: 22px;
    font-weight: 300;
    transition: transform 0.25s ease, color 0.25s ease;
}

/* Счётчик товаров */
.rv-legacy-sidebar .wc-block-product-categories-list-item-count {
    flex: 0 0 auto;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    margin: 0 14px 0 6px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    transition: background 0.25s ease, color 0.25s ease;
}

/* Hover-эффект ссылок */
.rv-legacy-sidebar .wc-block-product-categories-list li:hover {
    background: linear-gradient(90deg, rgba(22, 78, 126, 0.09), rgba(22, 78, 126, 0.02));
    box-shadow: inset 3px 0 0 #1e54c8;
}

.rv-legacy-sidebar .wc-block-product-categories-list li:hover > a {
    color: #1e54c8;
    padding-left: 20px;
}

.rv-legacy-sidebar .wc-block-product-categories-list li:hover > a::after {
    color: #1e54c8;
    transform: translateX(3px);
}

.rv-legacy-sidebar .wc-block-product-categories-list li:hover > .wc-block-product-categories-list-item-count {
    background: rgba(30, 84, 200, 0.08);
    color: #1e54c8;
}

.rv-legacy-sidebar .wc-block-product-categories-list li.current-cat > a {
    color: var(--rv-brand);
    background: var(--rv-active-row);
    border-left-color: var(--rv-brand);
    font-weight: 700;
}

/* Вложенные категории (подкатегории) */
.rv-legacy-sidebar .wc-block-product-categories-list .wc-block-product-categories-list {
    flex: 1 1 100%;
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-left: 0 !important;
    background: #fafbfc;
}

.rv-legacy-sidebar .wc-block-product-categories-list .wc-block-product-categories-list li {
    border-bottom-color: #eef2f7;
}

.rv-legacy-sidebar .wc-block-product-categories-list .wc-block-product-categories-list li a {
    min-height: 42px;
    padding: 9px 34px 9px 30px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    border-left: none;
}

.rv-legacy-sidebar .wc-block-product-categories-list .wc-block-product-categories-list li a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    margin-right: 10px;
    flex-shrink: 0;
    transition: background 0.25s ease, transform 0.25s ease;
}

.rv-legacy-sidebar .wc-block-product-categories-list .wc-block-product-categories-list li a:hover {
    padding-left: 34px;
    background: linear-gradient(90deg, rgba(22, 78, 126, 0.07), transparent);
    border-left: none;
}

.rv-legacy-sidebar .wc-block-product-categories-list .wc-block-product-categories-list li a:hover::before {
    background: #1e54c8;
    transform: scale(1.3);
}
