/* Основные стили */
html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background: url('background.jpg') no-repeat center center fixed;
    background-size: cover;
    overflow-x: hidden;
}

body::after {
    content: '';
    display: block;
    height: 50px;
    visibility: hidden;
}

header {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    padding: 60px 0 30px;
    position: relative;
    min-height: 200px;
}

header h1 {
    margin: 0 0 20px;
    font-size: 2em;
    padding-top: 40px;
}

.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    max-width: 200px;
    z-index: 10;
}

.features {
    padding: 40px 20px;
    background: rgba(244, 244, 244, 0.9);
}

.features h2 {
    text-align: center;
    margin: 0 0 30px;
    font-size: 2em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    padding: 25px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item h3 {
    margin: 0 0 15px;
    color: #102C54;
}

.feature-item p {
    text-align: left;
    margin: 10px 0;
}

.feature-item button {
    padding: 12px 25px;
    background: #102C54;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.feature-item button:hover {
    background: #081A34;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.feature-item button:active {
    transform: scale(0.98);
}

/* Анимации */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in {
    animation: fade-in 0.8s ease-out forwards;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.animate-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

/* Мобильная версия */
@media (max-width: 768px) {
    .features-grid {
        display: flex;
        flex-direction: column;
    }

    .features-grid .feature-item:nth-child(1) { order: 1; }
    .features-grid .feature-item:nth-child(2) { order: 3; } /* Предпоследний */
    .features-grid .feature-item:nth-child(3) { order: 2; }
    .features-grid .feature-item:nth-child(4) { order: 4; }

    .feature-item {
        opacity: 0;
        transform: translateY(20px);
        transition: 
            opacity 0.4s ease-out,
            transform 0.4s ease-out;
    }

    .feature-item:nth-child(1) { transition-delay: 0.1s; }
    .feature-item:nth-child(2) { transition-delay: 0.3s; }
    .feature-item:nth-child(3) { transition-delay: 0.5s; }
    .feature-item:nth-child(4) { transition-delay: 0.7s; }

    .feature-item.active {
        opacity: 1;
        transform: translateY(0);
    }

    .logo {
        position: static;
        max-width: 180px;
        margin: 0 auto 20px;
        display: block;
    }

    header {
        padding: 30px 0;
    }

    header h1 {
        font-size: 1.5em;
        padding-top: 0;
    }

    .modal-container {
        width: 95%;
        margin: 10px auto;
        max-height: 85vh;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .car-preview {
        min-height: 200px;
    }
}

/* Стили модального окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    max-width: 900px;
    margin: 2% auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalEnter 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #102C54;
    transition: transform 0.2s;
}

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

.modal-content {
    padding: 30px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
}

.car-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.car-item {
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.car-item:hover {
    background: #f8f8f8;
    border-color: #102C54;
}

.car-item.active {
    background: #102C54 !important;
    color: white;
    border-color: #102C54 !important;
}

.car-item.active .car-desc {
    color: #ddd;
}

.car-preview {
    position: relative;
    min-height: 300px;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
}

.loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #102C54;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.car-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    transition: opacity 0.3s ease;
}

.image-caption {
    text-align: center;
    padding: 10px;
    font-style: italic;
    color: #666;
}

footer {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    transition: opacity 0.4s ease;
}

footer p {
    margin: 10px 0;
    font-size: 1em;
}