/* ==========================================================================
   СТИЛИ ДЛЯ СТРАНИЦЫ КАТАЛОГА (FINAL)
   ========================================================================== */

/* --- 1. ОБЩАЯ СТРУКТУРА --- */
.catalog-page {
    padding: 30px 0 80px;
    background-color: #f9f9f9; /* #F8FAFC; */
    min-height: 100vh;
}

.catalog-header-block { display: none; } /* Скрываем старый заголовок */

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* --- 2. САЙДБАР (ФИЛЬТРЫ) --- */
.catalog-sidebar {
    background: #FFFFFF;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #E2E8F0; /* Светлая рамка */
    /* Убрали position: sticky, max-height и overflow */
}

.filter-group { margin-bottom: 24px; }
.filter-group label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; color: #1E293B; }
.filter-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: #1E293B; }

/* Инпуты и Селекты */
.catalog-sidebar select, 
.catalog-sidebar input[type="number"] {
    width: 100%; padding: 10px 14px; border: 1px solid #E2E8F0;
    border-radius: 8px; font-size: 14px; outline: none; background: #fff; transition: 0.2s;
}
.catalog-sidebar select:focus, .catalog-sidebar input:focus { border-color: #3E89C2; }
.inputs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* --- КНОПКИ СТРАНЫ (САЙДБАР) --- */
.country-buttons {
    display: flex;
    gap: 10px; /* Чуть увеличим отступ, так как кнопки визуально легче */
    align-items: center;
}

.country-btn {
    width: 46px; /* Чуть крупнее для комфортного клика */
    height: 46px;
    border-radius: 12px;
    border: 1px solid #E2E8F0; /* Исходная тонкая рамка */
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px; /* Внутренний отступ для флага */
}

/* Стили для картинки флага */
.country-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Чтобы флаг не искажался */
    filter: none; /* Флаг чистый */
    pointer-events: none; /* Чтобы клик проходил сквозь картинку */
}

/* Ховер: легкая подсветка рамки */
.country-btn:hover {
    border-color: #94A3B8;
    transform: translateY(-1px);
}

/* АКТИВНОЕ СОСТОЯНИЕ (Ring + White Bg) */
.country-btn.active {
    background: #3E89C2; /* Фон остается белым */
    border: 2px solid #1E293B; /* Толстая темная обводка (Ring) */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Легкая тень */
    transform: translateY(-1px);
}

.country-btn:focus {
    outline: none;
}

/* Фокус с клавиатуры */
.country-btn:focus-visible {
    outline: 2px solid rgba(62, 137, 194, 0.45);
    outline-offset: 2px;
}



/* --- ЧЕКБОКСЫ (ИСПРАВЛЕННЫЕ) --- */

/* ВАЖНО: Добавили .filter-group в начало, чтобы перебить общий стиль label */
.filter-group .checkbox-wrapper {
    display: flex !important; /* Принудительно возвращаем ряд */
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: #334155;
    transition: 0.2s;
    width: 100%;
    
    /* Сбрасываем жирность, которую навязал .filter-group label */
    font-weight: 400 !important; 
}

.checkbox-wrapper:hover {
    color: #0F172A;
}

/* Скрываем стандартный инпут */
.checkbox-wrapper input {
    display: none; 
}

/* Наш кастомный квадрат */
.checkmark {
    display: block;             
    width: 20px;
    height: 20px;
    min-width: 20px;            
    border: 2px solid #CBD5E1;  
    border-radius: 6px;
    background: #FFFFFF;
    position: relative;
    transition: 0.2s;
    box-sizing: border-box;     
}

/* При наведении рамка темнеет */
.checkbox-wrapper:hover .checkmark {
    border-color: #94A3B8;
}

/* АКТИВНОЕ СОСТОЯНИЕ (Галочка нажата) */
.checkbox-wrapper input:checked + .checkmark {
    background: #1E293B;
    border-color: #1E293B;
}

/* Рисуем галочку внутри */
.checkbox-wrapper input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;       
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


