/* frontend/catalog/catalog.css */

.catalog-page {
    padding: 60px 0;
    background: var(--bg-primary);
    min-height: 60vh;
    transition: background-color 0.3s;
}

.catalog-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* ===== Сайдбар ===== */
.catalog-sidebar {
    background: var(--bg-secondary);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 30px 20px;
    border: var(--border-light);
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
    transition: background-color 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.sidebar-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--red-light);
    border-radius: 2px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 10px;
}

.category-link {
    display: block;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.category-link:hover,
.category-link.active {
    background: var(--shadow-red); /* используем полупрозрачный красный фон */
    border-left-color: var(--red-light);
    color: var(--red-light);
    transform: translateX(5px);
}

/* Светлая тема: фон активной категории делаем более заметным */
.light-theme .category-link:hover,
.light-theme .category-link.active {
    background: rgba(180, 0, 0, 0.1);
}

/* ===== Сетка товаров ===== */
.catalog-content {
    width: 100%;
}

.catalog-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 40px;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* ===== Карточка товара ===== */
.product-card {
    background: var(--gradient-card);
    border-radius: 20px;
    border: 2px solid rgba(139, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
    overflow: hidden;
    height: 100%;
}

.product-card:hover {
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--red-light);
    border-color: var(--red-light);
    transform: translateY(-5px);
}

.product-card__image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-card__image img {
    transform: scale(1.05);
}

.product-card__info {
    padding: 20px 15px;
    text-align: center;
    border-top: var(--border-light);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* Кнопка "Подробнее" (всегда красная с белым текстом) */
.btn--small {
    display: inline-block;
    padding: 10px 20px;
    background: var(--red-dark);
    color: #ffffff;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: auto;
    align-self: center;
    border: none;
    box-shadow: 0 4px 10px var(--shadow-red);
}

.btn--small:hover {
    background: var(--red-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow-red);
}

/* ===== Пагинация ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    border: var(--border-light);
    transition: all 0.3s;
    font-weight: 500;
}

.pagination a:hover {
    background: var(--red-dark);
    color: #ffffff;
    border-color: var(--red-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-red);
}

.pagination .current {
    background: var(--red-dark);
    color: #ffffff;
    border-color: var(--red-light);
    font-weight: bold;
    cursor: default;
    box-shadow: 0 4px 10px var(--shadow-red);
}

/* ===== Адаптивность ===== */
@media (max-width: 992px) {
    .catalog-container {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 768px) {
    .catalog-container {
        grid-template-columns: 1fr;
    }
    .catalog-sidebar {
        position: static;
        margin-bottom: 30px;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    .pagination a,
    .pagination span {
        min-width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}