/* ============ Theme (Indigo + Lime, match Navbar) ============ */
:root {
    --navbar-bg: #f8fafc; /* ������ ��� �� ��������� */
    --surface: #ffffff; /* ����� / ������ � ����� ���� */
    --surface-2: #f1f5f9; /* ��-������ ��� (input) */
    --text: #0f172a; /* �������� ����� */
    --muted: #475569; /* �������� ����� */
    --border: rgba(0,0,0,.08);
    --accent: #1B2A4A; /* blue – matches homepage */
    --accent-2: #2a3f6a; /* blue hover */

    --success: #22c55e;
    --danger: #ef4444;
}

/* ������ �������� �� light UI */
body {
    color: var(--text);
    background: var(--surface-2);
}

a {
    color: var(--accent);
}

    a:hover {
        color: var(--accent-2);
    }

.text-muted {
    color: var(--muted) !important;
}

/* ����� �� inputs/����� � lime ring */
:where(.form-control,.form-select,.btn):focus {
    box-shadow: 0 0 0 .15rem rgba(230,57,70,.25);
    border-color: var(--accent);
}

/* ============ Hero ============ */
.hero-section {
    background: linear-gradient( 135deg, color-mix(in srgb, var(--accent) 12%, var(--navbar-bg)) 0%, #0f172a 100% );
    color: var(--text);
    padding: 5rem 0;
    border-bottom: 1px solid var(--border);
}

    .hero-section .section-title,
    .hero-section h1, .hero-section h2, .hero-section p {
        text-shadow: 0 2px 6px rgba(0,0,0,.35);
    }

/* ============ Filter ============ */
.filter-section {
    background: var(--surface);
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

    .filter-section .form-label {
        color: var(--muted);
        font-weight: 600;
    }

    /* input � select � ������ UI ��� �������� ����� */
    .filter-section .form-control,
    .filter-section .form-select {
        background: var(--surface-2);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px 14px;
        line-height: 1.4;
        transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    }

        .filter-section .form-control::placeholder {
            color: #64748b;
        }

        .filter-section .form-control:hover,
        .filter-section .form-select:hover {
            border-color: color-mix(in srgb, var(--text) 12%, var(--border));
        }

        .filter-section .form-control:focus,
        .filter-section .form-select:focus {
            outline: none;
            background: #fff;
            border-color: var(--accent);
            box-shadow: 0 0 0 .25rem rgba(230,57,70,.20);
        }

        /* disabled / read-only */
        .filter-section .form-control:disabled,
        .filter-section .form-select:disabled,
        .filter-section .form-control[readonly] {
            background: #e5e7eb;
            color: #94a3b8;
            border-color: rgba(0,0,0,.06);
            cursor: not-allowed;
        }

        /* ����� ������� */
        .filter-section .form-control.form-control-sm,
        .filter-section .form-select.form-select-sm {
            padding: 8px 10px;
            border-radius: 10px;
            font-size: .925rem;
        }

    /* input-group */
    .filter-section .input-group-text {
        background: var(--surface-2);
        border: 1px solid var(--border);
        color: var(--muted);
        border-radius: 12px;
    }

    .filter-section .input-group > .form-control:not(:last-child),
    .filter-section .input-group > .form-select:not(:last-child) {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .filter-section .input-group > .input-group-text:not(:first-child),
    .filter-section .input-group > .btn:not(:first-child) {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    /* ��������� */
    .filter-section .form-control.is-valid,
    .filter-section .form-select.is-valid {
        border-color: #22c55e;
        box-shadow: 0 0 0 .2rem rgba(34,197,94,.18);
    }

    .filter-section .form-control.is-invalid,
    .filter-section .form-select.is-invalid {
        border-color: #ef4444;
        box-shadow: 0 0 0 .2rem rgba(239,68,68,.18);
    }

    /* ��-��������� ������� �� select */
    .filter-section .form-select {
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2394a3b8' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right .8rem center;
        background-size: 18px 18px;
        padding-right: 2.2rem;
    }

        .filter-section .form-select:focus {
            background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23E63946' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
        }

/* ============ Cards (cars) ============ */
.car-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

    .car-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 28px rgba(0,0,0,.12);
        border-color: color-mix(in srgb, var(--accent) 45%, #ffffff);
    }

.car-image {
    height: 220px;
    width: 100%;
    object-fit: cover;
    background: #f1f5f9;
}

/* �������� */
.price-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: #fff;
    padding: 8px 15px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 8px 26px rgba(230,57,70,.35);
}

.discount-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--danger);
    color: #fff;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: .8rem;
    font-weight: 800;
}

.car-specs {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    font-size: .92rem;
    color: var(--muted);
    gap: 10px;
    flex-wrap: wrap;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============ Buttons ============ */
.btn-primary-custom {
    background: linear-gradient(45deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: 26px;
    padding: 10px 26px;
    color: #fff;
    font-weight: 800;
    letter-spacing: .2px;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

    .btn-primary-custom:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px rgba(27,42,74,.35);
        filter: brightness(1.05);
    }

.btn-primary,
.btn-outline-primary {
    border-radius: 26px;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--accent-2);
        border-color: var(--accent-2);
        color: #fff;
    }

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
}

    .btn-outline-primary:hover {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
    }

/* ============ Stats ============ */
.stats-section {
    background: linear-gradient(135deg, #1e293b 0%, #111827 100%);
    color: #ffffff;
    padding: 3rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,.1);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(255,255,255,.15);
}

/* ============ Swiper ============ */
.cars-swiper .swiper-button-prev,
.cars-swiper .swiper-button-next {
    color: var(--text);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}

.cars-swiper .swiper-pagination-bullet {
    background: #8b949e;
    opacity: .7;
}

.cars-swiper .swiper-pagination-bullet-active {
    background: var(--accent);
    opacity: 1;
}

/* ����� ���� ���� */
.section-title {
    color: var(--text);
}

.card, .bg-white {
    background: var(--surface) !important;
    color: var(--text);
}

.bg-light {
    background: var(--surface) !important;
}

.border-top, .border-bottom {
    border-color: var(--border) !important;
}

#filterForm .form-select,
#filterForm .form-select:focus,
#filterForm .form-select:focus-visible {
    background-image: none;
}