/* Кнопка сброса (Спокойная, серая) */
#resetFilters {
    margin-top: 16px;
    background: #F1F5F9;       /* Светло-серый фон */
    color: #64748B;            /* Серый текст */
    border: 1px solid #E2E8F0 !important; /* Тонкая рамка */
    font-weight: 500;
    transition: 0.2s;
}

#resetFilters:hover {
    background: #E2E8F0;       /* Чуть темнее при наведении */
    color: #334155;            /* Текст темнее */
    border-color: #CBD5E1 !important;
}


/* --- ПЛАВАЮЩАЯ КНОПКА СБРОСА --- */

/* --- СБРОС ФИЛЬТРОВ: "умная" кнопка без JS --- */
.filter-actions {
    position: sticky;
    bottom: 20px;     /* отступ от низа экрана, когда "прилипнет" */
    z-index: 10;      /* достаточно, не надо 900 */
}



/* --- 3. ПРАВАЯ ЧАСТЬ (КОНТЕНТ) --- */

/* Чипсы (Теги сверху) */
.catalog-chips-row { margin-bottom: 20px; }
.catalog-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
    background: #FFFFFF; 
    border: 1px solid #E2E8F0; 
    padding: 8px 16px; 
    border-radius: 50px;
    font-size: 13px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    color: #1E293B;
    
    /* Flex чтобы крестик встал ровно в ряд */
    display: inline-flex;
    align-items: center;
}

.chip:hover { 
    border-color: #3E89C2; 
}

.chip.active { 
    background: #1E293B; 
    color: white; 
    border-color: #1E293B;
    /* Чуть меняем padding справа, чтобы визуально сбалансировать крестик */
    padding-right: 12px; 
}

/* Рисуем крестик */
.chip.active::after {
    content: "✕"; /* Аккуратный крестик (unicode) */
    font-size: 10px;
    margin-left: 8px; /* Отступ от текста */
    opacity: 0.7;     /* Чуть прозрачный, чтобы не спорил с текстом */
    transform: translateY(1px); /* Микро-коррекция по высоте */
}

.chip.active:hover::after {
    opacity: 1; /* При наведении становится ярко-белым */
}

/* Панель "Найдено + Сортировка" */
.catalog-info-bar {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px;
}
.results-count { font-size: 14px; color: #1E293B; font-weight: 500; }
.sort-controls { display: flex; align-items: center; }
#sortSelect { padding: 6px 12px; border-radius: 8px; border: 1px solid #E2E8F0; font-size: 13px; cursor: pointer; background: transparent; color: #1E293B; }


/* --- 4. КАРТОЧКИ АВТО --- */
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }

.car-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    /* overflow: hidden;  <-- УБИРАЕМ или комментируем эту строку */
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    /* Добавляем relative, на всякий случай, для позиционирования */
    position: relative; 
}

.car-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: #3E89C2; }

/* ФОТО И БЕЙДЖИ (Позиционирование) */
.car-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background-color: #F1F5F9; 
    
    /* ИСПОЛЬЗУЕМ ТВОЙ ПЛЕЙСХОЛДЕР */
    background-image: url('../img/placeholder.png'); 
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover; /* Или contain, если это логотип */
    border-radius: 16px 16px 0 0; /* Добавь эту строку */
}


