/* CSS переменные для удобства */
:root {
    --primary-color: #0099ff;
    --dark-blue: #37474F;
    --text-light: #ffffff;
    --text-dark: #333333;
    --border-color: #e0e0e0;
    --background-light: #f8f9fa;
    --accent-red: #d9534f;
    --success-green: #2ecc71;
    --light-grey: #f5f5f5;
    --text-grey: #757575;
    --background-white: #fff;
}

.intec-template .intec-template-title, .intec-template .intec-template-breadcrumb {
    display: none !important;
}

/* Секция Hero (главный экран) */
.hero-section {
    height: 100vh;
    min-height: 800px; /* Минимальная высота, чтобы форма не прилипала к верху на низких экранах */
    background-image: url('/auctions/usa/background.jpg'); /* !!! УКАЖИТЕ ПУТЬ К ВАШЕМУ ФОНУ !!! */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    padding: 20px;
}

/* Затемняющий оверлей для лучшей читаемости текста */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 30, 40, 0.6);
    z-index: 1;
}

/* Контейнер для контента */
.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Верхняя панель */
.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    background-color: rgba(45, 55, 65, 0.7);
    border-radius: 8px;
    padding: 8px 20px;
}

.stats {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stats .number-box {
    background: var(--text-light);
    color: var(--text-dark);
    padding: 5px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.2rem;
}

.stats span {
    margin-left: 10px;
    font-size: 0.9rem;
}

.year-selector select {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}
.year-selector select option {
    background: var(--dark-blue);
}

/* Основная навигация */
.main-nav {
    margin-top: 20px;
    display: flex;
    gap: 30px;
}
.main-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 10px;
    transition: color 0.3s;
}
.main-nav a:hover {
    color: var(--primary-color);
}

/* Основной контент (заголовки и кнопки) */
.hero-content {
    text-align: center;
    margin-top: 60px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 1.1rem;
    margin-top: 15px;
    opacity: 0.9;
}

.hero-buttons {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
}
.hero-buttons .btn {
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.hero-buttons .btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}
.hero-buttons .btn-primary:hover {
    opacity: 0.9;
}

.hero-buttons .btn-secondary {
    border: 1px solid var(--text-light);
    color: var(--text-light);
}
.hero-buttons .btn-secondary:hover {
    background-color: var(--text-light);
    color: var(--text-dark);
}


.archive-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #757575;
}

.custom-select-wrapper {
    position: relative;
}
.more-types-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 150px;
}
.more-types-dropdown a {
    display: block;
    padding: 8px 12px;
    color: var(--text-dark);
    border-radius: 4px;
    margin-bottom: 0 !important; /* переопределяем стили */
    border-bottom: none !important; /* переопределяем стили */
}
.more-types-dropdown a:hover {
    background-color: #f1f3f5;
    color: var(--primary-color);
}

/* Кастомный свитчер (toggle) */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.switch input {
    display: none;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary-color);
}
input:checked + .slider:before {
    transform: translateX(18px);
}



.custom-select, .form-input {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    background: #fff;
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.custom-select i {
    color: #aaa;
}

.vin-search {
    position: relative;
    flex-basis: 35%; /* Больше места для VIN */
}
.vin-search input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
}
.vin-search .fa-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    cursor: pointer;
}

.source-toggles {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}
.source-toggles .toggle-item {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* Секция с брендами */
.brands-section {
    padding: 60px 20px;
    background-color: #fff; /* Белый фон для этой секции */
}

.brands-section .container {
    max-width: 1200px; /* Стандартный контейнер */
    margin: 0 auto;
}

.brands-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.brands-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.brands-tabs {
    display: flex;
    gap: 30px;
}

.brands-tabs a {
    text-decoration: none;
    color: var(--text-grey);
    padding: 15px 5px;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px; /* Компенсация толщины border */
}

.brands-tabs a:hover {
    color: var(--primary-color);
}

.brands-tabs a.active {
    color: var(--text-dark);
    border-bottom-color: var(--primary-color);
}

.brands-content {
    margin-top: 30px;
}

.brands-grid {
    display: none; /* Все гриды по умолчанию скрыты */
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.brands-grid.active {
    display: flex; /* Активный грид отображается как flex-контейнер */
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 110px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-dark);
    padding: 15px;
    transition: all 0.2s ease-in-out;
}

.brand-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #c0c0c0;
}

