/**
 * AutoCRM Vehicles Grid - Estilos para el inventario
 */

.autocrm-vehicles-inventory {
    padding: 40px 0;
}

/* ========== FILTROS ========== */
.inventory-filters {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-search,
.filter-select {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s;
}

.filter-search:focus,
.filter-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-reset-btn {
    padding: 12px 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.filter-reset-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Contador de Resultados */
.inventory-results-count {
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #f0f9ff;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    font-weight: 600;
    color: #1e40af;
}

/* ========== GRID DE VEHÍCULOS ========== */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.vehicle-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    border-color: #2563eb;
}

.vehicle-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Imagen */
.vehicle-card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f3f4f6;
}

.vehicle-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.vehicle-card:hover .vehicle-card-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #9ca3af;
}

/* Badges */
.vehicle-badge {
    position: absolute;
    top: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
}

.vehicle-badge.status-vendido,
.vehicle-badge.status-reservado {
    left: 12px;
}

.vehicle-badge.status-vendido {
    background: rgba(5, 150, 105, 0.95);
    color: white;
}

.vehicle-badge.status-reservado {
    background: rgba(245, 158, 11, 0.95);
    color: white;
}

.vehicle-badge.badge-new {
    right: 12px;
    background: rgba(59, 130, 246, 0.95);
    color: white;
}

/* Contenido */
.vehicle-card-content {
    padding: 20px;
}

.vehicle-card-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #111827;
    line-height: 1.3;
}

.vehicle-card-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 15px;
}

.vehicle-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.vehicle-card-specs .spec {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.vehicle-card-price {
    font-size: 26px;
    font-weight: 800;
    color: #2563eb;
    margin-top: 12px;
}

/* Sin Vehículos */
.no-vehicles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.no-vehicles-icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-vehicles h3 {
    font-size: 24px;
    color: #374151;
    margin: 0 0 10px 0;
}

.no-vehicles p {
    color: #6b7280;
    margin: 0;
}

/* Loading */
.vehicles-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .vehicles-grid {
        grid-template-columns: 1fr;
    }

    .inventory-filters {
        grid-template-columns: 1fr;
    }

    .filter-reset-btn {
        width: 100%;
    }
}

/* ========== CARD FOOTER ========== */
.vehicle-card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.vehicle-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-view-details {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-view-details:hover {
    background: #1d4ed8;
}

/* ========== SPEC ITEMS EN CARDS ========== */
.vehicle-card-specs .spec {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== FAVORITO EN CARD ========== */
.vehicle-card-image {
    position: relative;
}

.btn-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-favorite:hover {
    background: white;
    transform: scale(1.15);
}

/* ========== COMPARE BUTTON EN CARDS ========== */
.btn-compare-vehicle {
    padding: 8px 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-compare-vehicle:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.btn-compare-vehicle.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}