/* Общий стиль для всех бейджей на фото */
.badge-overlay {
    position: absolute;
    z-index: 5;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


/* --- 1. ВЕРХНИЕ БЕЙДЖИ (Флаг, Молот, Наличие) --- */

/* Флаг (Левый верхний) */
.car-flag-icon {
    position: absolute;
    top: 10px; left: 10px; z-index: 30;
    width: 28px; height: auto;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Молоток (Сразу за флагом) */
.auction-badge-wrap {
    position: absolute;
    top: 10px; left: 46px; /* 10px + 28px + 8px отступ */
    z-index: 30;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: help;
}
.auction-icon {
    width: 100%; height: 100%;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
    transition: 0.2s;
}
.auction-badge-wrap:hover .auction-icon { transform: scale(1.15) rotate(-10deg); }

/* В наличии (Правый верхний) */
.badge-stock {
    position: absolute;
    top: 10px; right: 10px; z-index: 30;
    background: #10B981; color: white;
    font-size: 10px; font-weight: 700;
    padding: 4px 8px; border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


/* --- 2. НИЖНИЕ БЕЙДЖИ НА ФОТО (Glassmorphism) --- */

.badges-bottom-row {
    position: absolute;
    bottom: 10px; left: 10px; right: 10px;
    display: flex; gap: 6px;
    z-index: 30;
    pointer-events: none; /* Чтобы не мешали клику по карточке */
}

.badge-glass {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px); /* Размытие фона под бейджем */
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
}

.badge-glass.green {
    background: rgba(22, 163, 74, 0.85); /* Зеленый полупрозрачный */
    color: #ffffff;
}

.badge-glass.red {
    background: rgba(220, 38, 38, 0.85); /* Красный полупрозрачный */
    color: #ffffff;
}

.badge-glass.yellow {
    background: rgba(234, 179, 8, 0.9); /* Желтый */
    color: #422006;
}


/* --- 3. ФУТЕР (ДЕНЬГИ) --- */

.car-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-top: auto; padding-top: 12px;
    border-top: 1px solid #F1F5F9;
}

.price-block { display: flex; flex-direction: column; gap: 2px; }

.car-price {
    font-size: 19px !important;
    font-weight: 800; color: #0F172A;
    line-height: 1;
}

.price-subtitle { font-size: 11px; color: #94A3B8; font-weight: 400; }

/* Правая часть: Выгода */
.benefit-block { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

.benefit-value {
    color: #16A34A; font-weight: 800; font-size: 13px;
    background: #DCFCE7; padding: 2px 6px; border-radius: 4px;
}
.benefit-label { font-size: 9px; color: #166534; font-weight: 700; text-transform: uppercase; }

/* Правая часть: Обычная доставка */
.delivery-simple { font-size: 11px; color: #94A3B8; text-align: right; }



/* --- СТИЛИ ДЛЯ АУКЦИОННЫХ АВТО (ИСПРАВЛЕННЫЕ) --- */

/* 1. Желтоватый фон для самой карточки */
.car-card.auction-card {
    background-color: #FFFBEB; 
    border-color: #FEF3C7;    
}

.car-card.auction-card:hover {
    border-color: #B45309 !important;
    box-shadow: 0 10px 20px rgba(180, 83, 9, 0.1); 
}

/* 2. Обертка для иконки Молотка */
.auction-badge-wrap {
    position: absolute;
    top: 10px;
    left: 48px; 
    z-index: 30; /* ВАЖНО: Подняли слой выше слайдера (20), теперь ховер работает */
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; /* Задали явный размер зоны клика */
    height: 28px;
}

/* Сама иконка молотка */
.auction-icon {
    width: 100%;
    height: 100%;
    
    /* УБРАЛИ БЕЛЫЙ ФОН */
    background: transparent; 
    
    border-radius: 0;
    padding: 0;
    object-fit: contain;
    transition: 0.2s;
    
    /* Добавляем тень самой картинке, чтобы её было видно на белом авто */
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}

.auction-badge-wrap:hover .auction-icon {
    transform: scale(1.2); /* Чуть сильнее увеличиваем при наведении */
}

/* 3. Тултип (Всплывашка) */
.auction-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    
    background: #1E293B;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    pointer-events: none;
    z-index: 40; /* Тултип должен быть выше всего */
}

/* Стрелочка у тултипа */
.auction-tooltip::after {
    content: ''; 
    position: absolute; 
    bottom: 100%; 
    left: 50%; 
    margin-left: -4px;
    border-width: 4px; 
    border-style: solid; 
    border-color: transparent transparent #1E293B transparent;
}

.auction-badge-wrap:hover .auction-tooltip {
    opacity: 1; visibility: visible;
}


/* --- ХОВЕР-СЛАЙДЕР (ПРЕДПРОСМОТР) --- */

/* Контейнер для зон наведения (растянут на все фото) */
.hover-zones {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 20; /* Поверх бейджей, чтобы ловить мышь */
    display: flex; /* Магия: сам делит ширину поровну */
}

/* Одна зона (полоска) */
.hover-zone {
    height: 100%;
    flex-grow: 1; /* Занимает всё доступное место */
    /* background: rgba(255,0,0,0.2); Для отладки можно раскомментить */
}

/* Индикаторы (черточки внизу) */
.slider-pagination {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px; /* Высота полоски индикаторов */
    display: flex;
    gap: 2px;
    padding: 0 4px;
    z-index: 21;
    opacity: 0; /* Скрыты, пока не наведешь */
    transition: 0.2s;
}

/* Показываем индикаторы при наведении на все фото */
.car-img-wrap:hover .slider-pagination {
    opacity: 1;
}

/* Сама черточка */
.slider-dot {
    flex-grow: 1;
    height: 2px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    margin-top: 1px;
}

/* Активная черточка */
.slider-dot.active {
    background: #fff;
    height: 3px; /* Чуть толще */
    margin-top: 0;
}

/* 1. Отвязываем хедер */
.header {
    position: static !important;
}

/* 2. Липкая зона для кнопки */
.mobile-filter-sticky {
    display: none; /* Скрыта на ПК */
    position: sticky;
    top: 0; 
    z-index: 90;
    background: #F8FAFC;
    padding: 12px 0;
}

@media (max-width: 768px) {
    .mobile-filter-sticky { 
        display: block; 
        padding-left: 15px; /* Отступы, чтобы кнопка не липла к краям экрана */
        padding-right: 15px;
    }
    .catalog-chips-row { display: none; } /* Прячем старый блок чипсов */
}

#openFiltersBtn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 16px; /* Как у инфо-бара */
    border: none;
    background-color: #3E89C2; /* Синий бренд */
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(62, 137, 194, 0.4); /* Объемная тень */
    transition: 0.2s;
}


/* По умолчанию чипсы внутри формы скрыты (для ПК сайдбара) */
.catalog-chips-inside {
    display: none;
}

/* Показываем их только когда форма попадает в мобильную шторку */
.drawer-body .catalog-chips-inside {
    display: block;
    margin-bottom: 25px;
}

/* Тултип для аукциона (поправим z-index, чтобы не перекрывался) */
.auction-tooltip {
    z-index: 100;
}

#openFiltersBtn img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    /* Указываем путь к картинке и красим в белый */
    content: url('../img/filter.png');
    filter: brightness(0) invert(1);
    vertical-align: middle;
}


.mobile-filter-drawer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    visibility: hidden; /* Вместо display: none для плавности */
    transition: visibility 0.3s;
    
}

.drawer-overlay {
    position: absolute;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0; /* Изначально прозрачный */
    transition: opacity 0.3s ease;
}

.drawer-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 85vh; /* Высота шторки */
    background: #fff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

/* Когда шторка активна */
.mobile-filter-drawer.active {
    visibility: visible;
    
}

.mobile-filter-drawer.active .drawer-overlay {
    opacity: 1;
}

.mobile-filter-drawer.active .drawer-content {
    transform: translateY(0); /* Выезжает */
}

.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    display: flex; justify-content: space-between; align-items: center;
}

