* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: white;
    overflow: hidden;
    height: 100vh;
}

.branch-selection {
    display: flex;
    height: 100vh;
    position: relative;
}

.branch-card {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.branch-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.car-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

.main-image {
    opacity: 1;
}

.lights-image {
    opacity: 0;
}

.branch-card:hover .main-image {
    opacity: 0;
}

.branch-card:hover .lights-image {
    opacity: 1;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.branch-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.branch-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #ffd400;
}

.branch-description {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.branch-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.feature {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Анимация появления */
.branch-card {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

#reutov-branch {
    animation-delay: 0.2s;
}

#elektrostal-branch {
    animation-delay: 0.4s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .branch-selection {
        flex-direction: column;
        height: 100dvh; /* динамическая высота вьюпорта – учитывает адресную строку */
    }

    .branch-card {
        flex: 1; /* каждый блок занимает равную долю доступной высоты */
        height: auto; /* убираем фиксированную высоту 50vh */
        min-height: 0; /* чтобы flex корректно сжимался */
    }

    .branch-title {
        font-size: 2rem;
    }

    .branch-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .branch-title {
        font-size: 1.8rem;
    }

    .branch-description {
        font-size: 1rem;
    }

    .branch-content {
        padding: 1rem;
    }
}
