* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            min-height: 100vh;
        }

        /* Header */
.header {
    background: linear-gradient(135deg, #868e96 0%, #495057 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    gap: 20px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.top-text {
    color: rgb(255, 0, 0);
    margin-bottom: 5px;
}

.bottom-text {
    color: rgb(255, 255, 255);
    margin-top: 5px;
}

.logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
}

.logo img {
    width: 200px;
    height: 170px;
    border-radius: 50%;
}

/* Остальные стили остаются без изменений */
.bank-logos {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.left-banks {
    justify-content: flex-end;
}

.right-banks {
    justify-content: flex-start;
}

.bank-logos img {
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.bank-logos img:hover {
    transform: scale(1.1);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .header {
        flex-direction: row;
        align-items: center;
        padding: 0.5rem 0;
        gap: 0;
        justify-content: center;
    }
    
    .logo-container {
        margin: 0 -5px;
        z-index: 1;
    }
    
    .logo-text {
        font-size: 1.9rem;
        white-space: nowrap;
    }
    
    .logo img {
        width: 140px;
        height: auto;
        max-height: 120px;
    }
    
    .bank-logos {
        flex-direction: column;
        gap: 8px;
        padding: 0 2px;
    }
    
    .left-banks {
        margin-right: -10px;
    }
    
    .right-banks {
        margin-left: -10px;
    }
    
    .bank-logos img {
        height: 42px;
    }
}

@media (max-width: 480px) {
    .logo img {
        width: 160px;
        max-height: 140px;
    }
    
    .bank-logos img {
        height: 32px;
    }
    
    .logo-text {
        font-size: 1.0rem;
    }
}



        /* Main Content */
        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
            display: flex;
            gap: 2rem;
            position: relative;
        }

        .sidebar {
            width: 1650px;
            background: white;
            border-radius: 15px;
            padding: 1.5rem;
            height: fit-content;
            box-shadow: 0 8px 32px rgba(0,0,0,0.1);
            backdrop-filter: blur(10px);
        }

        .sidebar h3 {
            margin-bottom: 1rem;
            color: #333;
            font-size: 1.2rem;
        }

        .filter-toggle-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            padding: 8px 12px;
            border-radius: 10px;
            color: white;
            font-size: 1.2rem;
            cursor: pointer;
            margin-left: auto;
        }

        .filter-sidebar {
            position: fixed;
            bottom: -100%;
            left: 0;
            width: 100%;
            background: white;
            z-index: 1000;
            transition: bottom 0.3s ease;
            box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
            border-top-left-radius: 16px;
            border-top-right-radius: 16px;
            padding: 1rem;
            max-height: 80%;
            overflow-y: auto;
        }

.filter-sidebar.active {
  bottom: 0;
}

.filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: none;
}

.filter-overlay.active {
  display: block;
}