.drawer-body {
    flex: 1;
    overflow-y: auto; /* Прокрутка только здесь */
    padding: 20px;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #E2E8F0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #fff; /* Чтобы контент под ним не просвечивал */
}

/* Скрываем "старую" кнопку сброса, когда форма переехала в мобильную шторку */
.drawer-body .filter-actions {
    display: none !important;
}

/* --- СТИЛИЗАЦИЯ ПОЛЕЙ ВНУТРИ ШТОРКИ --- */

/* 1. Сбрасываем системные стили и задаем базу */
.drawer-body select,
.drawer-body input {
    width: 100%;
    height: 48px; /* Увеличили высоту для удобного нажатия */
    padding: 0 16px;
    
    background-color: #FFFFFF;
    border: 1px solid #CBD5E1; /* Аккуратная серая рамка */
    border-radius: 12px;       /* Скругления как у кнопок */
    
    font-size: 16px; /* ВАЖНО: 16px предотвращает зум страницы на iPhone при вводе */
    color: #0F172A;
    
    outline: none;
    -webkit-appearance: none; /* Убираем стандартный "глянец" Safari/Chrome */
    appearance: none;
    transition: all 0.2s;
}

/* 2. Эффект при нажатии (Фокус) */
.drawer-body select:focus,
.drawer-body input:focus {
    border-color: #3E89C2; /* Синяя рамка */
    box-shadow: 0 0 0 4px rgba(62, 137, 194, 0.15); /* Легкое свечение */
}

