/* Стили для выпадающего меню категорий */
.categories-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
}

.categories-sidebar.show {
    left: 0;
}

/* Стили для выпадающего меню подкатегорий */
.subcategories-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1051;
    overflow-y: auto;
}

.subcategories-sidebar.show {
    left: 0;
}

.categories-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.categories-backdrop.show {
    display: block;
}

.categories-header,
.subcategories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.categories-content,
.subcategories-content {
    padding: 15px;
}

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

.category-item {
    position: relative;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.category-header {
    width: 100%;
}

.category-item a {
    text-decoration: none;
    color: #212529;
    font-weight: 500;
    flex-grow: 1;
}

.category-item a:hover {
    color: #0d6efd;
}

.toggle-subcategories {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0;
    margin-left: 8px;
}

.toggle-subcategories:hover {
    color: #0d6efd;
}

.subcategory-panel {
    margin-top: 10px;
}

.subcategory-panel h5 {
    margin-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.subcategory-item {
    padding: 5px 0;
}

.subcategory-item a {
    text-decoration: none;
    color: #212529;
    display: block;
    padding: 5px 0;
}

.subcategory-item a:hover {
    color: #0d6efd;
}

#back-to-categories {
    color: #212529;
    background: none;
    border: none;
    padding: 0;
}

/* Стили для кнопки и строки поиска в верхней панели */
.search-categories-container {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.search-form {
    display: flex;
    margin-right: 10px;
}

.search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.search-button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Responsive styles for different screen sizes */
@media (max-width: 992px) {
    .search-categories-container {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .search-form {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .categories-sidebar {
        width: 280px;
    }
    
    .subcategories-sidebar {
        width: 280px;
    }
}

@media (max-width: 576px) {
    .categories-sidebar {
        width: 250px;
    }
    
    .subcategories-sidebar {
        width: 250px;
    }
    
    .subcategories-dropdown {
        position: static;
        width: auto;
        box-shadow: none;
        padding: 0 0 0 15px;
        margin-top: 5px;
    }
    
    .search-categories-container {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .search-form {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .category-item {
        padding: 8px 0;
    }
    
    .categories-header h4,
    .subcategories-header h4 {
        font-size: 1.1rem;
        margin: 0;
    }
}

@media (max-width: 375px) {
    .categories-sidebar {
        width: 85%;
    }
    
    .subcategories-sidebar {
        width: 85%;
    }
}