.filter-sidebar .sidebar h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}


        .filter-group {
            margin-bottom: 1.5rem;
        }

        .filter-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #555;
            font-weight: 500;
        }

        .filter-group select, .filter-group input {
            width: 100%;
            padding: 10px;
            border: 2px solid #e1e8ed;
            border-radius: 8px;
            font-size: 14px;
            transition: border-color 0.3s ease;
        }

        .filter-group select:focus, .filter-group input:focus {
            outline: none;
            border-color: #868e96;
        }

        .year-range {
            display: flex;
            gap: 10px;
        }

        .year-range input {
            width: 48%;
        }

        /* Main Content Area */
        .main-content {
            flex: 1;
            position: relative;
        }

        .sort-controls {
            background: white;
            padding: 1rem;
            border-radius: 15px;
            margin-bottom: 1.5rem;
            display: flex;
            gap: 1rem;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }

        .sort-btn {
            padding: 10px 20px;
            background: linear-gradient(135deg, #868e96 0%, #495057 100%);
            color: white;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .sort-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(134,142,150,0.4);
        }


        .sort-btn .arrow {
  margin-left: 8px;
  font-size: 14px;
}


        /* Car Cards */
        .cars-grid {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .car-card {
            background: white;
            border-radius: 20px;
            padding: 1.5rem;
            display: flex;
            gap: 1.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 8px 32px rgba(0,0,0,0.1);
            position: relative;
            overflow: hidden;
        }

        .car-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(135deg, #868e96 0%, #495057 100%);
        }

        .car-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
        }

        .car-image img{
            width: 300px;
            height: 300px;
            border-radius: 15px;
            background: #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            background: linear-gradient(135deg, #e9ecef 0%, #ced4da 100%);
            flex-shrink: 0;
        }

        .car-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .car-title {
            font-size: 1.5rem;
            font-weight: bold;
            color: #333;
            margin-bottom: 0.5rem;
        }

        .car-description {
            color: #666;
            margin-bottom: 1rem;
            line-height: 1.5;
        }

        .car-details {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .car-detail {
            color: #555;
            font-size: 0.9rem;
        }

        .car-price {
            font-size: 1.8rem;
            font-weight: bold;
            color: #495057;
            margin-bottom: 0.5rem;
        }

        .favorite-btn {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: rgba(255,255,255,0.9);
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .favorite-btn:hover {
            background: #ff6b6b;
            color: white;
            transform: scale(1.1);
        }

        .favorite-btn.active {
            background: #ff6b6b;
            color: white;
        }
        

        /* Detail Frame */
        .detail-frame {
            position: fixed;
            top: 0;
            right: -600px;
            width: 600px;
            height: 100vh;
            background: white;
            box-shadow: -5px 0 25px rgba(0,0,0,0.15);
            transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1000;
            overflow-y: auto;
        }

        .detail-frame.open {
            right: 0;
        }

        .detail-content {
            padding: 2rem;
        }

        .close-btn {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: #ff6b6b;
            color: white;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .close-btn:hover {
            transform: rotate(90deg) scale(1.1);
        }

        .detail-image img{
            width: 530px;
            height: 500px;
            background: linear-gradient(135deg, #e9ecef 0%, #ced4da 100%);
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 4rem;
            margin-bottom: 1.5rem;
        }

        .price-comparison {
            background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%);
            padding: 1rem;
            border-radius: 15px;
            margin: 1rem 0;
        }

        .bank-offers {
            background: #f8f9ff;
            padding: 1.5rem;
            border-radius: 15px;
            margin: 1.5rem 0;
        }

        .month-options {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin: 1rem 0;
        }

        .month-btn {
            padding: 10px;
            background: white;
            border: 2px solid #868e96;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .month-btn:hover, .month-btn.active {
            background: #868e96;
            color: white;
        }

        .payment-info {
            background: white;
            padding: 1rem;
            border-radius: 10px;
            margin-top: 1rem;
        }


        .text-muted {
  color: #6c757d; /* светло-серый */
}


        .apply-btn {
            width: 100%;
            padding: 15px;
            background: linear-gradient(135deg, #868e96 0%, #495057 100%);
            color: white;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-size: 1.1rem;
            font-weight: bold;
            margin: 1rem 0;
            transition: all 0.3s ease;
        }

        .apply-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(134,142,150,0.4);
        }

        .characteristics {
            background: #f8f9fa;
            padding: 1.5rem;
            border-radius: 15px;
            margin-top: 1.5rem;
        }

        .char-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .char-item {
            display: flex;
            justify-content: space-between;
            padding: 0.5rem 0;
            border-bottom: 1px solid #e9ecef;
        }

        .close-btn-mobile {
    display: none;
}


@media (max-width: 768px) {
    .close-btn-mobile {
        display: block;
        position: absolute;
        top: 10px;
        left: 10px;
        background: #ff6b6b;
        color: white;
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        z-index: 1100;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    }

    .close-btn-mobile:hover {
        transform: scale(1.1);
    }
}

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 2000;
            backdrop-filter: blur(5px);
        }

        .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 2rem;
            border-radius: 20px;
            width: 400px;
            animation: modalAppear 0.3s ease;
        }

        @keyframes modalAppear {
            from { opacity: 0; transform: translate(-50%, -60%); }
            to { opacity: 1; transform: translate(-50%, -50%); }
        }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e1e8ed;
            border-radius: 8px;
            font-size: 16px;
        }

        .submit-btn {
            width: 100%;
            padding: 15px;
            background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
            color: white;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-size: 1.1rem;
            font-weight: bold;
        }

        /* Navigation */
        .nav-tabs-container {
    margin-bottom: 1.5rem;
}

.nav-tabs {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tabs-section {
    display: flex;
    gap: 1rem;
}

.language-switch {
    display: flex;
    gap: 1rem;
}

.lang-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    color: #495057;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.lang-btn:hover, .lang-btn.active {
    background: rgba(134, 142, 150, 0.3);
    transform: translateY(-2px);
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #868e96;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    font-weight: 500;
}

.tab-btn.active, .tab-btn:hover {
    background: #868e96;
    color: white;
}

.hidden {
    display: none;
}

        /* Responsive */
        @media (max-width: 1024px) {
            .container {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
            }
            
            .detail-frame {
                width: 100%;
                right: -100%;
            }
        }

        @media (max-width: 768px) {
            .car-card {
                flex-direction: column;
            }
            
            .car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}
        }


        .loading, .error-message {
    padding: 2rem;
    text-align: center;
    font-size: 1.2rem;
    color: #495057;
}

