/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    line-height: 1.6;
    color: #1e1e2a;
    background: #fafbff;
    scroll-behavior: smooth;
}

.container {
    width: 92%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
}

h2 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    text-align: center;
    color: #14141f;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #2548F5;
    margin: 10px auto 0;
    border-radius: 6px;
}

.btn {
    display: inline-block;
    background: #2548F5;
    color: #fff;
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 8px 20px rgba(37, 72, 245, 0.25);
}

.btn:hover {
    background: #1a37c7;
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(37, 72, 245, 0.35);
}

section {
    padding: 70px 0;
}

/* ===== HEADER ===== */
header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(37, 72, 245, 0.08);
}

.header-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    flex-wrap: wrap;
}

.logo h1 {
    color: #2548F5;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo p {
    font-size: 0.8rem;
    color: #5b5b70;
    margin-top: -4px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

nav ul li a {
    text-decoration: none;
    color: #1e1e2a;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 40px;
    transition: 0.2s;
    font-size: 0.95rem;
}

nav ul li a:hover {
    background: rgba(37, 72, 245, 0.08);
    color: #2548F5;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
}

.hamburger .bar {
    width: 26px;
    height: 3px;
    background: #2548F5;
    border-radius: 20px;
    transition: 0.3s;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    text-align: center;
    background: url('/media/im.png') center/cover no-repeat;
    margin-top: 72px;
    border-radius: 0 0 48px 48px;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(20, 20, 31, 0.6) 0%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 700px;
    margin: 0 auto;
}

.hero h2 {
    color: #fff;
    font-size: 3.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero h2::after {
    background: #fff;
}

.hero p {
    font-size: 1.5rem;
    margin: 18px 0 32px;
    opacity: 0.9;
    font-weight: 300;
}

/* ===== CARS ===== */
.cars-section {
    background: #fafbff;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.car-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(37, 72, 245, 0.06);
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(37, 72, 245, 0.10);
}

.car-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f2f8;
    display: flex;
}

.car-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.car-image.active {
    opacity: 1;
}

.car-card h3 {
    padding: 18px 20px 4px;
    font-size: 1.3rem;
    font-weight: 600;
}

.car-card .price {
    padding: 0 20px 6px;
    color: #2548F5;
    font-weight: 700;
    font-size: 1.2rem;
}

.car-card .transmission {
    padding: 0 20px 14px;
    color: #5b5b70;
    font-size: 0.9rem;
}

.car-card .btn {
    margin: 0 20px 20px;
    width: calc(100% - 40px);
    text-align: center;
    border-radius: 40px;
}

/* ===== CONDITIONS & LEGAL ===== */
.conditions-list,
.legal-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 24px;
}

.condition-item,
.legal-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    padding: 24px 22px;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(37, 72, 245, 0.06);
    transition: 0.25s;
}

.condition-item:hover,
.legal-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(37, 72, 245, 0.06);
}

.condition-item i,
.legal-item i {
    font-size: 1.6rem;
    color: #2548F5;
    min-width: 32px;
    text-align: center;
}

.legal-item {
    border-left: 4px solid #2548F5;
}

/* ===== CONTACTS ===== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.contact-info {
    background: #fff;
    padding: 30px 28px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.02);
    border-left: 5px solid #2548F5;
    transition: 0.25s;
}

.contact-info:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(37, 72, 245, 0.06);
}

.contact-info h3 {
    color: #2548F5;
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    color: #1e1e2a;
}

.contact-info i {
    color: #2548F5;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* ===== FOOTER ===== */
footer {
    background: #14141f;
    color: #eaeef5;
    padding: 50px 0 0;
    border-radius: 40px 40px 0 0;
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-logo h3 {
    color: #fff;
    font-size: 1.7rem;
}
.footer-logo p {
    color: #9aa0b5;
}

.footer-links h4,
.footer-contacts h4,
.footer-social h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

.footer-links h4::after,
.footer-contacts h4::after,
.footer-social h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 3px;
    background: #2548F5;
    border-radius: 10px;
}

