:root {
    --primary-dark: #0f172a;
    --primary-light: #334155;
    --accent: #FF5722;
    --accent-hover: #E64A19;
    --accent-soft: #FFF3EF;
    --success: #10b981;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-focus: #FF8A65;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-xl: 16px;
    --radius-md: 10px;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--primary-dark);
    line-height: 1.6;
}

/* =========================================
   2. HEADER PREMIUM
   ========================================= */
.search-page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.search-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding: 20px 0;
}

.badge-header {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 0;
    letter-spacing: -0.03em;
}

.main-subtitle {
    font-size: 1.1rem;
    color: var(--primary-light);
    max-width: 600px;
    margin: 10px auto 0;
}

/* =========================================
   3. LAYOUT GRID
   ========================================= */
.main-content-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
}

/* =========================================
   4. SIDEBAR DE FILTROS (Moderno)
   ========================================= */
.filters-sidebar {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    position: sticky;
    top: 20px;
    box-shadow: var(--shadow-sm);
}

.filters-header h3 {
    margin: 0 0 25px 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group { margin-bottom: 24px; }
.mt-2 { margin-top: 10px; }

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

/* Inputs & Selects Personalizados */
.form-input, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--primary-dark);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus, .form-select:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.select-wrapper { position: relative; }
.select-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
    pointer-events: none;
    font-size: 0.8rem;
}
.form-select { appearance: none; cursor: pointer; }

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Segmented Control (Radio Buttons Modernos) */
.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
}

.segment-option {
    flex: 1;
    position: relative;
    text-align: center;
}

.segment-option input { display: none; }

.segment-label {
    display: block;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.segment-option input:checked + .segment-label {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Range Slider */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.range-badge {
    background: var(--primary-dark);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.range-container { position: relative; height: 20px; }
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 5px;
    outline: none;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }

/* Botones Sidebar */
.btn-primary-full {
    display: block;
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary-full:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-text {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}
.btn-text:hover { color: var(--accent); }

/* =========================================
   5. TARJETAS DE VEHÍCULOS (Estilo Agency)
   ========================================= */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.vehicle-card-wrapper {
    transition: transform 0.3s ease;
}

.vehicle-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,0.5);
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.vehicle-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* Imagen y Overlays */
.card-image-box {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: #e2e8f0;
}

.card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}
.vehicle-card:hover .card-image-box img { transform: scale(1.05); }

.card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    opacity: 0.6;
}

.badge-state {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.badge-state.nuevo { background: var(--accent); color: white; }

/* Botón Favorito Flotante */
.btn-fav-float {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    border: none;
    color: #94a3b8;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn-fav-float:hover {
    background: white;
    color: #ef4444;
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}
.btn-fav-float.is-active {
    background: #fff1f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}
.btn-fav-float.is-active:hover {
    background: #fee2e2;
}

/* Contenido de la Tarjeta */
.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--primary-dark);
    line-height: 1.3;
    max-width: 80%;
}

.card-year {
    background: var(--bg-body);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-light);
}

.card-specs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 500;
}
.spec-item { display: flex; align-items: center; gap: 6px; }
.spec-item i { color: var(--accent); opacity: 0.8; }

.card-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 20px;
    margin-top: auto; /* Empuja el footer hacia abajo */
}

/* Footer: Precio y Acción */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-box { display: flex; flex-direction: column; }
.price-label { font-size: 0.75rem; color: var(--primary-light); font-weight: 600; text-transform: uppercase; }
.price-value { font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }

.btn-contact-action {
    background: #27d808;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-contact-action:hover {
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(235, 37, 63, 0.3);
}

/* =========================================
   6. ESTADOS VACÍOS & EXTRAS
   ========================================= */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border);
}
.empty-icon {
    width: 80px; height: 80px;
    background: var(--accent-soft);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent);
    font-size: 2rem;
}
.empty-state h3 { margin: 0 0 10px 0; color: var(--primary-dark); }
.empty-state p { color: var(--primary-light); margin-bottom: 25px; }

/* Whatsapp flotante moderno */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 32px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}
.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.05);
}

/* Responsive */
@media (max-width: 992px) {
    .main-content-grid {
        grid-template-columns: 1fr;
    }
    .filters-sidebar {
        position: relative;
        top: 0;
        z-index: 2;
    }
}@media (max-width: 640px) {

    /* ── Grid: una sola columna ── */
    .vehicles-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* ── Tarjeta: layout HORIZONTAL ── */
    .vehicle-card {
        flex-direction: row;
        border-radius: 14px;
        min-height: 155px;
        overflow: hidden;
    }

    /* ── Caja de imagen ── */
    .card-image-box {
        width: 155px;
        min-width: 155px;
        max-width: 155px;
        height: auto;
        min-height: 155px;
        border-radius: 0;
        flex-shrink: 0;
        position: relative;
        overflow: hidden;
        background: #f0f0f0;
    }

    /* object-fit: contain → carro completo + marca de agua visible */
    .card-image-box img {
        position: absolute;
        top: 0; left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #f0f0f0;
        transition: none;
    }

    /* ── Ocultar overlay oscuro ── */
    .card-overlay { display: none; }

    /* ── Badge USADO/NUEVO: arriba izquierda, pequeño ── */
    .badge-state {
        top: 8px;
        left: 8px;
        right: auto;
        bottom: auto;
        font-size: 0.58rem;
        padding: 3px 7px;
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ── Botón corazón: arriba derecha ── */
    .btn-fav-float {
        top: 8px;
        right: 8px;
        bottom: auto;
        left: auto;
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    /* ── Badge DESTACADO: abajo izquierda, pequeño ── */
    .badge-featured {
        top: auto !important;
        right: auto !important;
        bottom: 8px;
        left: 8px;
        font-size: 0.52rem;
        padding: 2px 6px;
        border-radius: 6px;
        max-width: 90px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        z-index: 3;
    }

    /* ── Contenido: info del vehículo ── */
    .card-content {
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    /* ── Encabezado: título + año ── */
    .card-header-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-bottom: 6px;
    }

    .card-title {
        font-size: 0.95rem;
        font-weight: 700;
        margin: 0;
        line-height: 1.3;
        white-space: normal;
    }

    .card-year {
        font-size: 0.72rem;
        font-weight: 600;
        padding: 2px 7px;
        align-self: flex-start;
    }

    /* ── Specs: columna compacta ── */
    .card-specs {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-bottom: 6px;
        font-size: 0.76rem;
    }

    .spec-item { gap: 4px; }

    /* ── Ocultar divisor ── */
    .card-divider { display: none; }

    /* ── Footer: precio + contactar ── */
    .card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        flex-wrap: wrap;
    }

    .price-label { display: none; }

    .price-value {
        font-size: 1rem;
        font-weight: 800;
        line-height: 1;
    }

    .btn-contact-action {
        padding: 6px 11px;
        font-size: 0.76rem;
        white-space: nowrap;
        border-radius: 40px;
    }
}