.error-message button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #495057;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}




/* Стили для галереи изображений */
.car-gallery {
    position: relative;
    width: 100%;
    height: 700px;
    overflow: hidden;
    margin-bottom: 20px;
}

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

.car-gallery-image {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px; /* Регулируйте это значение по своему вкусу */
    overflow: hidden; /* Это важно, чтобы скругление работало */
}

.gallery-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 10;
}

.gallery-nav-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

.gallery-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.gallery-dot.active {
    background: white;
}

@media (max-width: 768px) {
    .car-gallery-image {
        height: 500px;
        object-fit: cover; /* или cover, в зависимости от желаемого эффекта */
    }

    .car-gallery-container {
        height: auto; /* чтобы контейнер подстроился под изображение */
    }

    .car-gallery {
        height: auto; /* чтобы всё адаптировалось */
    }
}






/* Добавленные стили для галереи в карточках */
        .car-image-container {
            position: relative;
            width: 300px;
            height: 300px;
            overflow: hidden;
            border-radius: 15px;
        }
        
        .car-image-slider {
            display: flex;
            transition: transform 0.5s ease;
            height: 100%;
        }
        
        .car-image-slide {
            min-width: 100%;
            height: 100%;
        }
        
        .car-image-slide img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .car-image-nav {
            position: absolute;
            top: 50%;
            width: 100%;
            display: flex;
            justify-content: space-between;
            transform: translateY(-50%);
            z-index: 2;
            opacity: 0;
            transition: opacity 0.3s;
        }
        
        .car-card:hover .car-image-nav {
            opacity: 1;
        }
        
        .car-image-btn {
            background: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 5px;
        }
        
        .car-image-dots {
            position: absolute;
            bottom: 10px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: center;
            gap: 6px;
            z-index: 2;
        }
        
        .car-image-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.5);
            cursor: pointer;
            transition: background 0.3s;
        }
        
        .car-image-dot.active {
            background: white;
        }
        
        /* Затемнение для закрытия фрейма */
        .detail-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 999;
            display: none;
        }
        
        .detail-overlay.active {
            display: block;
        }




        .installment-label {
    margin-top: 0.5rem;
    text-align: left;
    font-weight: bold;
    color: #28a745;
    font-size: 1rem;
}

 .price-section {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-radius: 12px;
            padding: 20px;
            margin: 20px 0;
            border: 1px solid #dee2e6;
        }
        
        .main-price {
            font-size: 28px;
            font-weight: bold;
            color: #28a745;
            margin-bottom: 10px;
        }
        
        .average-price {
            font-size: 16px;
            color: #6c757d;
            margin-bottom: 15px;
        }
        
        .installment-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }
        
        .installment-option {
            background: white;
            border: 2px solid #e9ecef;
            border-radius: 8px;
            padding: 15px;
            text-align: center;
            transition: all 0.3s ease;
        }
        
        .installment-option:hover {
            border-color: #007bff;
            box-shadow: 0 4px 12px rgba(0,123,255,0.15);
        }
        
        .installment-period {
            font-weight: bold;
            font-size: 18px;
            color: #007bff;
            margin-bottom: 8px;
        }
        
        .installment-payment {
            font-size: 20px;
            font-weight: bold;
            color: #28a745;
        }
        
        .car-price {
            font-size: 20px;
            font-weight: bold;
            color: #28a745;
            margin: 10px 0;
        }
        
        .price-label {
            font-size: 14px;
            color: #6c757d;
            margin-bottom: 5px;
        }




        /* Стили для цен */
.car-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 0.5rem 0;
}

.price-section {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.car-price-detail {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

.avg-price {
    font-size: 1rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

/* Стили для кредитных предложений */
.credit-options {
    margin: 2rem 0;
}

.credit-summary {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.credit-summary div {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
}

.credit-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.credit-option {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s;
}

.credit-option:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.credit-period {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.credit-details div {
    display: flex;
    justify-content: space-between;
    margin: 0.3rem 0;
}

.credit-note {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 1rem;
    font-style: italic;
}
