/* ========== ОСНОВНЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: linear-gradient(135deg, #d2e8fe 0%, #e4e8f0 100%);
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== ШАПКА ========== */
.fbn-header {
    text-align: center;
    margin-bottom: 30px;
    user-select: none;
}

.fbn-header h1 {
    color: #2c3e50;
    font-size: 2.8em;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.fbn-header h1 span {
    color: #3498db;
    font-weight: 800;
    position: relative;
}

.header-link {
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.3s ease;
}

.header-link:hover { opacity: 0.8; }

.fbn-subtitle {
    color: #7f8c8d;
    margin-top: 10px;
    font-size: 1.5em;
    font-weight: 400;
}

/* ========== НАВИГАЦИЯ ========== */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0 15px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    color: #5a6b7a;
    background: #f0f4f8;
    border: 1px solid #dde4eb;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    letter-spacing: 0.3px;
}

.nav-link:hover {
    background: #e3eaf1;
    border-color: #b8c5d2;
    color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}

.nav-link.active {
    background: #3498db;
    border-color: #2980b9;
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(52, 152, 219, 0.3);
}

/* ========== СТАТИСТИКА ========== */
.stats, .filters, .selection-block {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 0 15px;
}

.stat-label {
    font-size: 1em;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 2.8em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.stat-item:nth-child(1) .stat-value { color: #3498db; }
.stat-item:nth-child(2) .stat-value { color: #2ecc71; }
.stat-item:nth-child(3) .stat-value { color: #e74c3c; }
.stat-item:nth-child(4) .stat-value { color: #f39c12; }

/* ========== ФИЛЬТРЫ ========== */
.filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 14px 16px;
    background: #f8fafc;
    border: 2px solid #eef2f6;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 15px;
    transition: all 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

/* ========== КНОПКА СБРОСА ========== */
.filter-reset-group {
    min-width: auto;
    flex: 0 0 auto;
}

.filter-reset-btn {
    background: #f8fafc;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    width: 100%;
    height: 51px;
}

.filter-reset-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* ========== БЛОК ВЫБОРА МАРКИ/МОДЕЛИ ========== */
.selection-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef2f6;
}

.selection-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.selection-filters .filter-group label {
    font-size: 14px;
    color: #2c3e50;
    text-transform: none;
    font-weight: 500;
}

.selected-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #eef2f6;
}

.selected-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #2c3e50;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.selected-badge.active {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
    color: #2c3e50;
}

.load-config-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-config-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.load-config-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.5;
}

/* ========== ХЛЕБНЫЕ КРОШКИ ========== */
.breadcrumbs {
    margin: 20px 0 15px;
    padding: 10px 0;
    font-size: 15px;
    color: #7f8c8d;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eef2f6;
}

.breadcrumb-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 4px 0;
}

.breadcrumb-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb-current {
    color: #2c3e50;
    font-weight: 600;
}

.breadcrumb-separator {
    color: #bdc3c7;
    font-size: 18px;
    line-height: 1;
    margin: 0 2px;
}

/* ========== СЕТКА КАРТОЧЕК ========== */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* ========== КАРТОЧКА АВТОМОБИЛЯ ========== */
.car-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.3s;
    position: relative;
    border: 1px solid rgba(52, 152, 219, 0.1);
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}

.car-card.inactive {
    opacity: 0.7;
}

.car-card.inactive::after {
    content: "НЕАКТИВНО";
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
    letter-spacing: 0.5px;
}

/* ========== ГАЛЕРЕЯ В КАРТОЧКЕ ========== */
.car-gallery {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
    flex-shrink: 0;
}

.gallery-container {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}

