/* Catalog Page Styles */

/* Catalog Header */
.catalog-header {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f7ff 100%);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.catalog-header .breadcrumbs {
    margin-bottom: 1.5rem;
}

.catalog-title-block {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.category-image-header {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.category-image-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-info {
    flex: 1;
}

.catalog-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0 0 0.5rem 0;
}

.catalog-description {
    font-size: 1.125rem;
    color: var(--gray);
    margin: 0;
    line-height: 1.6;
}

/* Catalog Section */
.catalog-section {
    padding: 3rem 0;
    background-color: var(--white);
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar */
.catalog-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-widget {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list li {
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.categories-list li:last-child {
    border-bottom: none;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.categories-list li:hover a,
.categories-list li.active a {
    color: var(--primary-color);
    padding-left: 1rem;
}

.categories-list li.active a {
    font-weight: 600;
    background-color: var(--light-gray);
    border-radius: 4px;
}

.category-name {
    flex: 1;
}

.category-count {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Catalog Content */
.catalog-content {
    min-height: 500px;
}

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.results-count {
    font-size: 1rem;
    color: var(--dark);
}

.results-count strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Products Grid in Catalog */
.catalog-content .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.catalog-content .product-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.catalog-content .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.product-link {
    display: block;
    text-decoration: none;
}

.catalog-content .product-image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: var(--light-gray);
}

.catalog-content .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.catalog-content .product-card:hover .product-image {
    transform: scale(1.1);
}

.catalog-content .product-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.catalog-content .product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.catalog-content .product-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    min-height: 2.6em;
}

.catalog-content .product-name a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.catalog-content .product-name a:hover {
    color: var(--primary-color);
}

.catalog-content .product-articul {
    font-size: 0.875rem;
    color: var(--gray);
    margin: 0;
}

.catalog-content .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.product-stock {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.product-stock.in-stock {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.product-stock.out-of-stock {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.catalog-content .product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.catalog-content .product-actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.6rem 1rem;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.page-link.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    cursor: default;
}

.pagination-info {
    font-size: 0.95rem;
    color: var(--gray);
}

/* Empty Catalog */
.empty-catalog {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.empty-catalog h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.empty-catalog p {
    font-size: 1.125rem;
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .catalog-sidebar {
        position: static;
    }
    
    .sidebar-widget {
        margin-bottom: 2rem;
    }
    
    .catalog-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .catalog-layout{
        display: flex;
        flex-direction: column;
    {
    .catalog-title-block {
        flex-direction: column;
        text-align: center;
    }
    
    .category-image-header {
        width: 100px;
        height: 100px;
    }
    
    .catalog-title {
        font-size: 1.75rem;
    }
    
    .catalog-content .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .catalog-toolbar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination {
        font-size: 0.875rem;
    }
    
    .page-link {
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .catalog-header {
        padding: 1.5rem 0;
    }
    
    .catalog-section {
        padding: 2rem 0;
    }
    
    .catalog-content .products-grid {
        grid-template-columns: 1fr;
    }
    
    .catalog-content .product-actions {
        flex-direction: column;
    }
    
    .catalog-content .product-actions .btn {
        width: 100%;
    }
}
