/* --- СТИЛИ ДЛЯ СТРАНИЦЫ СПИСКА ТОВАРОВ --- */

main {
    padding-top: 85px;
}

.page-header {
    padding: 60px 0;
    text-align: center;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--subtext-color);
    max-width: 700px;
    margin: 0 auto;
}

/* Основной макет страницы с сайдбаром */
.products-page-layout {
    display: grid;
    grid-template-columns: 280px 1fr; /* Сайдбар 280px, остальное - товары */
    gap: 40px;
    padding-top: 40px;
}

/* Боковая панель фильтров */
.filters-sidebar {
    position: sticky;
    top: 120px; /* Отступ от верха = высота шапки + немного пространства */
    height: fit-content; /* Высота по содержимому */
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.filters-sidebar h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.filter-group {
    margin-bottom: 25px;
}

.radio-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.radio-label input {
    margin-right: 10px;
}

.price-slider-container .price-inputs {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-inputs input {
    width: 45%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
}

/* Стили для секции с товарами */
.product-listing-section {
    padding: 0 0 80px 0;
}

.product-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    transition: opacity 0.3s;
}

.product-item-card {
    background-color: var(--surface-color);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.product-item-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-orange);
}

.product-item-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.product-item-image {
    height: 180px;
    margin-bottom: 20px;
}

.product-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.product-note {
    font-size: 0.85rem;
    color: var(--subtext-color);
    line-height: 1.5;
    margin-bottom: 15px;
    height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.product-item-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-blue);
    margin-top: auto;
    padding-top: 10px;
}

.product-item-button {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s;
    margin-top: 15px;
}

.product-item-button:hover {
    background-color: var(--accent-blue-hover);
}

.no-products-message {
    font-size: 1.2rem;
    color: var(--subtext-color);
    text-align: center;
    grid-column: 1 / -1;
}

/* Адаптивность для страницы товаров */
@media (max-width: 992px) {
    .products-page-layout {
        grid-template-columns: 1fr; /* В одну колонку */
    }
    .filters-sidebar {
        position: static; /* Сайдбар перестает быть липким */
        top: auto;
    }
}

/* ИЗМЕНЕНИЕ: Добавляем правило для мобильных устройств */
@media (max-width: 768px) {
    .product-list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .product-item-card {
        padding: 15px;
    }
    .product-item-image {
        height: 140px;
        margin-bottom: 15px;
    }
    .product-item-title {
        font-size: 0.9rem;
    }
    .product-note {
        display: none; /* Скрываем описание на мобильных для компактности */
    }
    .product-item-price {
        font-size: 1.1rem;
    }
    .product-item-button {
        font-size: 0.8rem;
        padding: 10px;
    }
}