.gallery-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.gallery-nav {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 3;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-dot.active {
    background: #3498db;
    transform: scale(1.3);
    box-shadow: 0 0 10px #3498db;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #2c3e50;
    transition: all 0.3s;
    z-index: 3;
    opacity: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.car-gallery:hover .gallery-arrow { opacity: 1; }

.gallery-arrow:hover {
    background: #3498db;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-arrow.left { left: 15px; }
.gallery-arrow.right { right: 15px; }

.photo-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

/* ========== ПЛЕЙСХОЛДЕР ========== */
.gallery-placeholder {
    height: 240px;
    background: linear-gradient(135deg, #b3e8ff 0%, #c7d2fe 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid #e2e8f0;
    flex-shrink: 0;
    position: relative;
}

.gallery-placeholder:hover {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
}

.placeholder-content {
    text-align: center;
    padding: 20px;
}

.placeholder-avatar {
    width: 90px;
    height: 90px;
    background: #4f46e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: bold;
    color: white;
    margin: 0 auto 15px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

.placeholder-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 12px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.placeholder-badge {
    background: #f59e0b;
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.placeholder-hint {
    font-size: 14px;
    color: #334155;
    opacity: 0.9;
    font-weight: 500;
}

/* ========== ИНФОРМАЦИОННАЯ ЧАСТЬ ========== */
.car-info {
    padding: 22px;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
}

.car-price {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 18px;
    padding: 12px 0;
    border-bottom: 2px solid #eef2f6;
}

.price-byn {
    font-size: 30px;
    font-weight: 800;
    color: #7f8c8d;
    letter-spacing: -0.5px;
}

.price-usd {
    font-size: 22px;
    color: #85bb65;
    font-weight: 500;
}

/* ========== ХАРАКТЕРИСТИКИ ========== */
.car-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 22px;
    margin-bottom: 22px;
    background: #f8fafc;
    padding: 22px;
    border-radius: 12px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.spec-label {
    color: #64748b;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.spec-value {
    color: #1e293b;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.4;
}

/* ========== БЛОК VIN ========== */
.vin-block {
    background: #f0f7ff;
    border: 1px solid #d4e6ff;
    padding: 16px 18px;
    border-radius: 12px;
    margin: 0 0 22px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.vin-number {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #3498db;
    cursor: pointer;
    letter-spacing: 1px;
    font-size: 18px;
}

/* Невалидный VIN - предупреждение */
.vin-error-notification {
    border-left: 4px solid #c62828 !important;
    background: #fff0f0 !important;
}

.vin-block-invalid {
    background: #fff0f0;
    border: 1px solid #ffcdd2;
}

.vin-number.vin-invalid {
    color: #c62828;
    cursor: pointer;
}

.vin-number.vin-invalid .vin-icon {
    filter: brightness(0) saturate(100%) invert(20%) sepia(90%) saturate(500%) hue-rotate(340deg);
}

.vin-number.vin-invalid:hover {
    text-decoration: underline;
    text-decoration-color: #c62828;
}

/* ============= ИНФО-ИКОНКА ДЛЯ VIN ============= */
.vin-info-icon {
    width: 16px;
    height: 16px;
    margin-left: 5px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: inline-block;
    vertical-align: middle;
}

.vin-info-icon:hover {
    opacity: 1;
}

/* ============= ПОДСКАЗКА ДЛЯ НЕВАЛИДНОГО VIN ============= */
.vin-tooltip-mobile {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
    animation: slideUp 0.3s ease;
    border-left: 4px solid #c62828;
}

.vin-tooltip-mobile.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============= СТИЛИ ДЛЯ "НЕТ РЕЗУЛЬТАТОВ" ============= */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px !important;
    text-align: center;
}

.no-results-icon {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    margin-bottom: 10px;
}

.no-results span {
    font-size: 18px;
    color: #95a5a6;
}

/* ============= КНОПКА КОПИРОВАНИЯ ============= */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: rgba(52, 152, 219, 0.1);
}

/* ========== ПОДВАЛ КАРТОЧКИ ========== */
.car-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #64748b;
    margin-top: auto;
    padding-top: 18px;
    border-top: 2px solid #eef2f6;
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.view-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 700;
    padding: 12px 24px;
    border: 2px solid #3498db;
    border-radius: 30px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    height: 48px;
    box-sizing: border-box;
}

.view-link:hover {
    background: #3498db;
    color: white;
}

/* ========== АУКЦИОННАЯ ИНФОРМАЦИЯ ========== */
.auction-info {
    background: #f0f7ff;
    border: 1px solid #d4e6ff;
    border-radius: 12px;
    padding: 12px 15px;
    margin: 10px 0 15px;
}

.auction-info-empty {
    background: #f9f9f9;
    border: 1px dashed #d1d5db;
    opacity: 0.7;
}

.auction-info-empty .auction-value { color: #9ca3af; }

.auction-title {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eef2f6;
}

.auction-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.auction-label {
    color: #64748b;
    font-weight: 500;
}

.auction-value {
    color: #2c3e50;
    font-weight: 600;
}

.auction-value.damage { color: #e74c3c; }

/* ========== СТАТИСТИКА ПО VIN ========== */
.vin-stats-badge.below-counter-left {
    position: absolute;
    top: 60px;
    left: 15px;
    z-index: 15;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3);
    cursor: help;
    transition: all 0.2s ease;
    animation: fadeInDown 0.3s ease;
    line-height: 1;
}

.vin-stats-badge.below-counter-left:hover {
    background: linear-gradient(135deg, #fb923c, #f97316);
    box-shadow: 0 6px 12px rgba(249, 115, 22, 0.4);
}

.vin-stats-badge.below-counter-left .vin-stats-icon {
    margin-right: 5px;
    font-size: 13px;
}

.vin-stats-badge.below-counter-left .vin-stats-count {
    background: white;
    color: #f97316;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: 4px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.gallery-placeholder .vin-stats-badge.below-counter-left {
    top: 60px;
    left: 15px;
    z-index: 20;
}

/* ========== МОДАЛЬНАЯ ГАЛЕРЕЯ ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #2c3e50;
    transition: all 0.3s ease;
}

.modal-close::before { transform: rotate(45deg); }
.modal-close::after { transform: rotate(-45deg); }

.modal-close:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.modal-close:hover::before,
.modal-close:hover::after {
    background-color: white;
}

.modal-close:hover::before { transform: rotate(225deg); }
.modal-close:hover::after { transform: rotate(135deg); }

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #2c3e50;
    transition: all 0.3s ease;
    border: none;
    line-height: 1;
    padding: 0;
    user-select: none;
}

.modal-prev { left: 40px; }
.modal-next { right: 40px; }

.modal-prev:hover,
.modal-next:hover {
    background: #3498db;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.modal-counter {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #2c3e50;
    font-size: 16px;
    background: white;
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 1001;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 1px solid #eef2f6;
}

.modal-vin {
    position: absolute;
    top: 30px;
    left: 30px;
    color: #2c3e50;
    font-size: 16px;
    background: white;
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 1001;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 1px solid #eef2f6;
    font-weight: 700;
    transition: all 0.3s ease;
}

.modal-vin:hover {
    background: #3498db;
    color: white;
}

.modal-slide {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.modal-slide.active { display: flex; }

.modal-slide img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.modal-filename {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: #7f8c8d;
    font-size: 14px;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #eef2f6;
    font-weight: 500;
}

/* ========== ЗАГРУЗКА И ОШИБКИ ========== */
.loading, .error, .no-results {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.loading {
    color: #3498db;
    font-size: 20px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border: 3px solid #eef2f6;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error {
    color: #e74c3c;
    margin: 20px;
    border: 1px solid #ffd7d5;
}

.no-results {
    color: #95a5a6;
    font-size: 18px;
    grid-column: 1 / -1;
    font-weight: 500;
}

/* ========== УВЕДОМЛЕНИЯ ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #2c3e50;
    padding: 16px 28px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.2);
    z-index: 2000;
    border-left: 4px solid #3498db;
    font-weight: 600;
    font-size: 16px;
    animation: slideIn 0.3s ease;
    cursor: pointer;
    max-width: 400px;
}

/* ========== ПАГИНАЦИЯ ========== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 2px solid #eef2f6;
}

.pagination-info {
    font-size: 15px;
    color: #7f8c8d;
    background: #f8fafc;
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid #eef2f6;
}

.pagination-info strong {
    color: #3498db;
    font-weight: 700;
}

.pagination-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    letter-spacing: 0.5px;
}

.pagination-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

/* ========== ОПИСАНИЕ ПРОЕКТА ========== */
.site-description { margin: 25px 0 20px; }

.description-card {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-left: 5px solid #3498db;
    border-radius: 16px;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    text-align: left;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.08);
}

.description-icon {
    font-size: 48px;
    min-width: 70px;
    text-align: center;
    filter: drop-shadow(0 4px 6px rgba(52, 152, 219, 0.2));
}

.description-text {
    font-size: 17px;
    line-height: 1.6;
    color: #2c3e50;
    font-weight: 400;
}

.description-text strong {
    color: #3498db;
    font-weight: 700;
    font-size: 18px;
}

/* ========== КНОПКА "НАВЕРХ" ========== */
.scroll-to-top {
    position: fixed;
    border: none;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Десктоп */
@media (min-width: 769px) {
    .scroll-to-top {
        top: 0;
        left: 0;
        width: 50px;
        height: 100vh;
        background: rgba(52, 152, 219, 0.1);
        flex-direction: column;
        gap: 8px;
        transform: translateX(-100%);
        transition: transform 0.3s ease-out, opacity 0.3s, visibility 0.3s;
    }
    
    .scroll-to-top.visible { transform: translateX(0); }
    
    .scroll-to-top:hover { background: rgba(52, 152, 219, 0.2); }
    
    .scroll-to-top .arrow {
        font-size: 28px;
        color: #3498db;
        transition: all 0.3s;
        line-height: 1;
        margin-bottom: 5px;
    }
    
    .scroll-to-top:hover .arrow {
        transform: translateY(-5px);
        color: #2980b9;
    }
    
    .scroll-to-top .text {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        font-size: 12px;
        color: #3498db;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
        opacity: 0.8;
        transition: opacity 0.3s;
    }
    
    .scroll-to-top:hover .text { opacity: 1; }
}

/* Мобильные */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: #3498db;
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
        transform: scale(0);
        transition: transform 0.2s ease-out, opacity 0.2s, visibility 0.2s;
    }
    
    .scroll-to-top.visible { transform: scale(1); }
    .scroll-to-top:active { transform: scale(0.9); }
    .scroll-to-top .arrow {
        font-size: 24px;
        color: white;
        line-height: 1;
    }
    .scroll-to-top .text { display: none; }
}

@media (max-width: 480px) {
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    .scroll-to-top .arrow { font-size: 22px; }
}

@media (max-width: 360px) {
    .scroll-to-top {
        bottom: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    .scroll-to-top .arrow { font-size: 20px; }
}

/* ========== ИКОНКИ ========== */
.icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
    display: inline-block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    object-fit: contain;
}

.vin-icon, .copy-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 4px;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.copy-icon { margin-right: 0; }

.copy-btn:hover .copy-icon {
    opacity: 1;
    transform: scale(1.1);
}

.auction-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    opacity: 0.8;
    filter: brightness(0.9);
}

.auction-title .icon { margin-right: 8px; }

/* Иконка локации */
.location-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    opacity: 0.7;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Иконка неактивного статуса */
.inactive-icon {
    position: absolute;
    top: 23px;
    right: 125px;
    width: 16px;
    height: 16px;
    z-index: 12;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

/* ========== СКРОЛЛБАР ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* ========== АНИМАЦИИ ========== */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.car-card { animation: fadeIn 0.5s ease; }

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 992px) {
    .selection-filters {
        grid-template-columns: repeat(2, 1fr);
    }
    .filter-reset-group { min-width: 100%; }
    .filter-reset-btn { justify-content: center; }
}

@media (max-width: 768px) {
    body { padding: 15px; }
    
    .cars-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filters {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .filter-group, .selection-filters {
        min-width: 100%;
        grid-template-columns: 1fr;
    }
    
    .fbn-header h1 { font-size: 2.2em; }
    .stat-value { font-size: 2.2em; }
    .price-byn { font-size: 26px; }
    .price-usd { font-size: 18px; }
    .car-specs {
        gap: 15px;
        padding: 18px;
    }
    .spec-value { font-size: 15px; }
    .car-title { font-size: 20px; }
    
    .car-gallery,
    .gallery-placeholder { height: 220px; }
    
    .placeholder-avatar {
        width: 70px;
        height: 70px;
        font-size: 34px;
    }
    .placeholder-title { font-size: 18px; }
    
    .selected-info {
        flex-direction: column;
        align-items: stretch;
    }
    .selected-badge { text-align: center; }
    
    .breadcrumbs { font-size: 14px; gap: 5px; }
    .breadcrumb-separator { font-size: 16px; }
    
    .modal-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .modal-prev,
    .modal-next {
        width: 45px;
        height: 45px;
        font-size: 30px;
    }
    .modal-prev { left: 15px; }
    .modal-next { right: 15px; }
    
    .modal-vin {
        top: 15px;
        left: 15px;
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 20px;
    }
    
    .modal-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 20px;
    }
    
    .view-link {
        padding: 10px 20px;
        height: 42px;
        font-size: 14px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .pagination-info, .pagination-button { width: 100%; }
    
    .description-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    .description-icon { font-size: 42px; }
    
    .icon, .auction-icon { width: 18px; height: 18px; }
    .vin-icon, .copy-icon { width: 16px; height: 16px; }
    .filter-group label { font-size: 13px; }
    
    .vin-stats-badge.below-counter-left {
        top: 50px;
        left: 10px;
        padding: 3px 8px;
        font-size: 10px;
    }
    .gallery-placeholder .vin-stats-badge.below-counter-left { top: 50px; left: 10px; }
    
    .inactive-icon {
        right: 115px;
        width: 14px;
        height: 14px;
        top: 24px;
    }
    
    .location-icon {
        width: 14px;
        height: 14px;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .no-results-icon {
        width: 48px;
        height: 48px;
    }
    
    .no-results span {
        font-size: 16px;
    }
    
    .vin-info-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .main-nav { 
        flex-direction: column; 
        align-items: center; 
        gap: 8px; 
    }
    .nav-link {
        width: 100%;
        max-width: 220px;
        justify-content: center;
    }
    .icon { width: 16px; height: 16px; }
    
    .notification {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Ретина-дисплеи */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .icon { width: 18px; height: 18px; }
}