/* ==================================================================
   CATALOG.CSS — ПОЛНЫЙ КОМПЛЕКТ СТИЛЕЙ ДЛЯ СТРАНИЦЫ КАТАЛОГА
   Цвета: красный (#dc2626) + белый + графитовый
   Адаптив: мобильные, планшеты, десктоп
   ================================================================== */

/* -------------------- БАЗОВЫЙ СБРОС -------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* -------------------- ПЕРЕМЕННЫЕ (красная тема) -------------------- */
:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #fef2f2;
    --secondary: #111111;
    --text-muted: #666666;
    --border: #e5e5e5;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-md: 0 20px 30px -12px rgba(220,38,38,0.15);
}

/* -------------------- ОБЩИЕ ЭЛЕМЕНТЫ -------------------- */
.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    color: var(--secondary);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 12px auto 0;
    border-radius: 4px;
}

.accent-text {
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    border-radius: 48px;
    font-weight: 700;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220,38,38,0.4);
}

/* -------------------- ШАПКА (копия из index, но можно оставить) -------------------- */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
}

.logo img {
    max-height: 80px;
    width: auto;
}

.main-nav .nav-list {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: var(--secondary);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.header-contacts {
    text-align: right;
}

.header-phone {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.work-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.cart-icon {
    position: relative;
    font-size: 1.7rem;
    color: var(--secondary);
    transition: color 0.2s;
}

.cart-icon:hover {
    color: var(--primary);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.7rem;
    cursor: pointer;
    color: var(--primary);
}

/* -------------------- ХЛЕБНЫЕ КРОШКИ (page-header) -------------------- */
.page-header {
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 8px;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

/* -------------------- КАТАЛОГ: СЕТКА -------------------- */
.catalog-section {
    padding: 50px 0;
    background: #ffffff;
}

.catalog-layout {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

/* ----- САЙДБАР (фильтры) ----- */
.catalog-sidebar {
    flex: 0 0 280px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.filter-block {
    margin-bottom: 28px;
}

.filter-block h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Поиск */
.category-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 40px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.category-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

/* Чекбоксы категорий */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333333;
    transition: color 0.2s;
}

.filter-checkboxes label:hover {
    color: var(--primary);
}

.filter-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Фильтр цены */
.price-range {
    margin-top: 8px;
}

.price-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.price-input {
    flex: 1;
}

.price-input label {
    font-size: 0.7rem;
    color: #999;
    display: block;
    margin-bottom: 4px;
}

.price-input input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-align: center;
}

.price-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.price-slider {
    position: relative;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin: 20px 0;
}

.price-slider .range {
    position: absolute;
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

/* Кнопки фильтров */
.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-filter {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 0;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-reset {
    flex: 1;
    background: transparent;
    color: #333;
    border: 2px solid var(--border);
    padding: 10px 0;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ----- ОСНОВНАЯ ЧАСТЬ (карточки, тулбар) ----- */
.catalog-main {
    flex: 1;
    min-width: 0;
}

/* Активные фильтры */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.filter-tag:hover {
    background: var(--primary);
    color: white;
}

.filter-tag i {
    font-size: 0.7rem;
}

/* Тулбар (счетчик + переключатель вида) */
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.catalog-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    width: 38px;
    height: 38px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #999;
}

.view-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.view-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* -------------------- СЕТКА ТОВАРОВ (АВТОМОБИЛИ) -------------------- */
.products-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.products-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid.list {
    grid-template-columns: 1fr;
}

/* Карточка автомобиля (увеличенная, как карусель на главной) */
.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    cursor: pointer;
    animation: fadeIn 0.4s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-image {
    position: relative;
    background: #fafafa;
    padding: 20px;
    text-align: center;
}

.product-image img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.product-info {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.product-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--secondary);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.product-year {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: normal;
}

.product-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.product-desc span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.product-desc i {
    font-size: 0.7rem;
    color: var(--primary);
}

.product-price {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary);
    margin: 12px 0;
}

.product-price old {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
    font-weight: normal;
    margin-left: 8px;
}

.product-card .btn-sm {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.product-card .btn-sm:hover {
    background: var(--primary-dark);
}

/* List view (список) */
.products-grid.list .product-card {
    display: flex;
    align-items: center;
}

.products-grid.list .product-image {
    flex: 0 0 200px;
    padding: 20px;
}

.products-grid.list .product-image img {
    height: 140px;
}

.products-grid.list .product-info {
    flex: 1;
    border-top: none;
    border-left: 1px solid var(--border);
}

/* -------------------- ПАГИНАЦИЯ -------------------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination button {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination button:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* -------------------- ПУСТОЕ СОСТОЯНИЕ -------------------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--primary-light);
    border-radius: 20px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
}

/* -------------------- ПОДВАЛ (автомобильная версия) -------------------- */
.footer {
    background: #111111;
    color: #e0e0e0;
    padding: 56px 0 28px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    justify-content: space-between;
    margin-bottom: 48px;
}

.footer-col {
    flex: 1;
    min-width: 180px;
}

.footer-logo img {
    max-height: 70px;
}

.footer h4 {
    color: white;
    font-weight: 800;
    margin-bottom: 20px;
    font-size: 1rem;
    letter-spacing: 1px;
}

.footer-links li,
.footer-contacts li {
    margin-bottom: 12px;
}

.footer-links a:hover,
.footer-contacts a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid #2a2a2a;
    padding-top: 32px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-social a {
    background: #2a2a2a;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 10px;
    transition: 0.2s;
    color: white;
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* -------------------- АНИМАЦИИ -------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------- АДАПТИВНОСТЬ (мобильные + планшеты) -------------------- */
@media (max-width: 1100px) {
    .products-grid.grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 860px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 280px;
        height: 100%;
        background: white;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
        transition: left 0.3s;
        z-index: 99;
        padding: 40px 28px;
    }

    .main-nav.open {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 24px;
    }

    .header-contacts {
        display: none;
    }

    .catalog-layout {
        flex-direction: column;
    }

    .catalog-sidebar {
        flex: auto;
        position: static;
        width: 100%;
    }

    .products-grid.grid-3 {
        grid-template-columns: 1fr;
    }

    .products-grid.list .product-card {
        flex-direction: column;
    }

    .products-grid.list .product-info {
        border-left: none;
        border-top: 1px solid var(--border);
        width: 100%;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 640px) {
    .section-title {
        font-size: 1.8rem;
    }

    .price-inputs {
        flex-direction: column;
    }

    .filter-actions {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}