: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 (Rediseño Limpio) */
.card-content {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #fff;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0 0 12px 0;
    color: #000;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-value {
    font-size: 1.8rem;
    font-weight: 400;
    color: #111;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.card-specs {
    margin-bottom: 4px;
}

.spec-text {
    color: #4a4a4a;
    font-size: 0.85rem;
    font-weight: 400;
}

.card-location {
    margin-top: auto;
    padding-top: 4px;
}

.location-text {
    color: #888;
    font-size: 0.8rem;
    font-weight: 400;
}

/* =========================================
   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 Mejorado ── */
    .vehicle-card {
        flex-direction: row;
        border-radius: 12px;
        min-height: 140px;
        overflow: hidden;
        align-items: stretch; /* Permite que el contenido dicte la altura */
        padding: 8px; /* Pequeño padding alrededor de toda la tarjeta */
    }

    /* ── Caja de imagen (Relación de aspecto fija 4:3) ── */
    .card-image-box {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
        height: 105px; /* Altura fija para no estirarse verticalmente */
        min-height: 105px;
        border-radius: 8px; /* Bordes redondeados también en la imagen */
        flex-shrink: 0;
        position: relative;
        overflow: hidden;
        background: transparent;
        margin-right: 12px;
    }

    /* object-fit: cover ahora recortará muy poco porque la caja ya es 4:3 */
    .card-image-box img {
        position: absolute;
        top: 0; left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: none;
    }

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

    /* ── Badge USADO/NUEVO ── */
    .badge-state {
        top: 6px;
        left: 6px;
        right: auto;
        bottom: auto;
        font-size: 0.55rem;
        padding: 3px 6px;
        max-width: 60px;
    }

    /* ── Botón corazón ── */
    .btn-fav-float {
        top: 6px;
        right: 6px;
        bottom: auto;
        left: auto;
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    /* ── Badge DESTACADO ── */
    .badge-featured {
        top: auto !important;
        right: auto !important;
        bottom: 6px;
        left: 6px;
        font-size: 0.5rem;
        padding: 2px 5px;
        border-radius: 4px;
    }

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

    .card-title {
        font-size: 0.9rem;
        font-weight: 400;
        margin: 0 0 6px 0;
        line-height: 1.2;
        color: #000;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .price-value {
        font-size: 1.15rem;
        font-weight: 600;
        color: #111;
        line-height: 1.1;
        margin-bottom: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-specs {
        margin-bottom: 2px;
    }

    .spec-text {
        font-size: 0.75rem;
        color: #666;
    }

    .card-location {
        margin-top: auto;
    }

    .location-text {
        font-size: 0.7rem;
        color: #999;
    }
}

/* =========================================
   NUEVOS ESTILOS CORPORATIVOS DE BUSQUEDA (AJUSTADOS)
   ========================================= */

/* ═══════════════════════════════════════════
   ESTILOS CORPORATIVOS AVANZADOS (CARROYA STYLE)
═══════════════════════════════════════════ */
body { background-color: #f1f5f9; }
.corporate-filters-panel { background: transparent; padding: 0; position: sticky; top: 24px; }
.corporate-filters__head { margin-bottom: 20px; }
.corporate-filters__title { font-size: 1.3rem; font-weight: 800; color: #0f172a; margin: 0 0 4px 0; }
.corporate-filters__count { font-size: 0.9rem; color: #475569; }
.filter-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.filter-card.p-0 { padding: 0; }
.filter-card-transparent { margin-bottom: 24px; }
.filter-card__title { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin: 0 0 16px 0; }
.filter-dual-inputs { display: flex; align-items: center; gap: 8px; }
.dual-input-col { flex: 1; }
.dual-input-col label { display: block; font-size: 0.8rem; color: #475569; font-weight: 600; margin-bottom: 6px; }
.dual-input-wrapper { position: relative; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; display: flex; align-items: center; overflow: hidden; }
.dual-input-wrapper:focus-within { border-color: #3b82f6; }
.dual-input-wrapper .prefix { padding-left: 10px; color: #64748b; font-size: 0.9rem; }
.dual-input-wrapper input { width: 100%; border: none; padding: 10px; font-size: 0.9rem; outline: none; color: #0f172a; }
.dual-input-separator { color: #94a3b8; margin-top: 24px; }
.counter-text { font-size: 0.85rem; font-weight: 700; color: #475569; }
.filter-card--certified { background: #f8fafc; border: 1px solid #e2e8f0; }
.certified-banner { display: flex; gap: 12px; margin-bottom: 16px; }
.certified-logo { width: 48px; height: 48px; background: #dc2626; border-radius: 12px 0 12px 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem; flex-shrink: 0; }
.certified-text { display: flex; flex-direction: column; }
.certified-text strong { font-size: 0.95rem; color: #1e293b; line-height: 1.2; margin-bottom: 4px; }
.certified-text span { font-size: 0.8rem; color: #475569; line-height: 1.4; }
.custom-checkbox, .custom-radio { display: flex; align-items: center; position: relative; cursor: pointer; user-select: none; }
.custom-checkbox input, .custom-radio input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark, .radiomark { height: 20px; width: 20px; background-color: #fff; border: 1px solid #cbd5e1; border-radius: 4px; margin-right: 12px; position: relative; flex-shrink: 0; }
.radiomark, .radio-style { border-radius: 50%; }
.custom-checkbox:hover input ~ .checkmark, .custom-radio:hover input ~ .radiomark { border-color: #94a3b8; }
.custom-checkbox input:checked ~ .checkmark { background-color: #0f172a; border-color: #0f172a; }
.custom-radio input:checked ~ .radiomark, .custom-checkbox input[type="radio"]:checked ~ .checkmark { border-color: #3b82f6; border-width: 6px; }
.checkmark:after { content: ""; position: absolute; display: none; left: 6px; top: 2px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.custom-checkbox input[type="checkbox"]:checked ~ .checkmark:after { display: block; }
.checkbox-label, .radio-label { font-size: 0.9rem; color: #334155; font-weight: 500; }
.list-checkbox { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
.list-checkbox:last-child { border-bottom: none; }
.list-checkbox:hover { background: #f8fafc; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.filter-card .divider { height: 1px; background: #f1f5f9; }
.brand-search-box { padding: 12px; border-bottom: 1px solid #e2e8f0; position: relative; }
.brand-search-box input { width: 100%; padding: 10px 10px 10px 36px; border: 1px solid #cbd5e1; border-radius: 20px; font-size: 0.85rem; outline: none; background: #f8fafc; }
.brand-search-box input:focus { background: #fff; border-color: #3b82f6; }
.brand-search-box i { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.scrollable-list { max-height: 280px; overflow-y: auto; }
.brand-item-row { display: flex; align-items: center; border-bottom: 1px solid #f1f5f9; border-left: 3px solid transparent; transition: background 0.2s, border-left 0.2s; }
.brand-item-row.active { border-left-color: #3b82f6; background: #f8fafc; }
.brand-item-row:hover { background: #f8fafc; }
.brand-logo-mock { width: 32px; height: 32px; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; margin-right: 12px; color: #64748b; font-size: 0.8rem; }
.icon-list { list-style: none; padding: 0; margin: 0; }
.icon-list li { border-bottom: 1px solid #f1f5f9; border-left: 3px solid transparent; }
.icon-list li:last-child { border-bottom: none; }
.icon-list li.active { border-left-color: #dc2626; background: #f8fafc; }
.icon-list-item { display: flex; align-items: center; padding: 12px 16px; cursor: pointer; width: 100%; }
.icon-list-item input { display: none; }
.icon-list-item i { width: 24px; text-align: center; color: #64748b; font-size: 1.1rem; margin-right: 12px; }
.icon-list-item span { font-size: 0.9rem; color: #475569; font-weight: 500; }
.icon-list li.active span, .icon-list li.active i { color: #0f172a; font-weight: 700; }
.custom-slider-container { position: relative; padding: 10px 0; }
.corporate-slider { -webkit-appearance: none; width: 100%; height: 6px; background: linear-gradient(to right, #dc2626 100%, #e2e8f0 100%); border-radius: 4px; outline: none; }
.corporate-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #0f172a; box-shadow: 0 0 0 4px #e2e8f0; cursor: pointer; margin-top: -8px; }
.corporate-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #0f172a; box-shadow: 0 0 0 4px #e2e8f0; cursor: pointer; }
.btn-corporate-clear:hover { background: #f8fafc !important; }

/* ═══════════════════════════════════════════
   LAYOUT GENERAL
═══════════════════════════════════════════ */
.buscar-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 36px 24px 72px;
    align-items: start;
    font-family: var(--font-main);
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.filters-panel {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    padding: 28px 24px;
    position: sticky;
    top: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

/* ─── Mobile Filters Drawer (Desktop default hidden) ─── */
.filters-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 1040; opacity: 0; transition: opacity .3s;
}
.filters-overlay.is-open { display: block; opacity: 1; }
.close-filters-btn {
    display: none; background: transparent; border: none;
    font-size: 1.25rem; color: #64748b; cursor: pointer;
    padding: 4px; border-radius: 8px; align-items: center; justify-content: center;
}
.close-filters-btn:hover { background: #f1f5f9; color: #0f172a; }
.mobile-filters-btn {
    display: none; align-items: center; gap: 8px;
    background: #fff; padding: 8px 16px;
    border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: .88rem; font-weight: 700; color: #0f172a;
    box-shadow: 0 2px 6px rgba(0,0,0,.04); cursor: pointer; transition: all .2s;
}
.mobile-filters-btn:hover { background: #f8fafc; border-color: #cbd5e1; }

.filters-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.filters-panel__title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.01em;
}
.filters-panel__count {
    font-size: .75rem;
    font-weight: 700;
    background: #FFF3EF;
    color: #FF5722;
    padding: 3px 10px;
    border-radius: 20px;
}

.filter-group { margin-bottom: 20px; }

.filter-label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
}
.filter-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.filter-km-badge {
    font-size: .72rem;
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

/* Tabs tipo/condición */
.filter-type-tabs,
.filter-condition-tabs {
    display: flex;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.type-tab, .condition-tab {
    flex: 1;
    text-align: center;
    cursor: pointer;
}
.type-tab input,
.condition-tab input { display: none; }
.type-tab span,
.condition-tab span {
    display: block;
    padding: 7px 4px;
    font-size: .8rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px;
    transition: all .2s;
}
.type-tab input:checked + span,
.condition-tab input:checked + span {
    background: #fff;
    color: #FF5722;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    font-weight: 700;
}

/* Selects */
.filter-select-wrap { position: relative; }
.filter-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    background: #f8fafc;
    font-family: var(--font-main);
    font-size: .88rem;
    color: #0f172a;
    appearance: none;
    cursor: pointer;
    transition: border-color .2s;
}
.filter-select:focus {
    outline: none;
    border-color: #FF5722;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,87,34,.08);
}
.filter-select__arrow {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: .7rem;
    pointer-events: none;
}

/* Inputs */
.filter-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    background: #f8fafc;
    font-family: var(--font-main);
    font-size: .88rem;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color .2s;
}
.filter-input:focus {
    outline: none;
    border-color: #FF5722;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,87,34,.08);
}
.filter-input-wrap { position: relative; }
.filter-input-prefix {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-weight: 700;
    font-size: .9rem;
    pointer-events: none;
}
.filter-input--price { padding-left: 26px; }

/* Slider */
.filter-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #e8ecf0;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}
.filter-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    background: #FF5722;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(255,87,34,.35);
    cursor: pointer;
    transition: transform .15s;
}
.filter-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.filter-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: #94a3b8;
    margin-top: 6px;
}

/* Acciones del filtro */
.filter-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.btn-filter-apply {
    width: 100%;
    padding: 12px;
    background: #FF5722;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    letter-spacing: .01em;
}
.btn-filter-apply:hover {
    background: #E64A19;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,87,34,.3);
}
.btn-filter-clear {
    display: block;
    text-align: center;
    font-size: .83rem;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    transition: color .2s, background .2s;
}
.btn-filter-clear:hover { color: #FF5722; background: #FFF3EF; }

/* Bloque IA */
.sidebar-ai-block {
    margin-top: 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sidebar-ai-block__icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg,#FF7043,#FF5722);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: .9rem;
    flex-shrink: 0;
}
.sidebar-ai-block__text {
    display: flex; flex-direction: column; gap: 3px;
}
.sidebar-ai-block__text strong {
    font-size: .82rem;
    font-weight: 800;
    color: #0f172a;
}
.sidebar-ai-block__text span {
    font-size: .75rem;
    color: #64748b;
    line-height: 1.45;
}
.sidebar-ai-block__btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg,#FF7043,#FF5722);
    color: #fff;
    font-family: var(--font-main);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
}
.sidebar-ai-block__btn:hover { opacity: .9; transform: translateY(-1px); }

/* ═══════════════════════════════════════════
   PANEL DERECHO
═══════════════════════════════════════════ */
.results-panel { min-width: 0; }

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.results-header__meta { display: flex; align-items: baseline; gap: 12px; }
.results-header__title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -.02em;
}
.results-header__count {
    font-size: .82rem;
    font-weight: 600;
    color: #94a3b8;
}

/* Sort bar */
.sort-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sort-bar__label { font-size: .8rem; font-weight: 700; color: #64748b; white-space: nowrap; }
.sort-bar__options { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #e8ecf0;
    background: #f8fafc;
    font-family: var(--font-main);
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.sort-chip:hover { border-color: #FF5722; color: #FF5722; background: #FFF3EF; }
.sort-chip--active { background: #FF5722; color: #fff; border-color: #FF5722; box-shadow: 0 2px 8px rgba(255,87,34,.25); }

/* ═══════════════════════════════════════════
   GRILLA
═══════════════════════════════════════════ */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    position: relative;
}

/* ─── Spinner AJAX ─── */
.grid-spinner {
    display: flex; align-items: center; justify-content: center;
    padding: 60px 0;
}
.grid-spinner__dot {
    width: 36px; height: 36px;
    border: 3px solid #f1f5f9;
    border-top-color: #FF5722;
    border-radius: 50%;
    animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Paginación ─── */
.pagination-wrapper {
    display: flex; justify-content: center;
    margin-top: 48px;
    grid-column: 1 / -1;
}
.pagination { display: flex; align-items: center; gap: 8px; }
.page-link {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    border: 1.5px solid #e8ecf0;
    border-radius: 10px;
    background: #fff;
    font-family: var(--font-main);
    font-size: .84rem;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s;
}
.page-link:hover { border-color: #FF5722; color: #FF5722; background: #FFF3EF; }
.pagination-info {
    font-size: .84rem;
    font-weight: 600;
    color: #64748b;
    padding: 9px 18px;
    background: #f8fafc;
    border-radius: 10px;
}

/* ─── Tarjeta destacada ─── */
.vehicle-card-wrapper.is-featured .vehicle-card {
    border: 1.5px solid rgba(245,158,11,.5);
    box-shadow: 0 0 0 3px rgba(245,158,11,.07), 0 8px 24px rgba(0,0,0,.09);
}
.badge-featured {
    position: absolute; top: 12px; right: 12px;
    background: linear-gradient(135deg,#F59E0B,#FF5722);
    color: #fff;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    box-shadow: 0 3px 10px rgba(245,158,11,.35);
    z-index: 2;
}

/* ─── Empty State ─── */
.empty-state {
    grid-column: 1/-1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 80px 30px;
    background: #fff;
    border: 1.5px dashed #e8ecf0;
    border-radius: 16px;
}
.empty-state__icon {
    width: 72px; height: 72px;
    background: #f8fafc;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 1.8rem;
    border: 1.5px solid #e8ecf0;
}
.empty-state h3 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.empty-state p { margin: 0 0 24px; color: #64748b; font-size: .9rem; max-width: 420px; }
.empty-state__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn-ai-suggest {
    padding: 11px 22px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg,#FF7043,#FF5722);
    color: #fff;
    font-family: var(--font-main);
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: opacity .2s, transform .15s;
    box-shadow: 0 4px 14px rgba(255,87,34,.3);
}
.btn-ai-suggest:hover { opacity: .9; transform: translateY(-2px); }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .buscar-layout { grid-template-columns: 1fr; }
    
    .mobile-filters-btn { display: flex; }
    .close-filters-btn { display: flex; }
    
    .mobile-action-buttons { display: flex !important; width: 100%; margin-top: 10px; border-top: 1px solid #e2e8f0; padding-top: 12px; gap: 24px; }
    .mobile-action-buttons .mobile-filters-btn { 
        flex: 1; justify-content: center; 
        background: transparent; color: #334155; 
        border: none; box-shadow: none; font-size: 1rem; font-weight: 700;
        padding: 0;
    }
    .sort-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        z-index: 1050;
        border-radius: 24px 24px 0 0;
        padding: 24px;
        margin: 0;
        border: none;
        box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        flex-direction: column;
        align-items: flex-start;
    }
    .sort-bar.is-open { transform: translateY(0); }
    .sort-bar__options { flex-direction: column; width: 100%; gap: 12px; }
    .sort-chip { width: 100%; text-align: center; padding: 14px; font-size: 1.05rem; }

    .filters-panel, .corporate-filters-panel { 
        position: fixed; top: 0; left: 0; 
        height: 100%; width: 320px; max-width: 85vw;
        background: #fff;
        z-index: 1050; border-radius: 0;
        margin: 0; overflow-y: auto; padding: 24px; padding-bottom: 80px;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .filters-panel.is-open, .corporate-filters-panel.is-open { transform: translateX(0); }
    
    .results-header { flex-direction: column; align-items: flex-start; padding-bottom: 12px; }
}
@media (max-width: 640px) {
    .buscar-layout { padding: 20px 16px 48px; }
    .sort-bar { flex-direction: column; align-items: flex-start; }
    .vehicles-grid { grid-template-columns: 1fr; }
}