/* 3. Кастомная стрелочка для выпадающих списков (Select) */
.drawer-body select {
    /* Рисуем аккуратную галочку через SVG прямо в CSS */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
    padding-right: 40px; /* Чтобы текст не наехал на стрелку */
}

/* 4. Поправляем отступы между инпутами в одной строке (От/До) */
.drawer-body .inputs-row {
    gap: 12px; /* Чуть больше воздуха */
}

/* --- КОМПАКТНЫЙ РЕЖИМ В ШТОРКЕ --- */

/* Скрываем подписи над полями (Марка, Модель, Цена и т.д.) */
.drawer-body label {
    display: none;
}

/* Уменьшаем отступы между группами, так как заголовков нет */
.drawer-body .filter-group {
    margin-bottom: 15px; 
}

/* Для заголовков групп чекбоксов (Двигатель, Особенности) оставляем отступ */
.drawer-body .filter-title {
    margin-bottom: 10px;
    margin-top: 5px;
}

/* --- МАРКА И МОДЕЛЬ В ОДНУ СТРОКУ (В ШТОРКЕ) --- */

.drawer-body .brand-model-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две равные колонки */
    gap: 12px;
    margin-bottom: 15px; /* Общий отступ снизу */
}

/* Убираем отступы у самих групп внутри этого ряда, чтобы не толкались */
.drawer-body .brand-model-row .filter-group {
    margin-bottom: 0;
}


/* Стили для чипсов внутри формы */
.catalog-chips-inside { margin-bottom: 24px; }
.catalog-chips-inside .catalog-chips { margin-top: 10px; }