.footer-links ul {
    list-style: none;
}
.footer-links li {
    margin-bottom: 10px;
}
.footer-links a {
    color: #9aa0b5;
    text-decoration: none;
    transition: 0.2s;
}
.footer-links a:hover {
    color: #fff;
}

.footer-contacts p {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9aa0b5;
    margin-bottom: 12px;
}
.footer-contacts i {
    color: #2548F5;
    width: 20px;
    text-align: center;
}

.social-icons {
    display: flex;
    gap: 16px;
}
.social-icons a {
    color: #9aa0b5;
    font-size: 1.6rem;
    transition: 0.2s;
}
.social-icons a:hover {
    color: #2548F5;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    color: #6a7085;
    font-size: 0.9rem;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: #fff;
    max-width: 940px;
    margin: 40px auto;
    padding: 32px 36px;
    border-radius: 32px;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 32px;
    font-weight: 300;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}
.close-modal:hover {
    color: #14141f;
    transform: rotate(90deg);
}

.modal-car-info {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}
.modal-car-images {
    flex: 1.1;
    min-width: 280px;
}
.main-car-image-container {
    position: relative;
    width: 100%;
    height: 320px;
    background: #f0f2f8;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 14px;
}
.car-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}
.car-image-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.car-image-wrapper img.active {
    opacity: 1;
}
.arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: 0.2s;
}
.arrow-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}
.prev-btn {
    left: 12px;
}
.next-btn {
    right: 12px;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.modal-thumbnails::-webkit-scrollbar {
    display: none;
}
.modal-thumbnail {
    width: 70px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}
.modal-thumbnail.active {
    border-color: #2548F5;
}
.modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-car-details {
    flex: 1;
    min-width: 240px;
}
.modal-car-details h2 {
    font-size: 2rem;
    text-align: left;
    margin-bottom: 8px;
}
.modal-car-details h2::after {
    margin: 8px 0 0;
}

.car-description {
    background: #f5f7fe;
    padding: 16px 20px;
    border-radius: 16px;
    margin: 16px 0;
}
.car-description h3 {
    font-size: 1rem;
    color: #2548F5;
    margin-bottom: 4px;
}
.car-specs p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.car-specs i {
    color: #2548F5;
    width: 22px;
    text-align: center;
}
.car-pricing {
    background: #f5f7fe;
    padding: 18px 20px;
    border-radius: 16px;
    margin-top: 18px;
}
.car-pricing h3 {
    color: #2548F5;
    font-size: 1rem;
    margin-bottom: 6px;
}
.car-pricing p {
    font-size: 1.1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero h2 {
        font-size: 2.8rem;
    }
    .modal-car-info {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .header-grid {
        flex-wrap: wrap;
    }
    .nav-container {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    .hamburger {
        display: flex;
    }
    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 10px;
        right: 10px;
        background: #fff;
        border-radius: 20px;
        padding: 10px 0;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
        border-bottom: 1px solid rgba(37, 1, 241, 0.3)
    }
    nav.active {
        display: block;
        animation: fadeDown 0.3s ease;
    }
    @keyframes fadeDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    nav ul {
        flex-direction: column;
        gap: 0;
    }
    nav ul li a {
        margin-top: 5px;
        display: block;
        padding: 10px 24px;
        border-radius: 20px;
        text-align: center;
    }
    nav ul li:hover {
        background-color: #bbbbbb;
    }
    .hero {
        min-height: 70vh;
        margin-top: 70px;
    }
    .hero h2 {
        font-size: 2.2rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    .modal-content {
        padding: 20px;
        margin: 20px auto;
    }
    .main-car-image-container {
        height: 220px;
    }
    .modal-thumbnail {
        width: 56px;
        height: 44px;
    }
    .cars-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .cars-grid {
        grid-template-columns: 1fr;
    }
    .hero h2 {
        font-size: 1.8rem;
    }
    .conditions-list,
    .legal-list {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .modal-content {
        padding: 16px;
    }
    .main-car-image-container {
        height: 180px;
    }
    .close-modal {
        top: 10px;
        right: 16px;
        font-size: 28px;
    }
}