/* Глобальное боковое меню продуктов */

/* Класс для блокировки скролла при открытом мобильном меню */
body.mobile-sidebar-open {
    position: fixed;
    top: var(--scroll-y, 0);
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0);
}

.global-product-sidebar {
    border-radius: 10px;
    position: sticky;
    height: 86vh;
    overflow: scroll;
    /* Скрытие скролл-бара */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.global-product-sidebar::-webkit-scrollbar {
    display: none; /* WebKit */
}

/* Скрыть заголовок "Каталог продуктов" в настольной версии */
@media (min-width: 768px) {
    .sidebar-main-title {
        display: none;
    }
    
    .sidebar-header {
        margin-bottom: 0;
    }
}

/* Стили для правильного sticky позиционирования */
@media (min-width: 768px) {
    /* Только для нашего виджета, не трогаем общий layout */
    .widget_global_product_sidebar .global-product-sidebar {
    }
}

.sidebar-header {

}

.sidebar-main-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
}

/* Секции меню */
.sidebar-section {
    background: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sidebar-section-title.active {
    background: #E8E8E8;
}

.sidebar-section-link {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

.sidebar-section-link:hover {
    color: #0E64B1;
}

.section-arrow {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    user-select: none;
}

.sidebar-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.15s ease;
}

.sidebar-section-content.expanded {
    max-height: 2000px;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Категории */
.sidebar-categories {
    padding: 0;
}

.sidebar-category-group {
    margin-bottom: 16px;
}

.sidebar-category-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 4px 0 12px;
}

.sidebar-category-item {
    display: block;
    padding: 0 12px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    min-height: 18px;
    display: flex;
    align-items: center;
}

.sidebar-category-item:hover {
    background: #E8E8E8;
    color: #0E64B1;
}

.sidebar-category-item.active {
    background: #0E64B1;
    color: white;
    font-weight: 500;
}

/* Фильтры */
.sidebar-filters-divider {
    height: 1px;
    background: #ddd;
    margin: 12px 0;
}

.sidebar-filters-wrapper {
    padding: 0;
}

.sidebar-filters-wrapper .printer-filters,
.sidebar-filters-wrapper .cutter-filters,
.sidebar-filters-wrapper .ink-filters {
    padding: 0;
    background: transparent;
}

.sidebar-filters-wrapper .ink-filters .filter-info,
.sidebar-filters-wrapper .ink-filters .ink-info-block {
    padding: 0 12px;
    margin-bottom: 16px;
}

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

.sidebar-filters-wrapper .filter-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 4px 0 12px;
}

.sidebar-filters-wrapper .filter-option {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    color: #333;
    border-radius: 6px;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    cursor: pointer;

}

.sidebar-filters-wrapper .filter-option:hover {
    background: #E8E8E8;
    color: #0E64B1;
}

.sidebar-filters-wrapper .filter-option.disabled {
    cursor: not-allowed !important;
}

.sidebar-filters-wrapper .filter-option.disabled span {
    color: #999;
    opacity: 0.6;
}

.sidebar-filters-wrapper .filter-option.disabled:hover {
    color: inherit !important;
    background: transparent !important;
}

.sidebar-filters-wrapper .filter-option.disabled input[type="checkbox"] {
    cursor: not-allowed !important;
    opacity: 0.5;
}

/* Мобильная версия */
@media (max-width: 768px) {
    /* Header делаем fixed чтобы всегда был виден */
    header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        background: white;
        transition: none !important;
    }
    
    /* Убираем transition с body для предотвращения скачков */
    body {
        transition: none !important;
    }
    
    .global-product-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        padding: 0 20px 40px 20px;
        background-color: #FFF;
        max-width: 320px;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1000;
        margin: 0;
        border-radius: 0;
        transition: left 0.3s ease;
        -webkit-overflow-scrolling: touch;
        padding-top: 80px;
    }
    
    .global-product-sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.visible {
        display: block;
    }
    
    .mobile-sidebar-trigger {
        position: static;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #0E64B1;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 500;
        cursor: pointer;

        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 769px) {
    .mobile-sidebar-trigger,
    .sidebar-overlay {
        display: none;
    }
}

