/* === Общие стили каталога === */
.page-title {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 32px;
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.catalog-section {
    background-color: var(--bg-light);
    padding: 40px 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* === Фильтры слева === */
.filters {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.filters h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-filter {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-filter li {
    margin-bottom: 10px;
}

.category-filter a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 15px;
}

.category-filter a:hover,
.category-filter a.active {
    background: var(--primary-color);
    color: var(--white);
}

/* === Контент каталога === */
.catalog-content {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

/* === Сетка подкатегорий === */
.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.subcategory-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.subcategory-card a {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: var(--text-dark);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subcategory-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.subcategory-image img {
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.subcategory-card h3 {
    font-size: 18px;
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.3;
    flex-grow: 1;
}

.subcategory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* === Сетка товаров === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* === Изображение товара === */
.catalog-section .product-card .product-image {
    position: relative;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    padding: 12px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}

.catalog-section .product-card .product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.catalog-section .product-card:hover .product-image img {
    transform: scale(1.02);
}

.badge.sale {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e53e3e;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 20px;
    z-index: 2;
}

/* === Информация о товаре === */
.catalog-section .product-card .product-info {
    padding: 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    display: inline-block;
    font-size: 11px;
    color: var(--secondary-color);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.product-info h3 {
    font-size: 16px;
    margin: 0 0 10px;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.3;
    min-height: 40px;
}

.product-description {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.5;
    flex-grow: 1;
}

.product-price {
    margin-bottom: 12px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 6px;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-actions .btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
}

/* === Нет товаров === */
.no-products {
    text-align: center;
    padding: 60px 10px;
}

.no-products i {
    font-size: 56px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.no-products h3 {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.no-products p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.no-products .btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 968px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .filters {
        position: static;
        margin-bottom: 20px;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .catalog-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sorting {
        justify-content: center;
        width: 100%;
    }
    
    .sorting select {
        width: 100%;
        min-width: auto;
    }
    
    .page-title {
        font-size: 28px;
        margin-bottom: 24px;
    }
    
    .subcategory-image {
        height: 160px;
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .catalog-section .product-card .product-image {
        height: 200px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions .btn {
        width: 100%;
    }
    
    .results-count,
    .sorting label {
        font-size: 14px;
    }
    
    .badge.sale {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .product-info h3 {
        font-size: 15px;
        min-height: 36px;
    }
    
    .price {
        font-size: 17px;
    }
    
    .subcategory-image {
        height: 140px;
    }
    
    .subcategory-card h3 {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .catalog-section .product-card .product-image {
        height: 180px;
    }
    
    .product-info h3 {
        font-size: 14px;
        min-height: 32px;
    }
    
    .product-description {
        font-size: 12px;
    }
    
    .price {
        font-size: 16px;
    }
    
    .subcategory-image {
        height: 120px;
    }
}
/* === Сетка подкатегорий === */
.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.subcategory-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.subcategory-card a {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: var(--text-dark);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subcategory-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.subcategory-image img {
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.subcategory-card h3 {
    font-size: 18px;
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.3;
    flex-grow: 1;
}

.subcategory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Добавим это в конец catalog.css для правильного отображения */
@media (max-width: 968px) {
    .subcategories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .subcategories-grid {
        grid-template-columns: 1fr;
    }
    
    .subcategory-image {
        height: 150px;
    }
}