/* Контейнер страницы */
.page-content {
    padding-top: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

/* Заголовок и фиолетовая полоска */
h2.my-4.text-center {
    position: relative;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

h2.my-4.text-center::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background-color: #7a3cff;
    margin: 8px auto 0 auto;
    border-radius: 2px;
}

/* Форма фильтра */
.filter-form {
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Группы фильтров */
.filter-form .filter-group {
    flex: 1 1 95px;
    min-width: 200px;
    max-width: 280px;
    width: 100%;
}

/* Стили для селектов */
form .form-select {
    width: 100%;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    transition: border-color 0.3s ease;
    background-color: #fff;
    height: 40px;
    box-sizing: border-box;
}

form .form-select:focus {
    border-color: #7a3cff;
    outline: none;
}

/* Кнопки фильтра */
.filter-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

form .btn-primary,
form .btn-reset {
    min-width: 160px;
    height: 40px;
    padding: 0 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

form .btn-primary {
    background-color: #7a3cff;
    border-color: #7a3cff;
    color: #fff;
    transition: background-color 0.3s ease;
}

form .btn-primary:hover {
    background-color: #5a27cc;
}

form .btn-reset {
    background: none;
    border: none;
    color: #7a3cff;
    cursor: pointer;
    transition: color 0.3s ease;
}

form .btn-reset:hover {
    color: #5a27cc;
}

/* Карточки */
.row.justify-content-start {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;  /* Центрирование карточек */
    gap: 20px;
    padding-left: 0;
    box-sizing: border-box;
}

.car-card {
    flex: 0 0 calc(25% - 10px);
    max-width: calc(25% - 10px);
    display: flex;
}

/* Карточка */
.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    min-height: 450px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}

.image-container {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    height: 250px;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.price-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #7a3cff;
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    box-shadow: 0 0 8px rgba(122, 60, 255, 0.7);
}

.card-body {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

/* Заголовок и КПП на одном уровне */
.card-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
    min-height: 3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text {
    margin-bottom: 5px;
    min-height: 1.5rem;
}

.btn-purple {
    background-color: #7a3cff;
    color: #fff;
    border: none;
    padding: 13px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    align-self: center;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 8px !important;
}

.btn-purple:hover {
    background-color: #5a27cc;
}

/* ===== МОБИЛЬНЫЕ ===== */
@media (max-width: 576px) {
    .filter-form {
        width: 350px;
        margin: 0 auto 16px auto;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
        align-items: center;
    }

    .filter-group {
        width: 100%;
        margin: 0;
    }

    .form-select {
        width: 100%;
        box-sizing: border-box;
        height: 36px;
        font-size: 14px;
        margin-bottom: 2px;
    }

    .filter-buttons {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 4px;
        justify-content: center;
        align-items: center;
    }

    .filter-buttons .btn-primary {
        width: 100%;
        height: 42px;
        font-size: 16px;
    }

    .filter-buttons .btn-reset {
        width: 100%;
        height: 36px;
        font-size: 14px;
        text-align: center;
    }

    /* Карточки на мобильных устройствах */
    .car-card {
        flex: 0 0 calc(100% - 20px); /* 1 карточка в ряд */
        max-width: calc(100% - 20px);
    }
}

/* ===== ПЛАНШЕТЫ ===== */
@media (min-width: 577px) and (max-width: 900px) {
    .filter-form {
        max-width: 720px;
        margin: 0 auto 16px auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        grid-template-rows: auto auto auto;
        grid-gap: 6px 16px;
        justify-items: stretch;
        align-items: end;
    }

    .filter-group:nth-child(1) { grid-column: 1 / 2; }
    .filter-group:nth-child(2) { grid-column: 2 / 3; }
    .filter-group:nth-child(3) { grid-column: 1 / 3; }

    .filter-buttons {
        grid-column: 1 / 3;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 4px;
    }

    .btn-primary, .btn-reset {
        width: 160px;
        height: 38px;
        padding: 0;
        font-size: 1rem;
        border-radius: 12px;
    }

    /* Карточки на планшетах */
    .car-card {
        flex: 0 0 calc(50% - 10px); /* 2 карточки в ряд */
        max-width: calc(50% - 10px);
    }
}

/* ===== ДЕСКТОП ===== */
@media (min-width: 901px) {
    .filter-form {
        max-width: 1200px;
    }

    .filter-buttons {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        flex-wrap: nowrap;
    }
}

/* ===== ДЕСКТОП ≥1200px — 4 карточки в ряд ===== */
@media (min-width: 1200px) {
    .car-card {
        flex: 0 0 calc(24.5% - 12px);
        max-width: calc(24.5% - 12px);
    }
}