.brand-item img {
    height: 45px;
    max-width: 90%;
    object-fit: contain;
    margin-bottom: 12px;
    filter: grayscale(1) opacity(0.6); /* Делаем логотипы серыми и полупрозрачными */
    transition: filter 0.2s ease-in-out;
}

.brand-item:hover img {
    filter: none; /* При наведении возвращаем цвет */
}

.brand-item span {
    font-size: 0.8rem;
    font-weight: 200;
}

/* --- Новые стили для Select2 и выпадающего списка "Еще" --- */
.select2-form-input {
    flex-grow: 1;
}
.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    height: 48px !important;
    background: #fff;
    padding: 0;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;
    padding-left: 15px !important;
    padding-right: 30px !important;
    color: var(--text-dark);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 10px !important;
}
.select2-container .select2-selection--single .select2-selection__placeholder {
    color: #999;
}
.select2-dropdown {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* --- Контейнер всей формы --- */
.search-form-wrapper {
    background-color: var(--text-light);
    color: var(--text-dark);
    border-radius: 12px;
    padding: 25px;
    margin-top: 70px;
    width: 100%;
    max-width: 1100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* --- Табы над формой --- */
.form-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    flex-wrap: wrap; /* Разрешаем перенос табов и переключателя архива */
    gap: 20px;
}

.vehicle-types {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.vehicle-types a {
    color: #757575;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 15px;
    border-bottom: 3px solid transparent;
    margin-bottom: -16px;
    transition: all 0.3s ease;
}
.vehicle-types a.active, .vehicle-types a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}


/* --- Основной контейнер полей формы --- */
.form-fields {
    margin-top: 20px;
    display: flex;
    flex-direction: column; /* Ряды формы (form-row) идут друг под другом */
    gap: 15px;
}

/* --- Стили для одного ряда полей --- */
.form-row {
    display: flex;
    flex-wrap: wrap; /* !!! ГЛАВНОЕ: Разрешаем элементам переноситься на новую строку !!! */
    gap: 15px;
    align-items: center;
}

/* --- Стили для обертки одного поля (form-group) --- */
/* Этот блок был у вас пропущен! */
.form-group {
    /* flex: grow shrink basis */
    flex: 1 1 180px; /* Элементы будут стараться занять базовую ширину 180px, но могут расти и сжиматься */
    min-width: 150px; /* Минимальная ширина, чтобы селекты не становились слишком узкими */
}

/* --- Задаем уникальные размеры для специфичных полей --- */
.form-group.form-group-vin {
    flex-grow: 1.5; /* Поле VIN будет в 1.5 раза шире других */
}
.input-vin {
    width: 100%;
    border: none;
}
.form-group.form-group-submit {
    flex-grow: 1.5; /* Кнопка поиска тоже будет шире */
}
.or-divider-wrapper {
    flex: 0 0 auto; /* Разделитель "или" не будет ни расти, ни сжиматься */
    width: 40px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* --- Стилизация самих элементов управления --- */
.form-group select {
    display: none; /* Скрываем нативный select, так как Select2 его заменяет */
}

/* Стили для Select2, чтобы он выглядел как надо */
.select2-container .select2-selection--single {
    height: 48px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;
    padding-left: 15px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
}



/* Стили для кнопки поиска */
.search-button {
    width: 100%;
    height: 48px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s;
}
.search-button:hover {
    opacity: 0.9;
}


/* --- АДАПТИВНОСТЬ --- */

/* Планшеты (до 992px) */
@media (max-width: 992px) {
    .or-divider-wrapper {
        /* Скрываем разделитель "или", чтобы он не мешался при переносе строк */
        display: none;
    }
}

/* Мобильные устройства (до 767px) */
@media (max-width: 767px) {
    .hero-content h1 {
        font-size: 2.5rem;
        font-weight: 900;
        line-height: 1.2;
        text-transform: uppercase;
    }
    
    .hero-section {
        height: 150vh;
    }

    .form-group {
        /* Каждый элемент теперь занимает 100% ширины на своей строке */
        flex: 1 1 100%; 
        min-width: 0; /* Сбрасываем минимальную ширину */
    }

    .form-tabs {
        flex-direction: column;
        align-items: stretch; /* Растягиваем элементы табов на всю ширину */
        gap: 15px;
    }

    .vehicle-types {
        justify-content: space-around; /* Распределяем табы равномерно */
    }
    
    .brands-header {
        display: block;
    }
}