/* --- АДАПТИВ --- */
@media (max-width: 1024px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { 
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-sidebar { display: none; }
    .catalog-grid { grid-template-columns: 1fr; }
    .catalog-info-bar { flex-direction: column; align-items: stretch; gap: 15px; }
    .sort-controls { justify-content: space-between; }
    .catalog-page {
        padding-top: 15px; /* Было 30px */
    }
    .mobile-filter-sticky {
        display: block;
        position: sticky;
        top: 0;
        z-index: 90;
        background: #F8FAFC;
        /* Паддинги по бокам как у контейнера, сверху минимум */
        padding: 5px 0 15px 0; 
        margin-bottom: 10px;
    }
}

/* --- КОМПАКТНЫЕ КАРТОЧКИ (МОБИЛЬНЫЕ) --- */
@media (max-width: 768px) {
    
    /* 1. Уменьшаем отступы внутри карточки */
    .car-content {
        padding: 12px !important; /* Было 20px, слишком много для телефона */
    }

    /* 2. Заголовок: аккуратнее и компактнее */
    .car-title {
        font-size: 15px !important; /* Чуть меньше */
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        height: auto !important; /* Если была фикс высота, убираем */
        
        /* Обрезаем, если больше 2 строк (на всякий случай) */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 3. Характеристики: серый текст плотнее */
    .car-specs-text {
        font-size: 12px !important;
        line-height: 1.5 !important;
        margin-bottom: 12px !important;
        color: #64748B;
    }

    /* 4. Футер с ценой: поджимаем наверх */
    .car-footer {
        padding-top: 10px !important;
        margin-top: 0 !important; /* Убираем лишний margin-top: auto, если он тянет */
        border-top: 1px solid #F1F5F9;
        align-items: center !important; /* Центруем по вертикали */
    }

    /* Цена */
    .car-price {
        font-size: 17px !important; /* Чуть меньше гигантских 19px */
    }
    .price-subtitle {
        font-size: 10px !important;
    }

    /* Бейдж выгоды (зеленый): компактнее */
    .benefit-value {
        font-size: 11px !important;
        padding: 2px 5px !important;
    }
    .benefit-label {
        font-size: 8px !important;
    }
    
    /* Уменьшаем высоту картинки на мобилках, чтобы влезло больше контента */
    .car-img-wrap {
        aspect-ratio: 16/10 !important; /* Чуть более узкая полоска, чем 4/3 */
    }
}

/* --- НОВЫЙ ДИЗАЙН КАРТОЧКИ (SPECS & PRICE) --- */

/* 1. Переключатель характеристик (ПК vs Мобила) */
.specs-pc { display: block; }
.specs-mobile { display: none; }

@media (max-width: 768px) {
    .specs-pc { display: none; }
    .specs-mobile { display: block; }
}

/* Стили текста характеристик */
.specs-row {
    margin-bottom: 2px;
    color: #64748B;
    font-size: 13px;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .specs-row { font-size: 12px; }
}



/* --- БЛОК ЦЕНЫ И ВЫГОДЫ (FINAL FIX) --- */

/* Контейнер, объединяющий Цену и Правую часть */
.price-column {
    display: flex;
    width: 100%;
}

/* Строка с главной ценой и иконкой i */
.price-row-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Иконка "i" */
.info-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; border: 1px solid #94A3B8;
    color: #94A3B8; font-size: 11px; font-family: serif; font-style: italic;
    cursor: pointer; transition: 0.2s;
}
.info-icon:hover { border-color: #3E89C2; color: #3E89C2; background: #F0F9FF; }

/* === СТИЛИ САМОГО БЛОКА ВЫГОДЫ === */
.benefit-block {
    display: flex;
    flex-direction: column; /* Всегда столбик: значение над подписью */
}

.benefit-value {
    color: #16A34A; 
    font-weight: 800; 
    font-size: 13px; 
    background: #DCFCE7; 
    padding: 2px 6px; 
    border-radius: 4px;
    white-space: nowrap;
}

.benefit-label {
    font-size: 9px; 
    color: #166534; 
    font-weight: 700; 
    text-transform: uppercase;
    margin-top: 2px;
}

.delivery-simple {
    font-size: 11px; 
    color: #94A3B8; 
}


/* === ПК ВЕРСИЯ (КАК НА СКРИНЕ) === */
@media (min-width: 769px) {
    .price-column {
        flex-direction: row;            /* В одну строку */
        justify-content: space-between; /* Разносим по краям */
        align-items: flex-end;          /* Выравниваем по низу */
    }

    /* Правая часть (Выгода или Доставка) прижата вправо */
    .benefit-block, 
    .delivery-simple {
        align-items: flex-end; /* Тексты внутри блока тоже вправо */
        text-align: right;
    }
    
    /* Доп. фикс, чтобы доставка не прилипала к цене */
    .delivery-simple {
        margin-bottom: 3px; /* Чуть поднять от самого низа, чтобы ровно с ценой */
    }
}


/* === МОБИЛЬНАЯ ВЕРСИЯ (СТОЛБИК) === */
@media (max-width: 768px) {
    .price-column {
        flex-direction: column;     /* Вертикально */
        align-items: flex-start;    /* Всё влево */
    }

    /* Отступ от цены до выгоды */
    .benefit-block, 
    .delivery-simple {
        margin-top: 6px;
        align-items: flex-start; /* Тексты влево */
        text-align: left;
    }
    
    /* На мобилке бейдж выгоды можно сделать чуть компактнее */
    .benefit-value {
        font-size: 11px;
    }
}

/* --- МОБИЛЬНАЯ СЕТКА КАРТОЧКИ (SPECS + PRICE) [UPDATED] --- */
@media (max-width: 768px) {
    
    /* 1. Превращаем контент карточки в сетку */
    .car-content {
        display: grid;
        grid-template-columns: 1.4fr 1fr; 
        grid-template-areas: 
            "title title"
            "specs price";
        gap: 8px; 
        
        /* ВАЖНО: Снизу (третье число) делаем меньше (6px), чтобы убрать воздух */
        padding: 12px 12px 0px 12px !important; 
    }

    /* 2. Заголовок на всю ширину сверху */
    .car-title {
        grid-area: title;
        margin-bottom: 4px !important;
    }

    /* 3. Характеристики слева */
    .car-specs-block {
        grid-area: specs;
        margin-bottom: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* ТУТ увеличиваем шрифт описания */
    .specs-row { 
        font-size: 13px !important; /* Было 11px */
        line-height: 1.4 !important;
        color: #475569; /* Чуть темнее для контраста */
    }

    /* 4. Цена (Футер) справа */
    .car-footer {
        grid-area: price;
        padding-top: 0 !important;
        border-top: none !important;
        margin-top: 0 !important;
        justify-self: end;
        width: 100%;
    }

    .price-column {
        align-items: flex-end !important;
    }

    .price-row-main {
        justify-content: flex-end;
    }

    .benefit-block, 
    .delivery-simple {
        align-items: flex-end !important;
        text-align: right !important;
        margin-top: 4px;
    }
    
    .car-price { font-size: 18px !important; white-space: nowrap; }
    
    /* Если после увеличения шрифта цена стала налезать на текст —
       можно чуть уменьшить шрифт выгоды или подвинуть колонки */
    .benefit-value { font-size: 13px !important; }
}

/* --- ТУЛТИП (ПК) - ИСПРАВЛЕННЫЙ ШРИФТ --- */
.tooltip {
    position: absolute;
    bottom: 100%; 
    left: 50%;    
    transform: translateX(-50%);
    margin-bottom: 10px; 
    
    width: 260px;
    
    background: #1E293B; 
    color: #FFFFFF;
    
    padding: 16px; 
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    
    /* --- ВАЖНЫЙ ФИКС ШРИФТОВ --- */
    /* Принудительно ставим нормальный шрифт без засечек и курсива */
    font-family: 'Inter', -apple-system, sans-serif !important; 
    font-style: normal !important; 
    font-weight: 400 !important;
    text-transform: none !important;
    font-variant: normal !important;
    
    font-size: 13px; 
    line-height: 1.5;
    text-align: left;
    
    opacity: 0; 
    visibility: hidden; 
    transition: all 0.2s ease;
    z-index: 100; 
    pointer-events: none;
}

/* Стрелочка */
.tooltip::after {
    content: ''; 
    position: absolute; 
    top: 100%; 
    left: 50%; 
    margin-left: -6px; 
    border-width: 6px; 
    border-style: solid; 
    border-color: #1E293B transparent transparent transparent; 
}

/* Жирный текст внутри */
.tooltip strong {
    display: block; 
    margin-top: 8px; 
    color: #FFFFFF; 
    font-weight: 700 !important; /* Тоже форсируем */
    font-family: 'Inter', sans-serif !important;
}

@media (min-width: 769px) {
    .info-icon { position: relative; }
    .info-icon:hover .tooltip {
        opacity: 1; 
        visibility: visible;
        transform: translateX(-50%) translateY(-5px); 
    }
}

@media (max-width: 768px) {
    .tooltip { display: none !important; }
}


/* --- ШТОРКА (ДЛЯ МОБИЛОК) --- */
.bottom-sheet-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); z-index: 2000;
    opacity: 0; transition: opacity 0.3s;
}
.bottom-sheet-overlay.active { display: block; opacity: 1; }

.bottom-sheet {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: #fff; z-index: 2001; border-radius: 24px 24px 0 0;
    padding: 30px 20px 40px; 
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bottom-sheet.active { transform: translateY(0); }

.sheet-content { text-align: left; }
.sheet-handle { width: 40px; height: 4px; background: #E2E8F0; border-radius: 2px; margin: -10px auto 20px; }
.sheet-content h3 { margin-bottom: 12px; font-size: 20px; font-weight: 800; color: #1E293B; }
.sheet-content p { font-size: 15px; line-height: 1.5; color: #475569; }

/* Скрываем тултип на мобилках, чтобы не мешал */
@media (max-width: 768px) {
    .tooltip { display: none !important; }
}

/* --- СВАЙП ФОТОГРАФИЙ (Hybrid: Hover на ПК / Swipe на Мобиле) --- */

/* 1. Контейнер для ленты картинок */
.car-slider-track {
    width: 100%;
    height: 100%;
    display: flex; /* Выстраиваем в ряд */
    
    /* Настройки скролла для мобилок */
    overflow-x: auto; 
    scroll-snap-type: x mandatory; /* "Прилипание" к слайдам */
    -webkit-overflow-scrolling: touch; /* Плавность на iOS */
    
    /* Скрываем скроллбар */
    scrollbar-width: none; 
}
.car-slider-track::-webkit-scrollbar { display: none; }

/* 2. Сами картинки */
.car-img-slide {
    min-width: 100%; /* Каждая картинка занимает всю ширину */
    height: 100%;
    object-fit: cover;
    
    scroll-snap-align: start; /* Точка прилипания */
    scroll-snap-stop: always; /* <--- ДОБАВИТЬ: Останавливаться на каждом слайде обязательно */
    
    transition: opacity 0.2s ease; /* Плавность для ПК */
}


/* --- ПОВЕДЕНИЕ НА ПК (Имитация Hover) --- */
@media (min-width: 769px) {
    .car-slider-track {
        display: block; /* Убираем flex, чтобы накладывать слоями */
        overflow: hidden; /* Запрещаем скролл на ПК */
        position: relative;
    }

    .car-img-slide {
        position: absolute;
        top: 0; left: 0;
        opacity: 0; /* Скрываем все */
        z-index: 1;
    }

    /* Показываем только активную (первую или ту, на которую навели) */
    .car-img-slide.active {
        opacity: 1;
        z-index: 2;
    }
    
    /* Индикаторы (точки) показываем только на ПК */
    .slider-pagination {
        display: flex;
    }
}


/* --- ПОВЕДЕНИЕ НА МОБИЛЬНОМ (Swipe) --- */
@media (max-width: 768px) {
    /* Скрываем зоны наведения и точки, они не нужны при свайпе */
    .hover-zones,
    .slider-pagination {
        display: none !important;
    }
    
    /* Картинки всегда видимы (в ряд) */
    .car-img-slide {
        opacity: 1 !important; 
        position: relative !important;
    }
}

/* =========================================
   КНОПКА "НАВЕРХ" (SCROLL TO TOP)
   ========================================= */
.scroll-top-btn {
    display: flex;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    
    background-color: #3E89C2; /* Бренд-цвет */
    color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(62, 137, 194, 0.4);
    
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    
    /* Скрыта, пока не проскроллишь */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-top-btn:hover {
    background-color: #2c6ea0;
    transform: translateY(-2px);
}

.scroll-top-btn.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Адаптив для мобилок: чуть меньше и ближе к краю */
@media (max-width: 768px) {
    .scroll-top-btn {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 15px; /* Чтобы не перекрывалась кнопкой фильтров, если они рядом */
        z-index: 1001; /* Поверх всего */
    }
}