@media (max-width: 575.98px) {
    #offers {
        padding-top: 1rem !important;
    }

    #offers .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    #resultsInfo {
        margin-bottom: 1rem !important;
        font-size: .95rem;
    }

    #carsGrid {
        --bs-gutter-y: 1rem;
    }

    .car-card {
        min-height: 0;
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }

    .car-card:hover {
        transform: none;
    }

    .car-card:hover .car-image {
        transform: none;
    }

    .car-image {
        height: auto;
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }

    .price-badge {
        top: 12px;
        left: 12px;
        right: auto;
        max-width: calc(100% - 68px);
        padding: 7px 13px;
        border-radius: 999px;
        font-size: .98rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .discount-badge {
        top: 56px;
        left: 12px;
        border-radius: 999px;
    }

    .btn-favorite {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .car-card .p-3.flex-grow-1 {
        padding: 1rem !important;
    }

    .car-card h5 {
        min-height: 2.75rem;
        font-size: 1.1rem;
        line-height: 1.25;
        white-space: normal;
        overflow: hidden;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .car-specs {
        justify-content: flex-start;
        gap: .5rem;
        margin: .75rem 0;
        font-size: .9rem;
    }

    .spec-item {
        padding: .28rem .6rem;
        border: 1px solid rgba(15, 23, 42, .06);
        border-radius: 999px;
        background: #f1f5f9;
    }

    .car-card .mt-2 strong {
        font-size: 1.05rem;
    }

    .car-card .p-3.pt-0.mt-auto {
        padding: 0 1rem 1rem !important;
    }

    .btn-primary-custom {
        padding: .72rem 1rem;
        border-radius: 14px;
        font-size: 1rem;
        line-height: 1.2;
    }
}
