/* Main container for the bottom row of the product card */
.bg-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    width: 100%;
}

/* Price Section */
.bg-price {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

/* Actions Section (Buttons) */
.bg-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Custom "Buy" Button */
.bg-buy-btn {
    background-color: #25d366; /* Green matching WhatsApp or generic "success" */
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.bg-buy-btn:hover {
    background-color: #20b857;
    color: #ffffff;
}

/* Ensure WooCommerce's own add to cart button (if icon only) aligns nicely */
.bg-actions-right .button {
    margin: 0 !important; /* Override potential theme margins */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ast-site-content .widget_product_categories ul,
.ast-site-content .widget_nav_menu ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Стиль каждой ссылки категории */
.ast-site-content .widget_product_categories ul li a,
.ast-site-content .widget_nav_menu ul li a {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    color: #333; /* Цвет текста */
    border-bottom: 1px solid #f0f0f0; /* Тонкая линия разделитель */
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

/* При наведении */
.ast-site-content .widget_product_categories ul li a:hover {
    color: #78a22f; /* Твой фирменный зеленый */
    padding-left: 5px; /* Небольшой сдвиг вправо */
}

/* Активная категория (где мы сейчас находимся) */
.ast-site-content .widget_product_categories ul li.current-cat > a,
.ast-site-content .widget_nav_menu ul li.current-menu-item > a {
    font-weight: 700;
    color: #78a22f;
}

/* Заголовок виджета (например "Категории") */
.secondary .widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #000;
    border-left: 4px solid #78a22f; /* Зеленая полоска слева от заголовка */
    padding-left: 10px;
    line-height: 1.2;
}

/* 📱 МОБИЛЬНАЯ ВЕРСИЯ: Скрываем сайдбар вниз или делаем кнопку */
/* Обычно тема Astra сама убирает сайдбар вниз на телефонах. 
   Если хочешь, чтобы на телефоне категории были СВЕРХУ как кнопки (тот код, что я давал раньше), 
   оставь код из предыдущего ответа про .bg-category-nav-wrapper.
   Сайдбар на телефоне занимает много места, лучше использовать горизонтальный скролл.
*/
@media (max-width: 768px) {
    /* Если хочешь скрыть этот длинный список на телефоне, раскомментируй строку ниже */
    /* .sidebar-main { display: none; } */
}

/* ==================================================
   💎 СТИЛЬНЫЕ ФИЛЬТРЫ КАТАЛОГА
   ================================================== */

/* 1. Фильтр цены (бегунок) */
.widget_price_filter .ui-slider .ui-slider-range {
    background-color: #78a22f !important; /* Твой зеленый */
}

.widget_price_filter .ui-slider .ui-slider-handle {
    background-color: #78a22f !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.widget_price_filter .price_slider_amount .button {
    background-color: #f0f0f0 !important;
    color: #333 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 4px !important;
}

/* 2. Общий стиль заголовков в сайдбаре */
.secondary .widget-title {
    font-size: 16px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px !important;
    position: relative;
    padding-bottom: 10px;
}

.secondary .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #78a22f; /* Линия под заголовком */
}

/* 3. Списки фильтров (атрибуты, категории) */
.widget_product_categories ul li, 
.widget_layered_nav ul li {
    padding: 6px 0 !important;
    border-bottom: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget_product_categories ul li:last-child, 
.widget_layered_nav ul li:last-child {
    border-bottom: none;
}

/* Делаем чекбоксы категорий аккуратнее */
.widget_product_categories ul li, 
.widget_layered_nav ul li {
    font-size: 14px;
    color: #555;
}

/* Улучшаем внешний вид ползунка цены */
.price_slider_wrapper .ui-widget-content {
    background-color: #eee !important;
    height: 4px !important;
}

.price_slider_wrapper .ui-slider-range {
    background-color: #78a22f !important; /* Твой зеленый */
}

/* Количество товаров рядом с фильтром (в кружочке) */
.widget_product_categories span.count, 
.widget_layered_nav span.count {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #999;
}

/* 4. Кнопка сброса фильтров */
.widget_rating_filter .wc-layered-nav-rating a,
.widget_layered_nav_filters ul li a {
    background-color: #ffeded !important;
    color: #d32f2f !important;
    padding: 5px 10px !important;
    border-radius: 4px;
    font-size: 12px;
}

/* Переносим сайдбар наверх только на мобильных */
@media (max-width: 921px) {
    .ast-left-sidebar #content > .ast-container {
        display: flex;
        flex-direction: column;
    }
    #secondary {
        order: -1; /* Ставит сайдбар самым первым */
        margin-bottom: 30px;
        padding: 15px;
        background: #f9f9f9;
        border-radius: 8px;
    }
}

/* ==================================================
   📱 ФИНАЛЬНЫЙ ФИКС МОБИЛЬНЫХ ФИЛЬТРОВ
   ================================================== */

@media (max-width: 921px) {
    /* 1. Скрываем стандартную кнопку Astra внизу, если она есть */
    .ast-woo-mobile-filter-button, 
    .woocommerce-result-count + .button { 
        display: none !important; 
    }

    /* 2. Скрываем сайдбар по умолчанию */
    #secondary, .sidebar-main, .widget-area {
        display: none !important;
        width: 100% !important;
        float: none !important;
        margin: 0 0 20px 0 !important;
        padding: 20px !important;
        background: #fff !important;
        border: 1px solid #78a22f !important; /* Зеленая рамка для акцента */
        clear: both !important;
    }

    /* 3. Класс для показа (когда нажали кнопку) */
    #secondary.show-filters, 
    .sidebar-main.show-filters, 
    .widget-area.show-filters {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 4. Наша кнопка */
    .bg-filter-btn {
        display: block !important;
        width: 100%;
        padding: 15px;
        background: #78a22f !important; /* Сделаем её зеленой, чтобы было заметно */
        color: #fff !important;
        border: none;
        border-radius: 8px;
        margin-bottom: 15px;
        font-weight: 700;
        text-transform: uppercase;
        box-shadow: 0 4px 10px rgba(120, 162, 47, 0.2);
    }
}