.catalog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

.search-container{
    padding-top: 1rem;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Сайдбар категорий */
.catalog-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 2rem;
}

.catalog-sidebar h3 {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.categories-tree {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.category-item, .subcategory-item {
    margin-bottom: 0.5rem;
}

.category-header, .subcategory-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.category-header a, .subcategory-header a {
    flex: 1;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.category-header a:hover, .subcategory-header a:hover,
.category-header a.active, .subcategory-header a.active {
    color: #259da8;
}

.category-count {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6c757d;
    min-width: 30px;
    text-align: center;
}

.subcategories {
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 2px solid #e9ecef;
}

.subsubcategories {
    margin-left: 1.5rem;
}

.subsubcategory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.9rem;
    padding: 0.25rem 0;
    transition: color 0.2s
    ease;
}

.subsubcategory-item:hover,
.subsubcategory-item.active {
    color: #259da8;
}

/* Основной контент */
.catalog-main {
    min-height: 600px;
}

.catalog-header {
    margin-bottom: 2rem;
}

.catalog-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.catalog-stats {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.out-of-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.product-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: #259da8;
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.product-features li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #555;
    position: relative;
    padding-left: 1rem;
}

.product-features li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #259da8;
}

.product-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    flex: 1;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    flex: 1;
}

.btn-primary {
    display: flex;
    background: #259da8;
    color: white;
}

.btn-primary:hover {
    background: #1d7a85;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Состояние пустого каталога */
.catalog-empty {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.catalog-empty h3 {
    margin: 0 0 1rem 0;
    color: #495057;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .catalog-sidebar {
        position: static;
        order: 2;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-actions {
        flex-direction: column;
    }

    .catalog-title {
        font-size: 1.5rem;
    }
}