/* Variables de entorno - MODO OSCURO */
:root {
    --primary-color: #3B82F6; /* Azul ajustado para contraste en fondos oscuros */
    --primary-hover: #2563EB;
    --accent-color: #F59E0B; /* Ámbar/Naranja para llamadas a la acción destacadas */
    --accent-hover: #D97706;
    --bg-color: #111827; /* Fondo general ultra oscuro */
    --surface-color: #1F2937; /* Color de tarjetas y menús */
    --text-main: #F9FAFB; /* Blanco roto para el texto principal */
    --text-muted: #9CA3AF; /* Gris intermedio para textos secundarios */
    --border-color: #374151; /* Bordes sutiles oscuros */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Botones */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover:not(:disabled) { background-color: var(--primary-hover); }
.btn-accent { background-color: var(--accent-color); color: #111827; font-weight: 600; }
.btn-accent:hover:not(:disabled) { background-color: var(--accent-hover); color: white; }
.btn-outline { border: 1px solid var(--border-color); color: var(--text-main); background: transparent; }
.btn-outline:hover { background-color: var(--surface-color); border-color: var(--text-muted); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* Navegación */
.navbar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.5rem; font-weight: 700; }
.logo span { color: var(--primary-color); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a:not(.btn) { font-weight: 500; color: var(--text-muted); transition: var(--transition); }
.nav-links a:not(.btn):hover { color: var(--text-main); }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.hamburger span { width: 25px; height: 3px; background-color: var(--text-main); border-radius: 2px; }

/* Sección Hero */
.hero {
    background: linear-gradient(rgba(17, 24, 39, 0.85), rgba(17, 24, 39, 0.85)), url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
    padding: 6rem 20px;
    text-align: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; margin-bottom: 2rem; color: var(--text-muted); }

/* Inputs y Selectores (Adaptados a modo oscuro) */
input, select {
    background-color: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.search-box {
    background: var(--surface-color);
    padding: 10px;
    border-radius: 8px;
    display: inline-flex;
    gap: 10px;
    max-width: 800px;
    width: 100%;
}
.search-box select { flex: 1; padding: 12px; border-radius: 4px; outline: none; font-family: inherit; }

/* Filtros rápidos */
.quick-filters { display: flex; gap: 10px; padding: 2rem 20px 0; overflow-x: auto; scrollbar-width: none; }
.quick-filters::-webkit-scrollbar { display: none; }
.filter-pill {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}
.filter-pill:hover { border-color: var(--primary-color); background: rgba(59, 130, 246, 0.1); }

/* Grid de Vehículos */
.featured-cars { padding: 4rem 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.section-header h2 { font-size: 1.8rem; }
.view-all { color: var(--primary-color); font-weight: 600; }
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }

/* Tarjetas */
.car-card {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
}
.car-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: #4B5563; }

.car-image { position: relative; height: 200px; }
.car-image img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--primary-color); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

.btn-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}
.btn-favorite svg { width: 20px; height: 20px; color: var(--text-muted); transition: var(--transition); }
.btn-favorite:hover { background: var(--surface-color); }
.btn-favorite.active svg { fill: #EF4444; color: #EF4444; stroke: #EF4444; }

.car-info { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.car-info h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.car-specs { display: flex; gap: 15px; margin-bottom: 1rem; color: var(--text-muted); font-size: 0.85rem; }

.car-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.price-box { display: flex; flex-direction: column; }
.price { font-size: 1.25rem; font-weight: 700; color: var(--primary-color); }
.old-price { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }

/* Opción Comparar */
.car-compare {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}
.car-compare label { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.car-compare input[type="checkbox"] { accent-color: var(--primary-color); width: 16px; height: 16px; cursor: pointer; }

/* Barra Flotante de Comparación */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}
.compare-bar.visible { transform: translateY(0); }
.compare-info { font-size: 1rem; font-weight: 500; }

/* Banner de Tasación */
.sell-banner { margin: 3rem auto; }
.sell-content {
    background: linear-gradient(135deg, #1E3A8A, #172554); /* Tonos azules muy oscuros */
    border: 1px solid #1E3A8A;
    color: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
}
.sell-content h2 { margin-bottom: 1rem; font-size: 1.8rem; }
.sell-content p { margin-bottom: 2rem; color: #BFDBFE; }
.sell-actions { display: flex; gap: 10px; justify-content: center; max-width: 500px; margin: 0 auto; }
.input-matricula { padding: 10px 15px; border-radius: 6px; border: 1px solid #3B82F6; flex: 1; font-size: 1rem; text-transform: uppercase; background: #0F172A; color: white;}

/* Media Queries */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: var(--surface-color); padding: 20px; border-bottom: 1px solid var(--border-color); }
    .nav-links.active { display: flex; }
    .hamburger { display: flex; }
    .search-box { flex-direction: column; }
    .compare-bar { flex-direction: column; gap: 10px; text-align: center; }
}
@media (max-width: 600px) {
    .sell-actions { flex-direction: column; }
}